Factom CLI Commands
Command reference for the Factom CLI
factom-cli is a command line interface program for interacting with factomd and factom-walletd.
Flags
-f
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
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
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
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
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
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
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
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
addchain
Create a new Factom Chain. Read data for the First Entry from stdin. Use the Entry Credits from the specified address.
Optional output flags will display only specific information used for scripting
-C display only the ChainID
-E display only the Entry Hash
-T display only the Transaction ID
addentry
Create a new Factom Entry. Read data for the Entry from stdin. Use the Entry Credits from the specified address.
Optional output flags will display only specific information used for scripting
-C display only the ChainID
-E display only the Entry Hash
-T display only the Transaction ID
addtxecoutput
Add an Entry Credit output to a transaction in the wallet. -r
Netki DNS resolve. -q
quiet.
addtxfee
Add the transaction fee to an input of a transaction in the wallet. -q
quiet.
addtxinput
Add a Factoid input to a transaction in the wallet. -q
quiet.
addtxoutput
Add a Factoid output to a transaction in the wallet. -r
Netki DNS resolve. -q
quiet.
backupwallet
Backup the running wallet
balance
If this is an EC Address, returns the number of Entry Credits. If this is a Factoid Address, returns the Factoid balance.
balancetotals
This is the total number of Factoids and Entry Credits in the wallet
Optional output flags will display only specific information used for scripting
-EA Display only the ackEC value
-ES Display only the savedEC value
-FA Display only the ackFCT value
-FS Display only the savedFCT value
buyec
Buy ECAMOUNT number of entry credits. -f force. -q quiet. -r
Netki DNS resolve. -T
TxID.
composechain
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
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
Compose a wallet transaction into a JSON RPC object
diagnostics
Get diagnostic information about the Factom network
diagnostics authset
Get diagnostic information about the Factom authorized servers
diagnostics election
Get diagnostic information about the Factom network election process
Optional output flags will display only specific information used for scripting
-F display only the Federated Index
-I display only the Federated ID
-P display only the progress status
-R display only the current round
-V display only the VM Index
diagnostics network
Get diagnostic information about the Factom network
Optional output flags will display only specific information used for scripting
-B display only the last block from the DBState
-D display only the current minute duration
-H display only the balance hash
-L display only the Leader height
-M display only the current minute
-P display only the previous minute duration
-T display only the temporary balance hash
diagnostics server
Get diagnostic information about the Factom API server
Optional output flags will display only specific information used for scripting
-I display only the ID of the API server
-K display only the public key of the API server
-N display only the name of the API server
-R display only the role of the API server
diagnostics sync
Get diagnostic information about the network syncing
Optional output flags will display only specific information used for scripting
-E display only the expected status
-R display only the received status
-S display only the syncing status
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
List the private addresses stored in the wallet
exportidentitykeys
List the identity key pairs (public and private) stored in the wallet
get
Get data about Factom Chains, Entries, and Blocks
get abheight
Get Admin Block by height
get ablock
Get an Admin Block from factom by its Key Merkel Root or by its Height
Optional output flags will display only specific information used for scripting
-B display only the Backreference Hash
-D display only the Directory Block height
-L display only the Lookup Hash
-P display only the Previous Backreference Hash
-R display the hex encoding of the raw Directory Block
get allentries
Get all of the Entries in a Chain
get authorities
Get information about the authority servers on the Factom network
get chainhead
Get ebhead by chainid
get currentminute
Get information about the current minute and other properties of the factom network.
Optional output flags will display only specific information used for scripting
-L display only the Leader height
-D display only the DirectoryBlock height
-M display only the Current minute
-B display only the Block start time
-N display only the Minute start time
-T display only the Current time
-S display only the Directorty Block in seconds
-X display only the Stall Detected value
-F display only the Fault timeout
-R display only the Round timeout
get dbheight
Get Directory Block by height
get dblock
Get a Directory Block from factom by its Key Merkel Root or by its Height
Optional output flags will display only specific information used for scripting
-A display only the Directory Block Header Hash
-B display only the Directory Block Body Merkel Root
-C display only the Directory Block Count
-D display only the Directory Block Height
-F display only the Previous Directory Block Full Hash
-H display only the Directory Block Hash
-K display only the Directory Block Key Merkel Root
-N display only the Network ID
-P display only the Previous Directory Block Key Merkel Root
-R display the hex encoding of the raw Directory Block
-T display only the Directory Block Timestamp
-V display only the Directory Block Header Version
get eblock
Get eblock by Merkle root
get echeight
Get Entry Credit Block by height
get ecblock
Get ecblock by Key Merkle root or by height
Optional output flags will display only specific information used for scripting
-A display only the Head Expansion Area
-B display only the Body Hash
-D display only the Directory Block Height
-F display only the Full Hash
-H display only the Header Hash
-L display only the Previous Full Hash
-P display only the Previous Header Hash
-R display the hex encoding of the raw Entry Credit Block
get entry
Get Entry by Hash. -R raw entry. -C ChainID
get fbheight
Get Factoid Block by height
get fblock
Get a Factoid Block by its Key Merkle Root or Height Optional output flags will display only specific information used for scripting
-B display only the Body Merkel Root
-D display only the Directory Block Height
-E display only the Exchange Rate
-L display only the Previous Ledger Key Merkel Root
-P display only the Previous Key Merkel Root
-R display the hex encoding of the raw Factoid Block
get firstentry
Get the first Entry in a Chain. -R RawEntry. -E EntryHash. -C ChainID
get head
Get the latest completed directory block
Optional output flags will display only specific information used for scripting
-A display only the Directory Block Header Hash
-B display only the Directory Block Body Merkel Root
-C display only the Directory Block Count
-D display only the Directory Block Height
-F display only the Previous Directory Block Full Hash
-H display only the Directory Block Hash
-K display only the Directory Block Key Merkel Root
-N display only the Network ID
-P display only the Previous Directory Block Key Merkel Root
-R display the hex encoding of the raw Directory Block
-T display only the Directory Block Timestamp
-V display only the Directory Block Header Version
get heights
Get the current heights of various blocks in factomd
Optional output flags will display only specific information used for scripting -D display only the DirectoryBlock height
-L display only the Leader height
-B display only the EntryBlock height
-E display only the Entry height
get pendingentries
Get all pending entries, which may not yet be written to blockchain. -E EntryHash.
get pendingtransactions
Get all pending factoid transacitons, which may not yet be written to blockchain. -T TxID.
get raw
Returns a raw hex representation of a block, transaction, entry, or commit
get tps
Get the current instant and total average rate of Transactions Per Second.
Optional output flags will display only specific information used for scripting
-I display only the instant TPS rate
-T display only the total averaged TPS rate
get walletheight
Get the number of factoid blocks factom-walletd has cached
identity
Used with subcommands to create/manage Factom Identity Chains, their currently valid keys, attributes, and attribute endorsements
identity addchain
Create a new Identity Chain. Use the Entry Credits from the specified address.
Using the optional output flags allows you to get back information about the newly created chain and the transaction that created it. Those flags are: -C
ChainID. -E
EntryHash. -T
TxID.
identity addkeyreplacement
Create a new Identity Key Replacement Entry using the Entry Credits from the specified address. The oldkey is replaced by the newkey, and signerkey (same or higher priority as oldkey) authorizes the replacement.
Using the optional output flags allows you to get back information about the newly created entry and the transaction that created it. Those flags are: -C
ChainID. -E
EntryHash. -T
TxID.
identity addattribute
Create a new Identity Attribute Entry using the Entry Credits from the specified address.
Using the optional output flags allows you to get back information about the newly created entry and the transaction that created it. Those flags are: -C
ChainID. -E
EntryHash. -T
TxID.
The -attribute
flag must be followed by a JSON array of sub-attributes (key:value mappings) surrounded by backticks like so:
-attribute `[{"key":KEY1,"value":VALUE1},{"key":KEY2,"value":VALUE2},{"key":KEYN,"value":VALUEN}]`
identity addattributeendorsement
Create a new Endorsement Entry for the Identity Attribute at the given entry hash. Uses the Entry Credits from the specified address.
Using the optional output flags allows you to get back information about the newly created entry and the transaction that created it. Those flags are: -C
ChainID. -E
EntryHash. -T
TxID.
identity composechain
Create API calls to create a new Factom Identity Chain. Use the Entry Credits from the specified address.
identity composekeyreplacement
Create API calls to create a new Identity key replacement entry using the Entry Credits from the specified address. The oldkey is replaced by the newkey, and signerkey (same or higher priority as oldkey) authorizes the replacement.
identity composeattribute
Create API calls to create a new Identity Attribute Entry using the Entry Credits from the specified address.
The -attribute
flag must be followed by a JSON array of sub-attributes (key:value mappings) surrounded by backticks like so:
-attribute `[{"key":KEY1,"value":VALUE1},{"key":KEY2,"value":VALUE2},{"key":KEYN,"value":VALUEN}]`
identity composeattributeendorsement
Compose API calls to create a new Endorsement Entry for the Identity Attribute at the given entry hash. Uses the Entry Credits from the specified address.
identity getactivekeys
Gets the set of identity public keys that are active for the given identity chain at the highest known block height.
identity getactivekeysatheight
Gets the set of identity public keys that were active for the given identity chain at the specified block height.
importaddress
Import one or more secret keys into the wallet
importidentitykeys
Import one or more identity keys into the wallet from the specified idsec keys
importwords
Import 12 words from Koinify sale into the Wallet
listaddresses
List the addresses stored in the wallet
listidentitykeys
List the public identity keys stored in the wallet
listtxs
List transactions from the wallet or the Factoid Chain
listtxs address
List the transaction from the Factoid Chain with a specific address. This command will only list confirmed transactions.-T
TxID.
listtxs [all]
List all transactions from the Factoid Chain. This command will only list confirmed transactions.-T
TxID.
listtxs id
List transaction from the Factoid Chain. This command will only list confirmed transactions.-T
TxID.
listtxs name
Show a current working transaction in the wallet. -T
TxID.
listtxs range
List the transactions from the Factoid Chain within the specified range. This command will only list confirmed transactions.
listtxs tmp
List current working transactions in the wallet
newecaddress
Generate a new Entry Credit Address in the wallet
newfctaddress
Generate a new Factoid Address in the wallet
newidentitykey
Generates a new identity key in the wallet
newtx
Create a new transaction in the wallet
properties
Get version information about facotmd and the factom wallet
Optional output flags will display only specific information used for scripting
-A display only the factomd API version
-C display only the CLI version
-F display only the factomd version
-L display only the wallet API version
-W display only the factom-wallet version
receipt
Returns a Receipt for a given Entry
replaydbstates
Emit DBStateMsgs over the LiveFeed API between two specifed block heights
rmaddress
Removes the public and private key from the wallet for the address specified.
rmidentitykey
Removes the identity key pair from the wallet for the specified idpub key.
rmtx
Remove a transaction in the wallet
sendfct
Send Factoids between 2 addresses. -f
force. -q
quiet. -r
Netki DNs resolve. -T
TxID.
sendtx
Send a Transaction to Factom. -f
force. -q
quiet. -T
TxID.
signtx
Sign a transaction in the wallet. -f
force. -q
quiet. -T
TxID.
status
Returns information about a factoid transaction, or an entry / entry credit transaction
Optional output flags will display only specific information used for scripting
-D display the time of the transaction
-S display the transaction status only
-T display the transaction id only
-U display the unix time of the transaction
subtxfee
Subtract the transaction fee from an output of a transaction in the wallet
unlockwallet
Unlock the wallet for some number of seconds; must be an encrypted wallet. -v verbose. (Note: it is recommended that you run the command with a leading space to prevent writing the password to the command line history.)
Last updated