# Contractless CLI Tools This file lists the command-line tools built from `src/bin`. On Windows, add `.exe` to each tool name. Most network lookup tools prompt for the wallet decryption key because the RPC handshake is authenticated before the request is sent. Transaction creator tools produce signed transaction JSON. After creating a transaction, broadcast it with `broadcast_transaction`. ## Table of Contents - [Wallet Tools](#wallet-tools) - [Transaction Creation Tools](#transaction-creation-tools) - [Transaction Signing Tools](#transaction-signing-tools) - [Lookup Tools](#lookup-tools) - [Server Owner Tools](#server-owner-tools) - [Block and Torrent Tools](#block-and-torrent-tools) - [Utility Tools](#utility-tools) ## Wallet Tools ### create_new_wallet Creates or loads an encrypted wallet file at the requested path. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_new_wallet ``` Expected reply: ```text Long Address: Short Address: Vanity Address: Public Key: ``` ### register_wallet Registers the configured wallet short-address to long-address mapping with a peer. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text register_wallet ``` Expected reply: ```text Wallet registered: ``` or: ```text Wallet registration failed. ``` ### recreate_wallet Recreates an encrypted wallet file from a private key. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text recreate_wallet ``` Expected reply: ```text ``` ### recreate_wallet_from_image Recreates an encrypted wallet file from a private-key image. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text recreate_wallet_from_image ``` Expected reply: ```text ``` ### save_private_key_image Saves the wallet private key into an image file for offline backup. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text save_private_key_image ``` Expected reply: ```text Private key image saved to ``` ### private_key_from_image Reads a private key back from an image file. Requires: - Running node: No - Wallet key: No - Writes file: No Usage: ```text private_key_from_image ``` Expected reply: ```text ``` ### contractless-submit-key Submits the wallet decryption key to the Windows service process. This tool is Windows-only. Requires: - Running node: Windows service - Wallet key: Yes - Writes file: No Usage: ```text contractless-submit-key contractless-submit-key ping contractless-submit-key status ``` Expected reply: ```text Wallet key accepted. ``` or: ```text Pong ``` or: ```text Service state: ``` ## Transaction Creation Tools These tools prompt for the fields needed by each transaction type, sign the transaction with the configured wallet and print the signed JSON. The same JSON is also written to the transaction output folder when the tool creates the output file successfully. ### create_transfer_tx Creates a transfer transaction for base currency, tokens or NFTs. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_transfer_tx ``` Expected reply: ```text transaction: ``` ### create_tokens_tx Creates a token definition transaction. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_tokens_tx ``` Expected reply: ```text transaction: ``` ### create_issue_token_tx Creates an issue-token transaction for an existing token. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_issue_token_tx ``` Expected reply: ```text transaction: ``` ### create_nft_tx Creates an NFT transaction. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_nft_tx ``` Expected reply: ```text transaction: ``` ### create_burn_tx Creates a burn transaction. Base currency cannot be burned with this transaction type. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_burn_tx ``` Expected reply: ```text transaction: ``` ### create_marketing_tx Creates a marketing transaction. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_marketing_tx ``` Expected reply: ```text transaction: ``` ### create_vanity_tx Creates a vanity-address registration transaction. The vanity address is registered on chain, while normal block records continue using the real short address. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_vanity_tx ``` Expected reply: ```text transaction: ``` ### create_swap_tx Creates the first side of a swap transaction. The second party signs the transaction with `verify_sign_swap_tx`. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_swap_tx ``` Expected reply: ```text transaction: ``` ### create_loan_tx Creates the first side of a loan contract transaction. The second party signs the transaction with `verify_sign_loan_tx`. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_loan_tx ``` Expected reply: ```text transaction: ``` ### create_loan_payment_tx Creates a loan payment transaction for an existing loan contract. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_loan_payment_tx ``` Expected reply: ```text transaction: ``` ### create_collateral_claim_tx Creates a collateral claim transaction for an eligible loan contract. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text create_collateral_claim_tx ``` Expected reply: ```text transaction: ``` ### broadcast_transaction Broadcasts one signed transaction JSON file to the network. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: Only when a successful vanity transaction updates the saved wallet display Usage: ```text broadcast_transaction ``` Expected reply: ```text successful_broadcast: true ``` or: ```text ``` ## Transaction Signing Tools ### verify_sign_swap_tx Validates and signs the second side of a swap transaction JSON file. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text verify_sign_swap_tx ``` Expected reply: ```text Transaction: ``` ### verify_sign_loan_tx Validates and signs the second side of a loan transaction JSON file. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text verify_sign_loan_tx ``` Expected reply: ```text Transaction: ``` ## Lookup Tools Network lookup tools send binary RPC requests to a peer. Some tools print decoded JSON for readability, but JSON is not sent across the TCP stream. ### lookup_network_info Returns a summary of the connected peer state. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_network_info ``` Expected reply: ```json { "version": 1, "network": "testnet", "time": 1234567890, "wallet_prefix": "CLTC", "height": 5, "next_block_difficulty": 1183350000000000, "total_block_transactions": 6, "total_mempool_transactions": 0, "largest_tx_fee": 0 } ``` ### lookup_node_time Returns the peer timestamp as a Unix timestamp and UTC time string. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_node_time ``` Expected reply: ```text timestamp: 1234567890 time: 2009-02-13 23:31:30 UTC ``` ### lookup_height Returns the connected peer chain height. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_height ``` Expected reply: ```text 123 ``` ### lookup_difficulty Returns the next block difficulty reported by the peer. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_difficulty ``` Expected reply: ```text 1183350000000000 ``` ### lookup_largest_txfee Returns the largest transaction fee currently available for miner selection. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_largest_txfee ``` Expected reply: ```text 1.00000000 ``` ### lookup_block_by_height Looks up a block by height. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_block_by_height ``` Expected reply: ```json { "block": "" } ``` ### lookup_block_by_hash Looks up a block by its 64-character block hash. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_block_by_hash ``` Expected reply: ```json { "block": "" } ``` ### lookup_transaction Looks up a transaction by transaction hash. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_transaction ``` Expected reply: ```json { "transaction": "" } ``` ### lookup_total_transactions Returns total transaction counts by transaction category. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_total_transactions ``` Expected reply: ```json [ { "transaction_type": "", "count": 0 } ] ``` ### lookup_token Looks up one token by token name. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_token ``` Expected reply: ```json { "token": "" } ``` ### lookup_token_list Returns the token list from the connected peer. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_token_list ``` Expected reply: ```json [ "" ] ``` ### lookup_nft Looks up one NFT. Use item number `0` for a 1/1 NFT. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_nft ``` Expected reply: ```json { "nft": "" } ``` ### lookup_nft_list Returns the NFT list from the connected peer. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_nft_list ``` Expected reply: ```json [ "" ] ``` ### lookup_contract_by_hash Looks up a loan contract by contract hash. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_contract_by_hash ``` Expected reply: ```text ``` ### lookup_contract_by_address Looks up loan contracts by wallet address. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_contract_by_address ``` Expected reply: ```text ``` ### lookup_remote_balance Looks up the network balance sheet for an address file. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_remote_balance ``` Expected reply: ```text CLC = 100.00000000 TOKEN = 50.00000000 NFT:1 = 1.00000000 ``` or: ```text [] ``` ### lookup_local_balance Reads and prints a local balance sheet file directly. Requires: - Running node: No - Wallet key: No - Writes file: No Usage: ```text lookup_local_balance ``` Expected reply: ```text 100.00000000 ``` ### lookup_mempool_tx_count Returns the number of transactions currently in the peer mempool records. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_mempool_tx_count ``` Expected reply: ```text 0 ``` ### lookup_mempool_tx_by_signature Looks up one mempool transaction by signature. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_mempool_tx_by_signature ``` Expected reply: ```json { "transaction": "" } ``` or: ```text Transaction not found in mempool. ``` ### lookup_mempool_tx_by_address Looks up mempool transactions by wallet address. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_mempool_tx_by_address ``` Expected reply: ```json [ { "transaction": "" } ] ``` or: ```text [] ``` ### lookup_torrent Looks up torrent metadata by block height. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text lookup_torrent ``` Expected reply: ```json { "torrent": "" } ``` ## Server Owner Tools These tools are meant for the node operator. They send owner-style RPC commands to the configured peer. ### server_owner_block_ip Blocks an IP address. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text server_owner_block_ip ``` Expected reply: ```text ``` ### server_owner_unblock_ip Unblocks an IP address. Requires: - Running node: Reachable peer - Wallet key: Yes - Writes file: No Usage: ```text server_owner_unblock_ip ``` Expected reply: ```text ``` ## Block and Torrent Tools These tools inspect local block or torrent files. They do not ask the network for data unless the tool name starts with `lookup_`. ### average_block_time_checker Calculates the average time between local block files in a block range. Requires: - Running node: No - Wallet key: No - Writes file: No Usage: ```text average_block_time_checker ``` Expected reply: ```text Average time difference between blocks and : seconds ``` ### unpack_block_header Reads a local block file and prints the decoded block header. Requires: - Running node: No - Wallet key: No - Writes file: No Usage: ```text unpack_block_header ``` Expected reply: ```json { "header": "" } ``` ### unpack_torrent Reads a local torrent file and prints decoded torrent metadata. Requires: - Running node: No - Wallet key: No - Writes file: No Usage: ```text unpack_torrent ``` Expected reply: ```json { "announce": "", "info": "" } ``` ### validate_torrent_and_block_headers Compares a local torrent file against the matching local block file and prints each validation check. Requires: - Running node: No - Wallet key: No - Writes file: No Usage: ```text validate_torrent_and_block_headers ``` Expected reply: ```text timestamp match: passed nonce match: passed wallet address match: passed block difficulty check: passed VRF match: passed file size check: passed block header hash check: passed VRF validation check: passed VRF Proof check: passed piece 0 hash check: passed block hash check: passed Block fully validated. ``` ## Utility Tools ### postgres_installer Installs or configures PostgreSQL and prints settings values for `settings.ini`. Requires: - Running node: No - Wallet key: No - Writes file: May install or configure PostgreSQL Usage: ```text postgres_installer ``` Expected reply: ```ini [Postgres] host = 127.0.0.1 port = 5432 user = contractless password = dbname = contractless_db ``` On Windows, the tool also prints `[Postgres-Testnet]`. ### sign_message Signs a plain text message with the configured wallet. Requires: - Running node: No - Wallet key: Yes - Writes file: Yes Usage: ```text sign_message "" ``` Expected reply: ```text message: , signature: ``` ### verify_message Verifies a signed message using an address file and signature file. Requires: - Running node: No - Wallet key: No - Writes file: No Usage: ```text verify_message "" ``` Expected reply: ```text valid signature ``` or: ```text invalid signature ``` ### verify_address Verifies an address file and prints the message hash used by the verification flow. Requires: - Running node: No - Wallet key: No - Writes file: No Usage: ```text verify_address ``` Expected reply: ```text ``` ### skein_hasher Hashes text, an entire file or a byte range from a file. Requires: - Running node: No - Wallet key: No - Writes file: No Usage: ```text skein_hasher text large|small skein_hasher file large|small skein_hasher bytes large|small ``` Expected reply: ```text Hash of text '': ``` or: ```text Hash of file ``` or: ```text Hash of bytes through of file '': ```