Introduction

This is the Factom CLI documentation. The following guides will allow you to install, run and/or compile and build the command line apps and tools necessary to run Factom Federation software.

These new Factom guides replace all our previous ones. The Factom CLI guides are intended for users who know their way around the command line (you should know enough to be dangerous and get yourself out of trouble).

Factom CLI Guides

Before We Begin

Before attempting to transact factoids (FCT) read these guides thoroughly (at least once). The software is still in beta, so use the instructions at your risk. Do not use a large number of Factoids in case there are issues, bugs, or you mistype a command. Phoning a friend after the damage is done will not fix things. Sorry, this is just the way of the Blockchain. If you are unsure how to use the command line, we suggest you try our Factom Foundation Wallet instead which is simpler to use and has a Graphic User Interface (GUI).

The following directions and commands are optimized for Linux but should work with minor modifications for Mac or Windows. Be aware of slight differences in commands on different platforms:

Mac

./factom-cli < rest of the command >

Windows

factom-cli.exe < rest of the command >

Linux

factom-cli < rest of the command >

Make sure to modify the commands accordingly.

The interface you will be using to run Factom Federation software related commands is called:

“Terminal” on the Mac and Linux

“CMD Prompt” or “Windows Power Shell” on Windows

Give it a try and get familiar before you go any further. Going forward we will use “Terminal” to describe the interface where you type commands, just don’t forget it has a different name in Windows.

FF is composed of three main components:

factomd

factom-walletd

factom-cli

To run Factom Federation via command line you need factomd, factom-walletd, and factom-cli. Each one of these apps needs to run in separate Terminal windows.

Pop quiz
How many windows will you need?
Answer: Three Terminal windows.
What your tech savvy mother would say?
Do not run Factom Federation while connected to an unsafe network, like at a cafe, an airport, public wifi hotspot, etc. The wallet is not encrypted, and hackers could potentially steal your precious Factoids. You do not want to feel like Gollum without his ring.

Starting Factom Via Bootstrap

Factom takes a while to download the blockchain. It can be expedited by downloading the first 70k blocks via HTTP. Factomd still checks the blockchain on each boot, so it will check for inconsistencies in the download.

Note: currently factomd uses a lot of drive accesses when running. It is reccomended to hold the blockchain on a solid state drive. Running factomd on a spinning hard drive will be arduously slow. Since factomd currently scans the entire blockchain each time it is started, bootup takes a while (~30 min on an SSD). You can watch the progress on the Control Panel.

Extract the zip file to your home directory. It will create files in the location:

~/.factom/m2/main-database/ldb/MAIN/factoid_level.db/

The newly created .factom folder is an invisible folder on Mac and Linux so you won’t be able to see it unless you browse to it via Terminal. On Mac, in Finder, you can also use Go/Go to Folder… and type ~/.factom to see its content.

Compressed the blockchain is currently about 5 GB and uncompressed is over 9 GB at the time of writing.

After factomd boots for the first time and is 100% synced, it will need to be restarted at least once. Successive restarts should be fine without having to restart.

Backup Your Wallet File!

If you’ve used Factom Genesis (FG), our previous software release, you should have a local wallet file. We highly recommend you backup your (FG) wallet file every time you import or generate a new address.
Do read this guide fully, at least once.

If you have never run FG you can skip the backup right now but we strongly recommend backing up your new FF wallet once you get FF running.

Get back to this guide when you are ready to do your backup, don’t forget!

Factom Federation (FF) introduced a new way to generate addresses compared to our FG release. Simply put, it generates all new addresses from a seed. The seed is a 12 word passphrase which allows you to recover all your addresses, created with the seed in question, at a later date even if you lose your wallet file. There are many reasons why you may have displaced your original wallet file such as because you changed computer, your hard drive failed, have overwritten the wallet file by mistake, and so on.

The seed comes to the rescue because if you ever lose your wallet file you can always re-generate your addresses from it. However, some of you may have imported a Private Key generated with the Factoid Papermill app, or have imported a 12 word Koinify passphrase, or generated addresses with our previous FG wallet, these types of addresses are called “External Addresses.” Please remember that a seed file will only allow you to recover addresses that were created with the same seed, external addresses will not be recovered.

So how to recover External Addresses?The simple way: if you have any balances on addresses not generated from your wallet seed, you may want to transfer them to an address generated from your seed.The easy way: keep a backup of your wallet file, whatever addresses are in there will always be, no need to recover them.
The alternative way: make sure to keep your external addresses’ Private Keys safe, write them down or copy/paste them to a file, you can always import them even if you create a new wallet.

Keep this in mind especially if you are migrating from our FG wallet to our FF wallet. If you are not careful you may lose access to your Factoids and Entry Credits!

Backup your Factom Genesis (FG) wallet file

Make sure to backup your FG wallet file before you run the new Factom Federation software. The wallet file is called “factoid_wallet_bolt.db” and is located in the .factom folder at the following locations:

Mac/Users/YourUsername/.factom/factoid_wallet_bolt.db

WindowsC:\Users\YourUsername\.factom\factoid_wallet_bolt.db

Linux~/.factom/factoid_wallet_bolt.db

Note that the .factom folder is a hidden folder on Mac and Linux so perform a Google search for “how to show hidden files and folders on YOUR OS”, replacing YOUR OS with Mac or Linux accordingly.

To backup your FG wallet file, locate the factoid_wallet_bolt.db file, make a copy, and save it to a location outside the .factom folder such as your documents folder, an external drive, a USB stick, or cloud storage.

By having a backup somewhere safe, if something goes wrong, you can always try again, but most importantly, you’ll be able to import all your FG addresses and their balances into your new FF wallet the first time you run FF.
We will explain you how to do that when “we cross that bridge” in the Run Factom Federation guide.

Backup your Factom Federation (FF) wallet file

The wallet file is called “factom_wallet.db” and is located in the .factom folder at the following locations:

Mac/Users/YourUsername/.factom/wallet/factom_wallet.db

WindowsC:\Users\YourUsername\.factom\wallet\factom_wallet.db

Linux~/.factom/wallet/factom_wallet.db

Note that the .factom folder is a hidden folder on Mac and Linux so perform a Google search for “how to show hidden files and folders on YOUR OS”, replacing YOUR OS with Mac or Linux accordingly.

To backup your FF wallet file, quit factomd and factom-walletd, locate the factom_wallet.db file, make a copy, and save it to a location outside the .factom folder such as your documents folder, an external drive, a USB stick, or cloud storage.

To create a fresh FF wallet file, quit factomd and factom-walletd then move your wallet file to a safe location out of the .factom folder. There should be no wallet file in the .factom folder. Restart factomd and factom-walletd and a new empty wallet will be generated.

To restore a previous FF wallet file backup, quit factomd and factom-walletd, make sure you have a backup of the current wallet first, then drag & drop the previous backup in the .factom folder, overwrite if needed. Restart factomd and factom-walletd and your previous wallet will now be used instead.

Pay attention when performing backups and restores. Each wallet file has its unique seed and addresses. Overwriting a wallet may resulting in losing all your Factoids and Entry Credits. Not cool.

Install Factom Federation

If you got this far, you are doing well Grasshopper. Ready to get your hands on FF? You will be up and running in a few minutes. Promise.

Here is a step by step guide on how to install FF binaries on Mac, Windows, and Linux.

Step 1 Download the installer for Mac, Windows, or Linux on GitHub. There are various versions, make sure to select the one best suited for your system.

Step 2 Save it to your desktop or downloads folder on your local hard drive.

Step 3 Follow the instructions for your OS.

Mac

This installer is for factomd, factom-walletd, factom-cli, the 3 binaries will be installed in /Applications/Factom/ together with a .factom folder in the root of the local user Home Folder. These are all required to run Factom via command line or the Factom Foundation Wallet.

Before you start go to System Preferences/Security & Privacy, click on the lock at the bottom left of the window, type your username and password, then select “Allow apps downloaded from: Anywhere”. At the prompt click on “Allow From Anywhere”.

Note that after running the Factom installer it is recommended you revert back your Security & Privacy settings to their original state.

Next, locate the “factom.mpkg.zip” file you just downloaded, double click to unzip it, then double click the “factom.mpkg” file to run the installer.

The installer will open, click continue.

Then click install.

The installer will prompt for your username and password, you need to have Admin privileges on the Mac (means you need to be able to install applications on your Mac).

Enter your username and password then click Install Software.

The installer will proceed with the installation and once finished it will prompt with “The installation was successful.” Then click close.

Windows

This installer is for factomd, factom-walletd, factom-cli, the 3 binaries will be installed in c:\Program Files (x86)\Factom\ or c:\Program Files\Factom\ (depending on your system) together with a .factom folder in the root of the local user Home Folder. These are all required to run Factom via command line or the Factom Wallet GUI.

Next, locate the “FactomInstall-amd64.msi” or “FactomInstall-i386.msi” file you just downloaded in Step 1.

Double click the .msi installer to run it but you may be prompted with the following message.

Click on “more info” to expand it then select “Run anyway”.

The Installer will open, click “Next”.

Select “I accept the terms in the Licence Agreement” and click “Next” to continue.

Make sure Factom is installed into c:\Program Files (x86)\Factom\ folder and click “Next” to continue.

Linux

This installer is for factomd, factom-walletd, factom-cli, the 3 binaries will be installed on your local drive together with a .factom folder in the root of the local user Home Folder ~/.factom. These are all required to run Factom via command line or the Factom Foundation Wallet.

Download the “factom-amd64.deb” or “factom-i386.deb” installer that suits your system as per Step 1 then run the following command to install.

sudo dpkg -i ./factom-amd64.deb

or

sudo dpkg -i ./factom-i386.deb

We are aware Linux users are hardcore so we made sure one command is all they need to be ready to run Factom Federation.

Run Factom Federation

Time to remember Mr. Miyagi’s lesson.

This step will be used every time you need to run Factom Federation software, so get familiar with it. Practice makes perfect. Wax on, wax off.

Every time you come across “Run FF” you need to perform the following steps. These are the basic steps to run the wallet.

For Mac and Windows, use the cd command with Terminal to browse to the location of your FF installation. On Linux, you will be able to run commands without having to browse the to install location.

This step is required before you run factomd, factom-walletd, and factom-cli. The three applications are required to run the Factom Federation software.

If this is the first time you are running FF, and haven’t dowloaded the blockchain via http as recommended above, now’s a great time to check your Facebook feed or take your dog on a walk.
Syncing the Factom blockchain may take a little while, the blockchain is …big. The Factom Control panel will display the progress and notify you when it has finished syncing. This will also occur when it has been a while since the last time you have run factomd. However, after the first full sync is complete, successive syncs are faster and you will only have to sync blocks since the last full sync.
You can alternatively download the first 70,000 blocks via disk image by following our Bootstrap Guide.

Once you are synced, in a new Terminal window browse (cd) to the location of your FF installation as you did above (Mac and Windows only).

There are two options now, one for people who have run Factom Genesis (FG), our previous software release, and one for people who haven’t. The former have to import their old FG wallet file, the latter don’t, choose the next step accordingly.

If you have used FG

If you have run our previous software release “Factom Genesis (FG)” you need to import your FG wallet file (named factoid_wallet_bolt.db) the first time your run factom-walletd to make sure all its previous addresses and balances are transferred over. You have learned how to backup your wallet file in our Backup Your Wallet File! guide and you should know if still in the default location within the .factom folder at ~/.factom/factoid_wallet_bolt.db.

Simply run the next command with a special flag and the path to your wallet file:

factom-walletd -i=PATH_TO_YOUR_FGWALLETFILE.

For example, if your FG wallet file is still in the .factom folder, run:

factom-walletd -i=~/.factom/factoid_wallet_bolt.db

This command will tell factom-walletd to look for the file at the specified path and import all its addresses into the new wallet. The file can be located in a different location on your hard drive, just make sure to specify the path properly.

If by any chance the operation fails, quit factom-walletd, delete the new wallet file located at ~/.factom/wallet/factoid_wallet.db and try again until you get all your addresses back.

Remember, you only need to do this once the first time you run factom-walletd, thereafter you can run it normally.

Once you are happy continue by following the instructions to run the factom-cli command below.

If you have never used FG

Run:

factom-walletd

Terminal output for:factom-walletd

> factom-walletd
Reading from '/Home/.factom/m2/factomd.conf'
Cannot open custom config file,
Starting with default settings.
open /Home/.factom/m2/factomd.conf: no such file or directory
Reading from '/Home/.factom/m2/factomd.conf'
Cannot open custom config file,
Starting with default settings.
open /Home/.factom/m2/factomd.conf: no such file or directory
Warning, factom-walletd API is not password protected. Factoids can be stolen remotely.
Warning, factom-walletd API connection is unencrypted. Password is unprotected over the network.
Database started from: /Home/.factom/wallet/factom_wallet.db
Database started from: /Home/.factom/wallet/factoid_blocks.cache
2016/11/24 06:28:37 web.go serving :8089

Sample Terminal output is shown on the right.

You are now ready to use factom-cli to run commands in your third Terminal window.
Run the command -h (help) to see all the available commands and their descriptions.
cd to the location of your FF installation first, then run:

factom-cli -h

Terminal output for:factom-cli -h

> factom-cli -h
Usage of ./factom-cli:
-factomdcert string
This file is the TLS certificate provided by the factomd API. (default ~/.factom/m2/factomdAPIpub.cert)
-factomdpassword string
Password for API connections to factomd
-factomdtls
Set to true when the factomd API is encrypted
-factomduser string
Username for API connections to factomd
-h help
-s string
IPAddr:port# of factomd API to use to access blockchain (default localhost:8088)
-test.bench string
regular expression per path component to select benchmarks to run
-test.benchmem
print memory allocations for benchmarks
-test.benchtime duration
approximate run time for each benchmark (default 1s)
-test.blockprofile string
write a goroutine blocking profile to the named file after execution
-test.blockprofilerate int
if >= 0, calls runtime.SetBlockProfileRate()(default 1)
-test.count n
run tests and benchmarks n times(default 1)
-test.coverprofile string
write a coverage profile to the named file after execution
-test.cpu string
comma-separated list of number of CPUs to use for each test
-test.cpuprofile string
write a cpu profile to the named file during execution
-test.memprofile string
write a memory profile to the named file after execution
-test.memprofilerate int
if >=0, sets runtime.MemProfileRate
-test.outputdir string
directory in which to write profiles
-test.parallel int
maximum test parallelism (default 8)
-test.run string
regular expression to select tests and examples to run
-test.short
run smaller test suite to save time
-test.timeout duration
if positive, sets an aggregate time limit for all tests
-test.trace string
write an execution trace to the named file after execution
-test.v
verbose: print additional output
-w string
IPAddr:port# of factom-walletd API to use to create transactions (default localhost:8089)
-walletcert string
This file is the TLS certificate provided by the factom-walletd API. (default ~/.factom/walletAPIpub.cert)
-walletpassword string
Password for API connections to factom-walletd
-wallettls
Set to true when the wallet API is encrypted
-walletuser string
Username for API connections to factom-walletd
factom-cli ack TxID|FullTx
Returns information about a factoid transaction, or an entry / entry credit transaction
factom-cli addchain [-e EXTID1 -e EXTID2 -E BINEXTID3 ...] ECADDRESS <STDIN>
Create a new Factom Chain. Read data for the First Entry from stdin. Use the Entry Credits from the specified address.
factom-cli addentry -c CHAINID [-e EXTID1 -e EXTID2 -E BEEF1D ...] ECADDRESS <STDIN>
Create a new Factom Entry. Read data for the Entry from stdin. Use the Entry Credits from the specified address.
factom-cli addtxecoutput [-r] TXNAME ADDRESS AMOUNT
Add an Entry Credit output to a transaction in the wallet
factom-cli addtxfee TXNAME ADDRESS
Add the transaction fee to an input of a transaction in the wallet
factom-cli addtxinput TXNAME ADDRESS AMOUNT
Add a Factoid input to a transaction in the wallet
factom-cli addtxoutput [-r] TXNAME ADDRESS AMOUNT
Add a Factoid output to a transaction in the wallet
factom-cli backupwallet
Backup the running wallet
factom-cli balance [-r] ADDRESS
If this is an EC Address, returns number of Entry Credits. If this is a Factoid Address, returns the Factoid balance.
factom-cli buyec FCTADDRESS ECADDRESS ECAMOUNT
Buy entry credits
factom-cli composechain [-e EXTID1 -e EXTID2 -E BINEXTID3 ...] 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.
factom-cli composeentry -c CHAINID [-e EXTID1 -e EXTID2 -E BEEF1D ...] 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.
factom-cli composetx TXNAME
Compose a wallet transaction into a json rpc object
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.
factom-cli exportaddresses
List the private addresses stored in the wallet
factom-cli get allentries|chainhead|dblock|eblock|entry|firstentry|head|heights
Get data about Factom Chains, Entries, and Blocks
factom-cli get allentries [-n NAME1 -N HEXNAME2 ...] CHAINID
Get all of the Entries in a Chain
factom-cli get chainhead [-n NAME1 -N HEXNAME2 ...] CHAINID
Get ebhead by chainid
factom-cli get dblock KEYMR
Get dblock contents by merkle root
factom-cli get eblock KEYMR
Get eblock by merkle root
factom-cli get entry HASH
Get entry by hash
factom-cli get firstentry [-n NAME1 -N HEXNAME2 ...] CHAINID
Get the first entry from a chain
factom-cli get head
Get the latest completed directory block
factom-cli get heights
Get the current heights of various blocks in factomd
factom-cli importaddress ADDRESS [ADDRESS...]
Import one or more secret keys into the wallet
factom-cli importwords '12WORDS'
Import 12 words from Koinify sale into the Wallet
factom-cli listaddresses
List the addresses stored in the wallet
factom-cli listtxs [tmp|all|address|id|range]
List transactions from the wallet or the Factoid Chain
factom-cli listtxs address ECADDRESS|FCTADDRESS
List transaction from the Factoid Chain with a specific address
factom-cli listtxs [all]
List all transactions from the Factoid Chain
factom-cli listtxs id TXID
List transaction from the Factoid Chain
factom-cli listtxs range START END
List the transactions from the Factoid Chain within the specified range
factom-cli listtxs tmp
List current working transactions in the wallet
factom-cli newecaddress
Generate a new Entry Credit Address in the wallet
factom-cli newfctaddress
Generate a new Factoid Address in the wallet
factom-cli newtx TXNAME
Create a new transaction in the wallet
factom-cli properties
Get version information about facotmd and the factom wallet
factom-cli receipt ENTRYHASH
Returns a Receipt for a given Entry
factom-cli rmtx TXNAME
Remove a transaction in the wallet
factom-cli sendfct FROMADDRESS TOADDRESS AMOUNT
Send Factoids between 2 addresses
factom-cli sendtx TXNAME
Send a Transaction to Factom
factom-cli signtx TXNAME
Sign a transaction in the wallet
factom-cli subtxfee TXNAME ADDRESS
Subtract the transaction fee from an output of a transaction in the wallet

Sample Terminal output is shown on the right.

Pat yourself on the back for making it this far! You have now “Run FF” for the first time. (thumbs up)

The new factoid address will be unique to your wallet and different from our example.

You are on a roll and a proud owner of a Factoid address! #Winning

Generate an Entry Credit Address

Perform this step only if you intend to make entries into Factom or want to stock up on Entry Credits (EC) for future use.
Remember, ECs are non-transferrable and cannot be sold or traded on an exchange. Make sure you need them before you go ahead.

The new EC address will be unique to your wallet and different from the above.

Congratulations on your first EC address. You are seriously killing it.

Send and Receive Factoids

To send Factoids (FCT) from your local wallet to an external Factoid Address (FA) you will need a source address and a destination address to execute the necessary command.

You need to perform this action when you want to send FCT to an exchange, a friend, or a third party.
Assuming you have already created a local FA address (source address) and have a destination address, you will need to:

In this example, the sendfct command moved 1.234 FCT from the source address to the destination address. You should be able to see the Transaction ID (TxID) on the terminal.

To receive Factoids use the same command as above. For instance, you may move FCT between two FA addresses within your local wallet.

However, if you are sending yourself FCT from an exchange or want to receive FCT from a third party, just provide your FA Address. Once sent you can verify your local FCT balance.

The TxID is a very useful way to verify that FCT have moved to the correct address. We recommend noting it down especially when sending or receiving to and from a third party.

Convert Factoids to Entry Credits

“It’s still magic even if you know how it’s done.”― Terry Pratchett, A Hat Full of Sky

Before we automagically convert Factoids (FCT) to Entry Credits (EC), here is how the spell works. FCT are burned to create ECs. The number of FCT used will be deducted from your wallet’s balance, so don’t freak out when you see your FCT balance reduced. Just look for the newly created ECs on the EC address. Now if you don’t see the newly created ECs, it’s time to freakout and repeat these words, “Houston, we have a problem.” (Disclaimer: Factom has no customer service center in Houston.)

Moving on…and getting down to business.

You will need a source address containing some FCT and a destination EC address to be able to execute the necessary command.

In this example, we assume that you have already created a local EC address (destination) and you have some FCT in your local FA address (source).

The buyec command burned some Factoids from the FA address and deposited 30 EC in the specified EC address. The Terminal also presented the TxID (Transaction ID).

The TxID is useful for checking that ECs have moved to the right address. Take note of it for your records.

Redeem Factoids from Koinify

This section is relevant if you participated in the Koinify Software Token Sale hosted by Koinify back in 2015 and haven’t redeemed your Factoids (FCT). Although Koinify closed their operations, they never held your FCT, and you only need your 12-word master passphrase to access your FCT.

The 12-word master passphrase can be used with the factom-cli importwords command to create the crypto signatures required to reassign the Factoids to another address or purchase Entry Credits. So go find that magical piece of paper where you wrote down your unique 12-word magic spell and follow the instructions below:

The operation will create a new Factoid Address in your local wallet and present the public key in the terminal output.
Make note of the FA address for your records. You will need it to verify that the FA address successfully imported with its balance.

Run the listaddresses command to list all the addresses in your wallet.

In this example we successfully imported the FA address showing a balance of 20 factoids. The terminal output will give you a list of all FA and EC addresses in your wallet with their current balances. You can use the Node Visualizer or the Factom Explorer to verify your local FCT balance.

In your case, the FA address and its balance will be different.

You can now trade your factoids on an exchange or use them to purchase Entry Credits. Life is good. (thumbs up)

The 12-word master passphrase was shown once at the time of purchase to contributors who were prompted to keep it in a safe place.
Without the Master Passphrase, it is impossible to redeem Factoids, and neither Factom nor Koinify can recover it. We really meant what we said.
Do not share your passphrase with anybody or they will be able to access your FCT.
There is no expiry date for the 12-word master passphrase. You will be able to redeem your FCT at your leisure, anytime in the future.

Import a Private Key

To import a Factoid Address (FA) created with the Factoid Papermill app or by a third party you need the Factoid Private Key for the FA you want to import.

The Factom Control Panel is easy to use and great for verifying your FA or EC balances. Simply run FF and open the Control Panel web page in your browser: http://localhost:8090/

Find the search bar on the upper right-hand corner of the Factom Control Panel.

Paste the FA address you wish to verify in the search bar.

Click GO.

The Control Panel will display the factoid balance for the FA address under “Amount Available.”
In this example, we have a balance of 2 FCT.

Repeat the steps above to verify the balance of an EC address. Paste the EC address you wish to verify in the search bar.

Click GO.

The Control Panel will display the Entry Credit balance for the EC address under “Amount Available.”
In this example, we have a balance of 20 EC.

You may also use the Control Panel to get more info about Transaction IDs, Block Numbers, Chain IDs, and more.

2) With the Factom Explorer

The Factom Explorer provides information about our blockchain including FA and EC addresses, blocks, entries, and more. From here you may verify your FA or EC balances without running our software. Find the Factom Explorer at https://explorer.factom.org.

Paste the FA address you wish to verify in the search bar.

Hit Enter on your keyboard.

The Explorer will display the balance of the FA address, in this example 1.892 FCT, along with previous transactions.

Now, let’s repeat the steps above to verify the balance of an EC address.

Paste the EC address you wish to verify in the search bar.

Hit Enter on your keyboard.

The Explorer will display the balance of the EC address, in this example 3999 EC, along with its previous transactions.

To run the Factom Control Panel you need some basic command line knowledge while the Factom Explorer doesn’t require you to run any Factom apps. Choose the verification method that suits you best.

You made it this far and got the knowledge, now is time to teach others how to use Factom! (big grin)

Create a Factom Chain

To make entries in Factom, you must create a Factom Chain where your entries will be recorded. You can create as many chains as you like. Just remember, it’s a BYOEC party. You know… bring your own entry credit party. (We know…what you are thinking. This is why we do Blockchains and not Standup)

Here is how to create your first Factom Chain.

Creating a chain in Factom has a fee of 10 Entry Credits, so make sure your EC address balance can cover it.

In your case, the only differences will be the name between quotes, the ChainID, and the EC address.
The name of the entry can be anything you want. In our example “my first entry” is the name of the new entry.
Our ChainID a4ab1e2ef212208b3513c5f06fcdcfa79b7c2b610526ce2dc374bb789700a791 should be replaced by your own.
Finally, the EC address above should be replaced by your own, again, make sure it has enough EC balance to cover for the fee.

You may notice that there are two entries in the new chain even though you only made one. This is because every time a new chain is created, it generates an entry containing it’s assigned name.
The second entry, *Entry [ 1 ]*, is the first entry we made in the new chain, the one we named “my first entry.”

This simple guide is designed to show how chains and entries work in Factom. Refer to the factom-cli help by typing the below command for more options.

factom-cli -h

You can then explore other ways and more command flags you can run to make entries suited for your needs.
We will also release more advanced guides in the near future, stay tuned.

Using Factoid Papermill

Factoid Papermill is an app to create private and public factoid address key pairs, the equivalent to a paper wallet for Factoids.

Factoids can be managed using the command line or the GUI wallet, which is a bit prettier.

Both the command-line and GUI wallets can import private keys generated with Factoid Papermill.

Before attempting to transact factoids read this guide fully, at least once.

The Factoid Papermill app has a different name on different platforms.

Take note of the FA Address and Private Key and keep them in a safe place. If you need more addresses and private keys repeat the process. You can use your newly generated Factoid Address to receive factoids from a third party or an exchange. This method of storing factoids is considered a “cold wallet” or “paper wallet”.

Your New Factoid Private Key and New Factoid Address will be different than this example.
Remember you won’t be able to send from your new address until you have imported it into one of your wallets.
Failure to backup the Private Key generated by Factoid Papermill for a given Factoid Address will cause the loss of all factoids held, sent, or received by these addresses.
If on Mac and Linux Factoid Papermill doesn’t launch because of missing execute permissions simply open a Terminal window and type:

chmod +x (with a space after the x)

Then drag and drop the app onto the Terminal window to populate its path, and click enter. You should then be able to run FactoidPapermill as described above.

BEFORE BUILDING FACTOMD!
Glide can use github to gather all dependencies, but there is a chance your local github repos could cause some errors. If glide runs into an issue downloading a dependency, try deleting that folder it complains about (90% of dependecies are in ’$GOPATH/src/github.com/FactomProject/’), and run glide install again.

Compile factomd

This will take some time and place the source code into your GOPATH:

go get github.com/FactomProject/factomd

Cd into factomd:

cd $GOPATH/src/github.com/FactomProject/factomd

By default, the master branch will be selected. If you wish to build a different branch, change it now.

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 acknowledgement of the success of the subcommand to be generated. This can be useful for scripts where a long string of subcommands can be executed in a fraction of the time it would take if an acknowledgement of each had to be awaited.

-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

$ 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

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

$ 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