Skip to content

Sub Commands

LinFeng Qian edited this page Feb 19, 2020 · 1 revision

rpc: Invoke RPC call to node

    get_block                               Get block content by hash
    get_block_by_number                     Get block content by block number
    get_block_hash                          Get block hash by block number
    get_cellbase_output_capacity_details    Get block header content by hash
    get_cells_by_lock_hash                  Get cells by lock script hash
    get_current_epoch                       Get current epoch information
    get_epoch_by_number                     Get epoch information by epoch number
    get_header                              Get block header content by hash
    get_header_by_number                    Get block header by block number
    get_live_cell                           Get live cell (live means unspent)
    get_tip_block_number                    Get tip block number
    get_tip_header                          Get tip header
    get_transaction                         Get transaction content by transaction hash
    deindex_lock_hash                       Remove index for live cells and transactions by the hash of lock script
    get_live_cells_by_lock_hash             Get the live cells collection by the hash of lock script
    get_transactions_by_lock_hash           Get the transactions collection by the hash of lock script. Returns
                                            empty array when the `lock_hash` has not been indexed yet
    index_lock_hash                         Create index for live cells and transactions by the hash of lock script
    get_banned_addresses                    Get all banned IPs/Subnets
    get_peers                               Get connected peers
    local_node_info                         Get local node information
    set_ban                                 Insert or delete an IP/Subnet from the banned list
    tx_pool_info                            Get transaction pool information
    get_blockchain_info                     Get chain information
    add_node                                Connect to a node
    remove_node                             Disconnect a node
    broadcast_transaction                   Broadcast transaction without verify

wallet: Transfer / query balance (with local index) / key utils

    transfer          Transfer capacity to an address (can have data)
    get-capacity      Get capacity by lock script hash or address or lock arg or pubkey
    get-live-cells    Get live cells by lock/type/code  hash
    db-metrics        Show index database metrics
    top-capacity      Show top n capacity owned by lock script hash

dao: Deposit / prepare / withdraw / query NervosDAO balance (with local index) / key utils

    deposit                  Deposit capacity into NervosDAO
    prepare                  Prepare specified cells from NervosDAO
    withdraw                 Withdraw specified cells from NervosDAO
    query-deposited-cells    Query NervosDAO deposited capacity by lock script hash or address
    query-prepared-cells     Query NervosDAO prepared capacity by lock script hash or address

account: Manage accounts

    list                List all accounts
    new                 Create a new account and print related information.
    import              Import an unencrypted private key from <privkey-path> and create a new account.
    import-keystore     Import key from encrypted keystore json file and create a new account.
    unlock              Unlock an account
    update              Update password of an account
    export              Export master private key and chain code as hex plain text (USE WITH YOUR OWN RISK)
    bip44-addresses     Extended receiving/change Addresses (see: BIP-44)
    extended-address    Extended address (see: BIP-44)

util: Utilities

    key-info                    Show public information of a secp256k1 private key (from file) or public key
    sign-data                   Sign data with secp256k1 signature
    sign-message                Sign message with secp256k1 signature
    verify-signature            Verify a compact format signature
    eaglesong                   Hash binary use eaglesong algorithm
    blake2b                     Hash binary use blake2b algorithm (personalization: 'ckb-default-hash')
    compact-to-difficulty       Convert compact target value to difficulty value
    difficulty-to-compact       Convert difficulty value to compact target value
    to-genesis-multisig-addr    Convert address in single signature format to multisig format (only for mainnet
                                genesis cells)
    to-multisig-addr            Convert address in single signature format to multisig format

molecule: Molecule encode/decode utilities

    decode     Decode molecule type from binary
    encode     Encode molecule type from json to binary
    default    Print default json structure of certain molecule type

tx: Handle common sighash/multisig transaction

    init                      Init a common (sighash/multisig) transaction
    add-multisig-config       Add multisig config
    clear-field               Remove all field items in transaction
    add-input                 Add cell input (with secp/multisig lock)
    add-output                Add cell output
    add-signature             Add signature
    info                      Show detail of this multisig transaction (capacity, tx-fee, etc.)
    sign-inputs               Sign all sighash/multisig inputs in this transaction
    send                      Send multisig transaction
    build-multisig-address    Build multisig address with multisig config and since(optional) argument

mock-tx: Handle mock transactions (verify/send)

    template    Print mock transaction template
    complete    Complete the mock transaction
    verify      Verify a mock transaction in local
    send        Complete then send a transaction