Sawtooth CLI

sawtooth

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
usage: sawtooth [-h] [-v]
                {keygen,admin,config,block,batch,batch-status,transaction,state,cluster,submit}
                ...

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         enable more verbose output

subcommands:
  {keygen,admin,config,block,batch,batch-status,transaction,state,cluster,submit}

sawtooth admin

1
2
3
4
5
6
7
8
usage: sawtooth admin [-h] [-v] {genesis,keygen} ...

optional arguments:
  -h, --help        show this help message and exit
  -v, --verbose     enable more verbose output

subcommands:
  {genesis,keygen}

sawtooth admin genesis

Overview

The genesis CLI tool produces a file for use during initialization of a validator. A network requires an initial block (known as the genesis block) whose signature will determine the block chain id. This initial block is produced from a list of batches, which will be applied at genesis time. The input to the command is a set of zero or more files containing serialized BatchList protobuf messages. The output is a file containing a serialized GenesisData protobuf message. This file, when placed at <sawtooth_data>/genesis.batch, will trigger the genesis process.

The location sawtooth_data depends on whether or not the environment variable SAWTOOTH_HOME is set. If it is, then sawtooth_data is located at <SAWTOOTH_HOME>/data. If it is not, then sawtooth_data is located at /var/lib/sawtooth.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
usage: sawtooth admin genesis [-h] [-v] [-o OUTPUT]
                              [input_file [input_file ...]]

positional arguments:
  input_file            input files of batches to add to the resulting
                        GenesisData

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         enable more verbose output
  -o OUTPUT, --output OUTPUT
                        the name of the file to ouput the GenesisData

Arguments

  • input_batch_file - a repeated list of files containing a serialized BatchList message. This may be empty, which will produce an empty genesis block.
  • --output <filename> - a target file where the serialized GenesisData will be written. Defaults to <sawtooth_data>/genesis.batch.

Output

The output of the command displays a message where the output GenesisData is written.

Example

> sawtooth admin genesis config.batch mktplace.batch
Generating /var/lib/sawtooth/genesis.batch

sawtooth admin keygen

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
usage: sawtooth admin keygen [-h] [-v] [--force] [-q] [key_name]

positional arguments:
  key_name       name of the key to create

optional arguments:
  -h, --help     show this help message and exit
  -v, --verbose  enable more verbose output
  --force        overwrite files if they exist
  -q, --quiet    print no output

sawtooth batch

1
2
3
4
5
6
7
usage: sawtooth batch [-h] {list,show} ...

optional arguments:
  -h, --help   show this help message and exit

grandchildcommands:
  {list,show}

sawtooth batch list

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
usage: sawtooth batch list [-h] [--url URL] [-u USERNAME[:PASSWORD]]
                           [-F {csv,json,yaml,default}]

optional arguments:
  -h, --help            show this help message and exit
  --url URL             the URL of the validator's REST API
  -u USERNAME[:PASSWORD], --user USERNAME[:PASSWORD]
                        user login info to authorize request
  -F {csv,json,yaml,default}, --format {csv,json,yaml,default}
                        the format to use when printing the output

details:
        Lists committed batches from newest to oldest, including their id (i.e.
    header signature), transaction count, and their signer's public key.
    

sawtooth batch show

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
usage: sawtooth batch show [-h] [--url URL] [-u USERNAME[:PASSWORD]] [-k KEY]
                           [-F {yaml,json}]
                           batch_id

positional arguments:
  batch_id              the id (i.e. header_signature) of the batch

optional arguments:
  -h, --help            show this help message and exit
  --url URL             the URL of the validator's REST API
  -u USERNAME[:PASSWORD], --user USERNAME[:PASSWORD]
                        user login info to authorize request
  -k KEY, --key KEY     specify to show a single property from the block or
                        header
  -F {yaml,json}, --format {yaml,json}
                        the format to use for printing the output (defaults to
                        yaml)

details:
        Shows the data for a single batch, or for a particular property within
    that batch or its header. Displays data in YAML (default), or JSON formats.
    

sawtooth block

1
2
3
4
5
6
7
usage: sawtooth block [-h] {list,show} ...

optional arguments:
  -h, --help   show this help message and exit

grandchildcommands:
  {list,show}

sawtooth block list

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
usage: sawtooth block list [-h] [--url URL] [-u USERNAME[:PASSWORD]]
                           [-F {csv,json,yaml,default}]

optional arguments:
  -h, --help            show this help message and exit
  --url URL             the URL of the validator's REST API
  -u USERNAME[:PASSWORD], --user USERNAME[:PASSWORD]
                        user login info to authorize request
  -F {csv,json,yaml,default}, --format {csv,json,yaml,default}
                        the format to use when printing the output

details:
        Lists committed blocks from the newest to the oldest, including
    their id (i.e. header signature), batch and transaction count, and
    their signer's public key.
    

sawtooth block show

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
usage: sawtooth block show [-h] [--url URL] [-u USERNAME[:PASSWORD]] [-k KEY]
                           [-F {yaml,json}]
                           block_id

positional arguments:
  block_id              the id (i.e. header_signature) of the block

optional arguments:
  -h, --help            show this help message and exit
  --url URL             the URL of the validator's REST API
  -u USERNAME[:PASSWORD], --user USERNAME[:PASSWORD]
                        user login info to authorize request
  -k KEY, --key KEY     specify to show a single property from the block or
                        header
  -F {yaml,json}, --format {yaml,json}
                        the format to use for printing the output (defaults to
                        yaml)

details:
        Shows the data for a single block, or for a particular property within
    that block or its header. Displays data in YAML (default), or JSON formats.
    

sawtooth config

1
2
3
4
5
6
7
usage: sawtooth config [-h] {genesis,proposal,settings} ...

optional arguments:
  -h, --help            show this help message and exit

subcommands:
  {genesis,proposal,settings}

sawtooth config genesis

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
usage: sawtooth config genesis [-h] [-k KEY] [-o OUTPUT]
                               [-T APPROVAL_THRESHOLD] [-A AUTHORIZED_KEY]

optional arguments:
  -h, --help            show this help message and exit
  -k KEY, --key KEY     the signing key for the resulting batches and initial
                        authorized key
  -o OUTPUT, --output OUTPUT
                        the name of the file to output the resulting batches
  -T APPROVAL_THRESHOLD, --approval-threshold APPROVAL_THRESHOLD
                        the required number of votes to enable a setting
                        change
  -A AUTHORIZED_KEY, --authorized-key AUTHORIZED_KEY
                        a public key for an user authorized to submit config
                        transactions

sawtooth config proposal

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
usage: sawtooth config proposal [-h] {create,list,vote} ...

optional arguments:
  -h, --help          show this help message and exit

proposals:
  {create,list,vote}
    create            creates batches of sawtooth-config transactions
    list              lists the current proposed, but not active, settings
    vote              votes for specific setting change proposals

sawtooth config proposal create

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
usage: sawtooth config proposal create [-h] [-k KEY] [-o OUTPUT | --url URL]
                                       setting [setting ...]

positional arguments:
  setting               configuration setting, as a key/value pair:
                        <key>=<value>

optional arguments:
  -h, --help            show this help message and exit
  -k KEY, --key KEY     the signing key for the resulting batches
  -o OUTPUT, --output OUTPUT
                        the name of the file to ouput the resulting batches
  --url URL             the URL of a validator's REST API

sawtooth config proposal list

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
usage: sawtooth config proposal list [-h] [--url URL]
                                     [--public-key PUBLIC_KEY]
                                     [--filter FILTER]
                                     [--format {default,csv,json,yaml}]

optional arguments:
  -h, --help            show this help message and exit
  --url URL             the URL of a validator's REST API
  --public-key PUBLIC_KEY
                        filters proposals from a particular public key.
  --filter FILTER       filters keys that begin with this value
  --format {default,csv,json,yaml}
                        the format of the output

sawtooth config proposal vote

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
usage: sawtooth config proposal vote [-h] [--url URL] [-k KEY]
                                     proposal_id {accept,reject}

positional arguments:
  proposal_id        the proposal to vote on
  {accept,reject}    the value of the vote

optional arguments:
  -h, --help         show this help message and exit
  --url URL          the URL of a validator's REST API
  -k KEY, --key KEY  the signing key for the resulting transaction batch

sawtooth config settings

1
2
3
4
5
6
7
8
usage: sawtooth config settings [-h] {list} ...

optional arguments:
  -h, --help  show this help message and exit

settings:
  {list}
    list      list the current keys and values of sawtooth-config settings

sawtooth config settings list

1
2
3
4
5
6
7
8
9
usage: sawtooth config settings list [-h] [--url URL] [--filter FILTER]
                                     [--format {default,csv,json,yaml}]

optional arguments:
  -h, --help            show this help message and exit
  --url URL             the URL of a validator's REST API
  --filter FILTER       filters keys that begin with this value
  --format {default,csv,json,yaml}
                        the format of the output

sawtooth state

1
2
3
4
5
6
7
usage: sawtooth state [-h] {list,show} ...

optional arguments:
  -h, --help   show this help message and exit

grandchildcommands:
  {list,show}

sawtooth state list

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
usage: sawtooth state list [-h] [--url URL] [-u USERNAME[:PASSWORD]]
                           [-F {csv,json,yaml,default}] [--head HEAD]
                           [subtree]

positional arguments:
  subtree               the address of a subtree to filter list by

optional arguments:
  -h, --help            show this help message and exit
  --url URL             the URL of the validator's REST API
  -u USERNAME[:PASSWORD], --user USERNAME[:PASSWORD]
                        user login info to authorize request
  -F {csv,json,yaml,default}, --format {csv,json,yaml,default}
                        the format to use when printing the output
  --head HEAD           the id of the block to set as the chain head

details:
        Lists state in the form of leaves from the merkle tree. List can be
    narrowed using the address of a subtree.
    

sawtooth state show

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
usage: sawtooth state show [-h] [--url URL] [-u USERNAME[:PASSWORD]]
                           [--head HEAD]
                           address

positional arguments:
  address               the address of the leaf

optional arguments:
  -h, --help            show this help message and exit
  --url URL             the URL of the validator's REST API
  -u USERNAME[:PASSWORD], --user USERNAME[:PASSWORD]
                        user login info to authorize request
  --head HEAD           the id of the block to set as the chain head

details:
        Shows the data for a single leaf on the merkle tree.
    

sawtooth submit

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
usage: sawtooth submit [-h] [--url URL] [-u USERNAME[:PASSWORD]] [-v]
                       [--wait [WAIT]] [-f FILENAME]
                       [--batch-size-limit BATCH_SIZE_LIMIT]

optional arguments:
  -h, --help            show this help message and exit
  --url URL             the URL of the validator's REST API
  -u USERNAME[:PASSWORD], --user USERNAME[:PASSWORD]
                        user login info to authorize request
  -v, --verbose         enable more verbose output
  --wait [WAIT]         wait for batches to commit, set an integer to specify
                        a timeout
  -f FILENAME, --filename FILENAME
                        location of input file
  --batch-size-limit BATCH_SIZE_LIMIT
                        batches are split for processing if they exceed this
                        size

sawtooth transaction

1
2
3
4
5
6
7
usage: sawtooth transaction [-h] {list,show} ...

optional arguments:
  -h, --help   show this help message and exit

grandchildcommands:
  {list,show}

sawtooth transaction list

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
usage: sawtooth transaction list [-h] [--url URL] [-u USERNAME[:PASSWORD]]
                                 [-F {csv,json,yaml,default}]

optional arguments:
  -h, --help            show this help message and exit
  --url URL             the URL of the validator's REST API
  -u USERNAME[:PASSWORD], --user USERNAME[:PASSWORD]
                        user login info to authorize request
  -F {csv,json,yaml,default}, --format {csv,json,yaml,default}
                        the format to use when printing the output

details:
        Lists committed transactions from newest to oldest, including their id
    (i.e. header_signature), transaction family and version, and their payload.
    

sawtooth transaction show

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
usage: sawtooth transaction show [-h] [--url URL] [-u USERNAME[:PASSWORD]]
                                 [-k KEY] [-F {yaml,json}]
                                 transaction_id

positional arguments:
  transaction_id        the id (i.e. header_signature) of the transaction

optional arguments:
  -h, --help            show this help message and exit
  --url URL             the URL of the validator's REST API
  -u USERNAME[:PASSWORD], --user USERNAME[:PASSWORD]
                        user login info to authorize request
  -k KEY, --key KEY     specify to show a single property from the block or
                        header
  -F {yaml,json}, --format {yaml,json}
                        the format to use for printing the output (defaults to
                        yaml)

details:
        Shows the data for a single transaction, or for a particular property
    within that transaction or its header. Displays data in YAML (default),
    or JSON formats.