Cardano Command Line Interface (CLI) (Deprecated)

Overview

Deprecated Note:

This repository implements supports for Cardano Byron, and will not be updated to works on Cardano Shelley and further.

cardano-cli

Build Status MIT or APACHE-2 licensed Cardano Mainnet Cardano Staging Cardano Staging

The Cardano command line interface provides the following features:

  • powerful blockchain manager: with download, explore, verify, and analyze functions
  • ability to manage multiple wallets: Daedalus', Icarus' or custom wallets
  • flexible transaction build engine

This command line interface is built upon the Rust Cardano SDK.

Warning

  • The software is currently still in alpha phase, please do not use for any other purpose than debugging and testing, until stable releases are available.
  • While most of the operations in the CLI is in a reading state, and are thus relatively safe even in the presence of bugs, do take special note that transaction send will permanently change your state.
  • It ia advisable to trial testnet operations (depending on testnet availability), prior to completing mainnet operations.
  • If you think something is suspicious, it may very well be the case. Check the documentation, or ask for help.
  • Do not share your wallet mnemonics, passwords, cryptographic material, or pending signatures.

Installation guide

While it is recommended to wait for official releases, it is also possible to build the executable yourself by following these steps:

  1. install rust toolchain;
  2. clone the project repository (with the dependencies)
    git clone https://github.com/input-output-hk/cardano-cli.git --recursive
  3. build and install the binary:
    cd cardano-cli
    cargo install
  4. enjoy

Usage

Quick start

$ cardano-cli blockchain new mainnet
$ cardano-cli blockchain pull mainnet
$ cardano-cli wallet create "My Wallet"
$ cardano-cli wallet attach "My Wallet" mainnet
$ cardano-cli wallet sync   "My Wallet"
$ cardano-cli wallet status "My Wallet"

Complete documentation

Command line documentation

Supported platforms

Target test
aarch64-unknown-linux-gnu
arm-unknown-linux-gnueabi
armv7-unknown-linux-gnueabihf
i686-unknown-linux-gnu
i686-unknown-linux-musl
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
i686-apple-darwin
x86_64-apple-darwin
x86_64-apple-darwin
i686-unknown-freebsd
x86_64-unknown-freebsd

Supported compiler versions

Rust test
stable
beta
nightly

We aim to support compiler versions as far as version 1.30. However, this is not a contract. Support of older compiler versions may be dropped in the future as we see fit.

License

This project is licensed under either of the following licenses:

Please choose your appropriate license.

Comments
  • Daedalus wallet recovery: address payload of infinite size bug make cardano-cli crash

    Daedalus wallet recovery: address payload of infinite size bug make cardano-cli crash

    Running cardano-cli wallet sync mywallet

    syncing wallet from 82.13 to 85.2368
    ⠙ [00:00:00] [###>------------------------------------] 6064/67155 (3s)
    memory allocation of 18446744073709551613 bytes failed
    

    Looks like a bit too much memory.

    * wallet model RandomIndex2Levels
     * derivation scheme V1
     * synced to block  9eab5304cc7a5d8106606f99966b14f458e99798d38e547da37e30740a7936f2 (82.13)
    
    bug 
    opened by backuitist 19
  • Cannot find inputs within the local UTxOs

    Cannot find inputs within the local UTxOs

    on C: import the file, sent it to network

    when I use command

    "cardano-cli transaction add-input 25Ab2p01affa1bc8f35efeb7eea54e2ac1113f80d8628502c0f5a87f3295634f6df53f 2 "

    01affa1bc8f35efeb7eea54e2ac1113f80d8628502c0f5a87f3295634f6df53f 2 is one address's utxo but not exist in I machine.

    Errror:Cannot find inputs within the local UTxOs

    so it is mean when create a transaction. input addr must in local machine ????

    I just want use one addr utxo then create transaction. then send transaction to another machine which not connect internet to sign it .

    bug 
    opened by purplecity 17
  • wallet sync command not working

    wallet sync command not working

    Hi guys

    I try to issue these commands

    cardano-cli blockchain pull mainnet

    image

    and then I sync my wallet to the blockchain

    cardano-cli wallet sync "My Wallet"

    image

    but it seems its not writing the updates to the wallet data file image

    its always stuck to the first point when i attached the wallet

    but this is fixed when i detach / attach but then i get the error again, so it takes a very long time to get updates to the wallet by doing "detach/attach"

    but maybe I'm doing something wrong.

    OS: Windows Sub-System for Linux, Ubuntu 18

    Thank you!

    bug 
    opened by Mercurial 8
  • Generate Keys by Flipping Coin or By Method Known is Truly Random And Unhackable

    Generate Keys by Flipping Coin or By Method Known is Truly Random And Unhackable

    Hi All, Crazy as it may sound - I generate my private keys on the Ethereum block chain by flipping a coin.

    This way even if someone were to place malware into my client which will produce a predictable private key my funds can not be stolen by this attack.

    Before I can seriously invest in Cardano, I must be able to use my own private key which has been produced by some manner that is known to be truly random and unhackable.

    Is it possible using the Cardano-CLI to create a wallet from a private key which has been generated by some offline method such as flipping a coin?

    Thanks, John

    enhancement 
    opened by johnshearing 5
  • Offline Transactions

    Offline Transactions

    Using Web3 for Ethereum at the command line it is possible to create and send offline transactions from an airgapped computer without syncing to the blockchain.

    This video shows how to create the offline transaction on an airgapped device using the CLI:

    This video shows how to send the offline transaction to the blockchain without needing to sync up or even have a copy of the blockchain.

    This video shows an airgapped device created for making offline transactions.

    I need this level of security before I can seriously invest in Cardano. Can I create and send offline transactions from an airgapped device using the Cardano-CLI? Thanks, John

    question 
    opened by johnshearing 5
  • [Technical Support For Listing] Bitrue Exchange Ticket (58988)

    [Technical Support For Listing] Bitrue Exchange Ticket (58988)

    We have two quick questions regarding the implementation, can you please help us take a look?

    1. When creating wallet via cardano-cli, how do you set mnemonic words? And if will the wallet be able to be recovered from another device which has cardano-cli installed?

    2. What is the maximum number of addresses allowed in each wallet under the cardano-cli?

    3. We did a test in which we have sent a certain amount of ADAs to two different addresses in one wallet under the cardano-cli, but only to see UTXO shown in one of the addresses after executing cardano-cli wallet utxos.

    Thanks for your help!


    Following is the original ticket sent to iohk

    Here's the list of questions:

    Can the address be generated offline? Can we pull out the private key once generated offline?

    Will the transaction be generated offline and broadcasted through the node after being signed with the private key?

    Do you support JSON-RPC type of request like Ethereum does?

    If we use cardano-cli as a black-box program to support ADA, how do we ensure that the value of “actual fee” is larger than that of “fee”? Because the fee and tx-bytes will only show after input and output being filled.

    Can the private key of the address be exported using cardano-cli?

    Can we pull out the original transaction hash that has been signed (before being broadcasted) using cardano-cli?

    Can the cardano-cli be used as a node, for the purpose of like searching for transactions and checking balances. Do you have an API for it?

    How do other exchanges support ADA, is it via cardano-cli or cardano-sl?

    How do other exchanges confirm transactions? Is it by using lowest assurance, medium assurance or high assurance?

    Can the private key be exported from cardano-sl’s wallet address?

    Can we pull out the original transaction hash that has been signed (before being broadcasted) using cardano-sl?

    While using the API from cardano-api package, what does “cbeBlockLead” and “cbsMerkleRoot” mean in the block details section?

    While using the API from cardano-api package, what does “ctsRelayedBy” mean in the transaction details section?

    How long does it normally take to produce a block? Is it around 20 seconds? The 20 seconds result is a calculation based on the comparison between different values of “ctbTimeIssued” from cardano-api since it’s not shown in the explorer.

    opened by BitrueExchange 4
  • sync is creating duplicate UTxO in the LOG file

    sync is creating duplicate UTxO in the LOG file

    This issue puts the wallet into a bad state. Once in this bad state the wallet will report the below error for many functions:

    ./target/debug/cardano-cli wallet status my_magic_wallet
    Wallet clean on blockchain mainnet
     * wallet model BIP44
     * derivation scheme V2
    ERROR 2018-11-06T02:06:49Z: cardano_cli::wallet::state::state: This UTxO was already in the UTxOs collection `Ae2tdPwUPEZZZZZinWnudbNtHQddCyc6bCwLVoQx4GfH1NvwztGRpRkewTe (0.0.0) received 1.000000Ada in transaction id `60540befd34211b88888dd216410ec8772d25645ad7826e69cb20662411e8a2a.1''
    thread 'main' panicked at 'The Wallet LOG file seems corrupted', src/wallet/state/state.rs:32:25
    

    The bad state is that the last UTxO is stored twice in the LOG file. The bad state comes about by performing a second sync operation on the wallet. To recreate, recover a wallet that has a UTxO, sync the wallet (you can see the state is correct by doing strings LOG which will show the UTxO), then sync again (again strings LOG will show the last UTxO is now stored twice).

    ./target/debug/cardano-cli wallet sync my_magic_wallet
    Enter the wallet password.
    wallet password: : 
    syncing wallet from 0.GENESIS to 81.13276
      [00:28:06] [########################################] 1762876/1762876 (0s)
    ubuntu@ip-172-31-21-95:~/cardano-cli$ ./target/debug/cardano-cli wallet sync clean
    Enter the wallet password.
    wallet password: : 
    syncing wallet from 81.11021 to 81.13276
      [00:00:05] [########################################] 1255/1255 (0s)
    ubuntu@ip-172-31-21-95:~/cardano-cli$ ./target/debug/cardano-cli wallet status my_magic_wallet
    Wallet clean on blockchain mainnet
     * wallet model BIP44
     * derivation scheme V2
    ERROR 2018-11-06T02:06:49Z: cardano_cli::wallet::state::state: This UTxO was already in the UTxOs collection `Ae2tdPwUPEZZZZZinWnudbNtHQddCyc6bCwLVoQx4GfH1NvwztGRpRkewTe (0.0.0) received 1.000000Ada in transaction id `60540befd34211b88888dd216410ec8772d25645ad7826e69cb20662411e8a2a.1''
    thread 'main' panicked at 'The Wallet LOG file seems corrupted', src/wallet/state/state.rs:32:25
    

    It looks like the second sync, instead of starting where the last sync finished (81.13276) instead starts from the block time of the last UTxO in the log (81.11021), I am guessing this causes that UTxO to be picked up again, or maybe it is something about the reading/writing of the LOG. Not sure.

    More here: https://forum.cardano.org/t/cardano-cli/16654/19

    bug 
    opened by HM999 4
  • wallet detach

    wallet detach

    Wrong success message after using wallet detach.

    • cardano-cli wallet detach "wallet-name" Message: Wallet successfully attached to blockchain.
    help wanted good first issue 
    opened by Syr3mas 4
  • Several sync duplicate UTxO credits without warning or fatal errors

    Several sync duplicate UTxO credits without warning or fatal errors

    Hello. I wanted to play a little with cardano-cli on both macOS and windows 10. (I pulled the master branch approx 10 days ago) I am commenting this issue because I managed after syncing several times a wallet to generate a DOUBLE UTXO CREDIT which gives me a wrong final balance. Indeed if i detach and attach the wallet to the blockchain and finally resync the wallet last utxo credit is not duplicated in the log. Contrarily to @HM999 I did not have any kind of fatal errors But it's quite annoying having to make [detach, attach and syncing] operations again to be in a "correct" state.

    What would you suggest? Thanks duplicated-credit-cardano-cli status-wallet utxos

    bug 
    opened by chisNaN 3
  • cargo install error

    cargo install error

    warning: value assigned to out_total_min is never read --> cardano-deps/cardano/src/txbuild.rs:149:21 | 149 | let mut out_total_min = Coin::zero(); | ^^^^^^^^^^^^^^^^^ | = note: #[warn(unused_assignments)] on by default

    Compiling tokio-core v0.1.17 warning: unused std::result::Result which must be used --> cardano-deps/cardano/src/block/verify_chain.rs:282:9 | 282 | mem::replace(res, err); | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: #[warn(unused_must_use)] on by default

    Compiling tokio-proto v0.1.1 Compiling hyper v0.11.27 Compiling protocol v0.1.0 (file:///home/ec2-user/cardano-cli/cardano-deps/protocol) Compiling cardano-storage v0.1.0 (file:///home/ec2-user/cardano-cli/cardano-deps/storage) Compiling exe-common v0.1.0 (file:///home/ec2-user/cardano-cli/cardano-deps/exe-common) error[E0658]: use of unstable library feature 'assoc_unix_epoch' (see issue #49502) --> cardano-deps/exe-common/src/parse_genesis_data.rs:36:9 | 36 | SystemTime::UNIX_EPOCH + unix_displacement | ^^^^^^^^^^^^^^^^^^^^^^

    error: aborting due to previous error

    For more information about this error, try rustc --explain E0658. error: failed to compile cardano-cli v1.0.0-alpha2 (file:///home/ec2-user/cardano-cli), intermediate artifacts can be found at /home/ec2-user/cardano-cli/target

    Caused by: Could not compile exe-common.

    To learn more, run the command again with --verbose.

    help wanted 
    opened by purplecity 3
  • [FR] Conversion of cardano-address generated keys (base16) to cborHex

    [FR] Conversion of cardano-address generated keys (base16) to cborHex

    External

    As a pool operator dealing with funds/staking keys of (non-technical) pool owners is too complicated. Pool owners (pledging) should not need the cardano-cli to monitor and manage their funds.

    We can create mnemonics using cardano-address, as well as keys and addresses. Keys can be base16.

    cardano-cli only understands key files in cborHex.

    Feature request

    Either have

    cardano-cli understand raw base16 keys

    or

    expose a conversion command in cardano-cli, that simply takes the base16 key generated using cardano-address and converts it to a cborHex skey/vkey file readable by cardano-cli.

    As far as I understand it, we could then restore a wallet in Daedalus using the mnemonics, monitor/manage funds, if necessary, but still have generated the necessary payment and staking keys using cardano-address/cli.

    This is potential useful for all pool operators/owners.

    @kantp

    opened by MarcelKlammer 2
Releases(v1.0.1)
Owner
Input Output
Input Output
Rust-native building blocks for the Cardano blockchain ecosystem

Pallas Rust-native building blocks for the Cardano blockchain ecosystem. Introduction Pallas is an expanding collection of modules that re-implements

null 78 Dec 6, 2022
The rust implementation of the Defluencer command line interface.

Defluencer CLI IPFS daemon must be running before using the CLI. Command: ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub For more info

Defluencer 7 Dec 22, 2022
A type-safe Rust interface to the Nix CLI

runix A typesafe interface to the nix CLI. by flox Installation Install with cargo add (Rust >= 1.64) cargo add runix Alternatively, manually add runi

flox 43 Mar 6, 2023
Trustworthy encrypted command line authenticator app compatible with multiple backups.

cotp - command line totp authenticator I believe that security is of paramount importance, especially in this digital world. I created cotp because I

Reply 71 Dec 30, 2022
Rust command line program for Bitcoin brainwallet

brainwallet Rust command line program for Bitcoin brainwallet as implemented at https://www.bitaddress.org. To run it, first install Rust, e.g. from h

Frank Buss 3 Dec 30, 2021
A command-line tool to export FoundationDB stored protocol buffers to ClickhouseDB

fdb-ch-proto-export A command-line tool to export FoundationDB stored Protocol buffers to ClickhouseDB. Installation N/A Usage fdb-ch [command] fdb-c

Enlay 7 May 26, 2022
Easily and securely share files from the command line. A fully featured Firefox Send client.

Notice: the default Send host is provided by @timvisee (info). Please consider to donate and help keep it running. ffsend Easily and securely share fi

Tim Visée 6.3k Dec 25, 2022
The fallen leaves tell a story... of a colorful file tree visualizer for the command-line.

Erdtree A bLazInGlY fAsT, simplified version of the ancient tree command which displays a colorful depth indented listing of files with their memory s

Benji Nguyen 174 Nov 16, 2022
Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Ahmad Abdullahi Adamu 7 Jan 9, 2023
A command line tool for managing financial investment portfolios written in Rust.

A command line tool for managing financial investment portfolios written in Rust. This project is the modern successor of finance. Installation You ca

Markus Zoppelt 15 Dec 21, 2022
A template for command-line Rust programs

This is a template for command-line Rust programs. Clone and run the rename script with both a lowercase and UpperCase name. In the dev profile, depen

ludios 2 Oct 3, 2022
RGB smart contracts: client-facing library & command-line for desktop and mobile

RGB smart contracts RGB is confidential & scalable client-validated smart contracts for Bitcoin & Lightning. It embraces the concepts of private & mut

RGB: scalable & private smart contracts for bitcoin & lightning 4 Mar 15, 2023
A simple and secure rust command-line tool to protect your text by encrypting and decrypting it using the robust AES-256 algorithm.

Secret Keeper A simple and secure command-line tool to protect your text by encrypting and decrypting it using the robust AES-256 algorithm. Built wit

Kunal Bagaria 9 May 11, 2023
Lockbox is a command-line tool for generating and managing passwords

Lockbox is a command-line tool for generating and managing passwords. It uses strong encryption algorithms to securely store your passwords, so you can be sure that your data is safe.

Sonu Bardai 15 Oct 9, 2023
A simple command-line application to securely store secrets using encryption

rust-secret-vault A simple yet robust command-line tool designed to safely encrypt and store your sensitive information. Harnessing the power of AES-2

Luis Soares 4 Nov 22, 2023
Sample lightning node command-line app built on top of Ldk Node (similar to ldk-sample).

ldk-node-sample Sample lightning node command-line app built on top of Ldk Node (similar to ldk-sample ). Installation git clone https://github.com/op

optout 3 Nov 21, 2023
Package used by the cosmos-rust-interface. Makes direct use of cosmos-rust.

Package used by the cosmos-rust-interface. Makes direct use of cosmos-rust (cosmos‑sdk‑proto, osmosis-proto, cosmrs).

Philipp 4 Dec 26, 2022
The Ink! smart contract SDK for XVM interface

Ink! XVM SDK The Ink! smart contract SDK for XVM interface. This SDK contains contract wrappers and all middleware code to make XVM development easy.

Astar Network 13 Jan 3, 2023
A blazingly fast and memory safe password cracker with user interface.

HashVat A blazingly fast and memory safe password cracker with user interface. HashVat runs with user interface and is capable of cracking the 1.000.0

JBLDSKY 2 Dec 6, 2022