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
DEPRECATED. The Holochain framework implemented in rust with a redux style internal state-model.

Holochain-rust Travis: Circle CI: Codecov: License: This code is loosely based on the previous Golang prototype. Code Status: This Rust version is alp

Holochain 1k Jan 3, 2023
The CLI to control StewardX

StewardX CLI Logo converted to ASCII via https://asciiart.club/ The CLI to control StewardX This is the official CLI to control StewardX. Made with #c

Gökay Okyay 5 May 26, 2021
Cardano Command Line Interface (CLI) (Deprecated)

Deprecated Note: This repository implements supports for Cardano Byron, and will not be updated to works on Cardano Shelley and further. cardano-cli T

Input Output 87 Oct 9, 2022
rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

Input Output 275 Oct 9, 2022
rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

Input Output 275 Oct 9, 2022
Crunch is a command-line interface (CLI) to claim staking rewards every X hours for Substrate-based chains

crunch · crunch is a command-line interface (CLI) to claim staking rewards every X hours for Substrate-based chains. Why use crunch To automate payout

null 39 Dec 8, 2022
Railway CLI - This is the command line interface for Railway.

Railway CLI This is the command line interface for Railway. Use it to connect your code to Railways infrastructure without needing to worry about envi

Nebula 4 Mar 20, 2022
Scouty is a command-line interface (CLI) to keep an eye on substrate-based chains and hook things up

scouty is a command-line interface (CLI) to keep an eye on substrate-based chains and hook things up

TurboFlakes 15 Aug 6, 2022
Gix is a command-line interface (CLI) to access git repositories

gix is a command-line interface (CLI) to access git repositories. It's written to optimize the user-experience, and perform as good or better than the

Sebastian Thiel 5.2k Jan 5, 2023
SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project.

SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project. With just a few primary configurations, such as project name, you can get started quickly.

Gabriel Michaliszen 4 May 9, 2023
tpp (Tera Pre-Processor) is a versatile CLI (Command Line Interface) tool crafted for preprocessing files using the Tera templating engine.

tpp (Tera Pre-Processor) is a versatile CLI (Command Line Interface) tool crafted for preprocessing files using the Tera templating engine. Drawing inspiration from pre-processors like cpp and gpp, tpp is the next evolution with its powerful expressive toolset.

null 3 Nov 23, 2023
[DEPRECATED] password manager thing

NOTE: this is pretty much abandoned, I recommend Bitwarden now. There is an export command in the CLI that produces CSV suitable for import into Bitwa

null 312 Oct 22, 2022
Webpack loader for Rust files. DEPRECATED, use WasmPack instead

The project is in low maintance now Use WasmPack instead Webpack Rust loader Webpack loader for Rust Example add.rs #[no_mangle] pub fn add(a: i32, b:

Max Eliseev 36 Jan 12, 2022
** Deprecated **

parallel-getter When fetching a file from a web server via GET, it is possible to define a range of bytes to receive per request. This allows the poss

Pop!_OS 69 Jun 19, 2021
DEPRECATED. The Holochain framework implemented in rust with a redux style internal state-model.

Holochain-rust Travis: Circle CI: Codecov: License: This code is loosely based on the previous Golang prototype. Code Status: This Rust version is alp

Holochain 1k Jan 3, 2023
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
Fully typed SQL query builder for Rust [deprecated]

What is Deuterium? Deuterium is a fancy SQL builder for Rust. It's designed to provide a DSL to easily build SQL queries in safe and typed way. Like R

Stanislav Panferov 169 Nov 20, 2022
Read-optimized cache of Cardano on-chain entities

Read-optimized cache of Cardano on-chain entities Intro Scrolls is a tool for building and maintaining read-optimized collections of Cardano's on-chai

TxPipe 58 Dec 2, 2022
Uses the cardano mini-protocols to receive every block and transaction, and save them to a configurable destination

cardano-slurp Connects to one or more cardano-node's, streams all available transactions, and saves them to disk (or to S3) in raw cbor format. Usage

Pi Lanningham 16 Jan 31, 2023