Command Line Interface

Synopsis

Uplink provides a command line interface which can be used to manage and setup: blockchains, keypairs, contracts, ledger data and oracle services.

$ uplink --help

Usage: uplink COMMAND

Available options:
    -h,--help                Show this help text

Available commands:
    chain                    Manage and setup blockchains.
    keys                     Manage keypairs.
    scripts                  Manage smart contract scripts.
    data                     Manage ledger data andd oracle services.
    console                  Connect to a node and issue transactions.
    repl                     Simulate contracts.
    version                  Version info

Keys

The keys command is used to generate new keypairs.

$ uplink keys --help

Usage: uplink keys COMMAND
    Manage keypairs.

Available options:
    -h,--help                Show this help text

Available commands:
    authority                Manage keypairs

Examples:

# Generate 3 key pairs
uplink keys authority 3

Scripts

The uplink script command is used to compile, format, lint, extract the graph of, or run a REPL for FCL smart contracts.

$ uplink scripts --help

Usage: uplink scripts (COMMAND | COMMAND | COMMAND | COMMAND | COMMAND)
    Manage smart contract scripts.

Available options:
    -h,--help                Show this help text

Available commands:
    compile                  Compile and typecheck a script.
    format                   Format a script
    lint                     Lint a script.
    graph                    Extract graph from a script.

Examples:

# Typecheck and dump method types
uplink compile examples/minimal.s

# Same as above except check local variable types against a locals store.
uplink scripts compile examples/locals.s --localStorage examples/locals_store.json

Console

The uplink console command creates a console interface with which to interact with an Uplink node. Comprehensive documentation on how to use this feature can be found on the Console documentation page.

Data

The uplink data command is used to inspect the ledger state via the command line, commit to a local storage, or export ledger data and/or blocks as JSON or XML.

$ uplink data --help

Usage: uplink data (COMMAND | COMMAND | COMMAND | COMMAND | COMMAND | COMMAND)
                   [-b|--backend URI]
  Manage ledger data and oracle services.

Available options:
  -h,--help                Show this help text
  -b,--backend URI         Specify the storage backend uri

Available commands:
  get                      Get by address
  list                     List all
  export                   Export data to file
  commit                   Commit local storage
  loadAsset                Load Asset at Address into AssetDB
  loadAccount              Load Account into AccountDB

Examples:

# dump all accounts, contracts, blocks and assets
uplink list

# Commit local storage
uplink data commit <store.json> <contract_addr> <account_addr>

# Export uplink blocks as XML
uplink data export blocks --format XML

# Export uplink ledger as JSON
uplink data export ledger -f JSON