Factom CLI Commands

Command reference for the Factom CLI

factom-cli is a command line interface program for interacting with factomd and factom-walletd.

factom-cli [OPTIONS] SUBCOMMAND [OPTIONS]

Flags

-f

$ echo hello | factom-cli addchain -f -n moe -n larry \
EC2DKSYyRcNWf7RS963VFYgMExoHRYLHVeCfQ9PGPmNzwexample

The f flag, used with the addchain, addentry, buyec, composechain, composeentry, sendfct, sendtx, and signtx subcommands, tells factom-cli to continue on with processing without waiting for acknowledgment of the success of the subcommand to be generated.

This can be useful for scripts where you can execute a long string of subcommands in a fraction of the time it would take if you had to wait for an acknowledgment of each command individually.

-q

$ echo goodbye | factom-cli addentry -q -n moe -n larry -e curly \
EC2DKSYyRcNWf7RS963VFYgMExoHRYLHVeCfQ9PGPmNzwexample

The q flag specifies “quiet” execution of the addchain, addentry, addtxecoutput, addtxfee, addtxinput, addtxoutput, buyec, newtx, sendfct, sendtx, signtx, and subtxfee subcommands. This means that no output will be returned back to the user.

This again can be useful for scripts where there is no need for feedback from factom-cli.

-e -x

$ factom-cli addentry [-fq] [-n NAME1 -h HEXNAME2 ...|-c CHAINID] \
[-e EXTID1 -e EXTID2 -x HEXEXTID ...] [-CET] ECADDRESS <STDIN>

The addentry subcommands support the -e and -x flags for adding external ids to the Entries they create. Multiple -e and -x flags may be used, and -e and -x may be used in combination. -e string will encode the string as binary and set it as the next external id. -x hexstring will decode the hexstring into binary and set it as the next external id.

-n -h

$ factom-cli get chainhead -n test -h 3031

The get firstentry, get chainhead, and get allentries subcommands support the -n and -h flags for using Chain Names as an alternative for providing a ChainID. The Chain Name is the combination of External IDs on the first Entry in the Chain.

-r

$ factom-cli sendfct -r $my_factoid_address factom.michaeljbeam.me

The r flag tells factom-cli to try and resolve a public Factoid or Entry Credit Address from a DNS name registered through Netki.

-C

$ echo hello | factom-cli addchain -n moe -n larry -C \
EC2DKSYyRcNWf7RS963VFYgMExoHRYLHVeCfQ9PGPmNzwexample

The C flag, used with the addchain subcommand, limits the subcommand output to a single field, the ChainID with no headers. This means that a variable can be assigned to the value of the executed command directly.

-E

$ echo goodbye | factom-cli addentry -n moe -n larry -e curly -E \
EC2DKSYyRcNWf7RS963VFYgMExoHRYLHVeCfQ9PGPmNzwexample

The E flag, used with the addchain and addentry subcommands, limits the subcommand output to a single field, the Entry Hash with no headers. This means that a variable can be assigned to the value of the executed command directly.

-T

$ factom-cli get pendingtransactions -T

The T flag, used with the addchain, addentry, buyec, get pendingtransactions, listtxs address, listtxs subcommands, limits the subcommand output to a single field, the Entry Hash with no headers. This means that a variable can be assigned to the value of the executed command directly.

Commands

status

factom-cli status TxID|FullTx

Returns information about a factoid transaction, or an entry / entry credit transaction

addchain

factom-cli addchain [-fq] [-n NAME1 -n NAME2 -h HEXNAME3 ] [-CET] /
ECADDRESS <STDIN>

Create a new Factom Chain. Read data for the First Entry from stdin. Use the Entry Credits from the specified address.

addentry

factom-cli addentry [-fq] [-n NAME1 -h HEXNAME2 ...|-c CHAINID] /
[-e EXTID1 -e EXTID2 -x HEXEXTID ...] [-CET] ECADDRESS <STDIN>

Create a new Factom Entry. Read data for the Entry from stdin. Use the Entry Credits from the specified address.

addtxecoutput

factom-cli addtxecoutput [-r] TXNAME ADDRESS AMOUNT

Add an Entry Credit output to a transaction in the wallet

addtxfee

factom-cli addtxfee TXNAME ADDRESS

Add the transaction fee to an input of a transaction in the wallet

addtxinput

factom-cli addtxinput TXNAME ADDRESS AMOUNT

Add a Factoid input to a transaction in the wallet

addtxoutput

factom-cli addtxoutput [-r] TXNAME ADDRESS AMOUNT

Add a Factoid output to a transaction in the wallet

backupwallet

factom-cli backupwallet

Backup the running wallet

balance

factom-cli balance [-r] ADDRESS

If this is an EC Address, returns the number of Entry Credits. If this is a Factoid Address, returns the Factoid balance.

buyec

factom-cli buyec FCTADDRESS ECADDRESS ECAMOUNT

Buy entry credits

composechain

$ factom-cli composechain [-f] [-n NAME1 -n NAME2 -h HEXNAME3 ] /
ECADDRESS <STDIN>

Create API calls to create a new Factom Chain. Read data for the First Entry from stdin. Use the Entry Credits from the specified address.

composeentry

$ factom-cli composeentry [-f] [-n NAME1 -h HEXNAME2 ...|-c CHAINID] /
[-e EXTID1 -e EXTID2 -x HEXEXTID ...] ECADDRESS <STDIN>

Create API calls to create a new Factom Entry. Read data for the Entry from stdin. Use the Entry Credits from the specified address.

composetx

$ factom-cli composetx TXNAME

Compose a wallet transaction into a JSON RPC object

ecrate

factom-cli ecrate

It takes this many Factoids to buy an Entry Credit. Displays the larger between current and future rates. Also used to set Factoid fees.

exportaddresses

factom-cli exportaddresses

List the private addresses stored in the wallet

get

factom-cli get allentries|chainhead|dblock|eblock|entry|firstentry| /
head|heights

Get data about Factom Chains, Entries, and Blocks

get allentries

factom-cli get allentries [-n NAME1 -N HEXNAME2 ...] CHAINID

Get all of the Entries in a Chain

get chainhead

factom-cli get chainhead [-n NAME1 -N HEXNAME2 ...] CHAINID

Get ebhead by chainid

get dblock

factom-cli get dblock KEYMR

Get dblock contents by Merkle root

get eblock

factom-cli get eblock KEYMR

Get eblock by Merkle root

get entry

factom-cli get entry HASH

Get entry by hash

get firstentry

factom-cli get firstentry [-n NAME1 -N HEXNAME2 ...] CHAINID

Get the first entry from a chain

get head

factom-cli get head

Get the latest completed directory block

get heights

factom-cli get heights

Get the current heights of various blocks in factomd

importaddress

factom-cli importaddress ADDRESS [ADDRESS...]

Import one or more secret keys into the wallet

importwords

factom-cli importwords '12WORDS'

Import 12 words from Koinify sale into the Wallet

listaddresses

factom-cli listaddresses

List the addresses stored in the wallet

listtxs

factom-cli listtxs [tmp|all|address|id|range]

List transactions from the wallet or the Factoid Chain

listtxs address

factom-cli listtxs address ECADDRESS|FCTADDRESS

List transaction from the Factoid Chain with a specific address. This command will only list confirmed transactions.

listtxs [all]

factom-cli listtxs [all]

List all transactions from the Factoid Chain. This command will only list confirmed transactions.

listtxs id

factom-cli listtxs id TXID

List transaction from the Factoid Chain. This command will only list confirmed transactions.

listtxs range

factom-cli listtxs range START END

List the transactions from the Factoid Chain within the specified range. This command will only list confirmed transactions.

listtxs tmp

factom-cli listtxs tmp

List current working transactions in the wallet

newecaddress

factom-cli newecaddress

Generate a new Entry Credit Address in the wallet

newfctaddress

factom-cli newfctaddress

Generate a new Factoid Address in the wallet

newtx

factom-cli newtx TXNAME

Create a new transaction in the wallet

properties

factom-cli properties

Get version information about facotmd and the factom wallet

receipt

factom-cli receipt ENTRYHASH

Returns a Receipt for a given Entry

rmtx

factom-cli rmtx TXNAME

Remove a transaction in the wallet

sendfct

factom-cli sendfct FROMADDRESS TOADDRESS AMOUNT

Send Factoids between 2 addresses

sendtx

factom-cli sendtx TXNAME

Send a Transaction to Factom

signtx

factom-cli signtx TXNAME

Sign a transaction in the wallet

subtxfee

factom-cli subtxfee TXNAME ADDRESS

Subtract the transaction fee from an output of a transaction in the wallet