Developer Sandbox
Last updated
Was this helpful?
Last updated
Was this helpful?
There are three options for running a sandbox.
Minimal setup
good for quickly testing APIs
Better feedback metrics
Much closer to production experience
Needed if multiple clients are used
Factom setup needed on two different computers
Zero setup
Good if you are already familiar with Docker
Almost the same as running a local sandbox server
Download the appropriate Factom binary package from factom.org. Installers for for Windows, Mac, and Linux are hosted at . Directions for installing Factom Federation may be found .
Install the binaries like you would any other for your OS. The install directions walk you through various operating systems. Do not run them yet, as you will be making your own fresh blockchain instead of using the public one.
Factomd
is the main program. It manages the blockchain, connects to the public network, and enforces the network rules.
factom-walletd
is an application for holding private keys. It builds Factoid transactions and handles crypto related operations to add user data into Factom.
Factom-cli
is a program for users to interface with factomd
and factom-walletd
. It may be used to create Chains, Entries, and Factoid transactions.
Create a folder in your user home folder. The folder should be called .factom
. If factomd has been run on your computer before this folder will already exist and may already contain part of the Factom blockchain.
In a terminal on Linux or Mac, run:
or Windows:
Change the line Network
from MAIN
to LOCAL
This will cause factomd
to run on its own local network rather than the Factom main network.
Change the line NodeMode
from FULL
to SERVER
This will make factomd
create a blockchain.
Optionally, adjust DirectoryBlockInSeconds
. 600 gives 10 minute blocks, which is more realistic
The default is for 6 second blocks which is easier to develop with, but may causesome strange behavior and errors.
For easier debugging, change the logLevel
to debug
. This exports pointers to data which is added into Factom to the ~/.factom/data/export/
directory. Adding new entries will add new files to the directory with the specified ChainID.
In a terminal window, run:
In a new terminal window, run:
In a new terminal window, run:
Result should be similar to:
We use a Factoid key which has a balance of 40000 in the genesis block. It has since been depleted on main net, but can be used on sandbox systems.
The private key is: Fs3E9gV6DXsYzf7Fqx1fVBQPQXV695eP3k5XbmHEZVRLkMdD9qCK
The public key is: FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q
To import the address, run:
Now lets generate a new Entry Credit address:
To verify that you've imported and generated your addresses you can list them:
Result should be similar to:
Then purchase Entry Credits using our Factoid address.
Result:
If you want to check your EC balance run:
All Entries in Factom need to be in a Chain. First, make a Chain for your entries to live in.
It makes the chain with ChainID
: 23985c922e9cdd5ec09c7f52a7c715bc9e26295778ead5d54e30a0a6215783c8
Check the status of the Chain.
Result:
You can now place Entries into this Chain.
Result:
Query your entries in Factom:
Result:
And get information about the chain and its entries:
Result:
and:
Result:
Create a folder in your user home folder. The folder should be called .factom/m2
. If factomd has been run on your computer before this folder will already exist and may already contain part of the Factom blockchain.
In a terminal on Linux or Mac, run:
or Windows:
Change the line ServerPubKey
from "0426a802617848d4d16d87830fc521f4d136bb2d0c352850919c2679f189613a"
to "8cee85c62a9e48039d4ac294da97943c2001be1539809ea5f54721f0c5477a0a"
This will make factomd recognize the sandbox public key instead of the official public key.
Make sure NodeMode
is set to FULL
for the client node.
The local machine should be set as a client in the factomd.conf
, which is default. Run factomd
this way, but use the remote Factom server's IP address.
The commands above run a Factom node with the following configuration:
Network
is set to LOCAL
This will cause factomd to run on its own local network rather than the Factom main network.
NodeMode
is set to SERVER
This will make factomd
create a blockchain.
DirectoryBlockInSeconds
is set to 20
Mainnet runs with 10 minute blocks (600 seconds). Easier to develop with shorter block times, but may cause some strange behavior and errors.
logLevel
is set to debug
This exports pointers to data which is added into Factom to the ~/.factom/data/export/
directory. Adding new entries will add new files to the directory with the specified ChainID
.
Alternatively, if you wish to do modifications to the factomd.conf
file before running you can clone the repository from github:
Navigate to the fct-docker
directory, which contains five files. To configure your local installation of factomd
and factomwalletd
edit the factomd.conf
file. Once you’re happy with the changes, run:
and:
Now we need a Factom wallet with some funds to start recording entries. We use a Factoid address which has a balance of 20000 FCT in the genesis block. It has since been depleted on mainnet, but can be used on sandbox systems.
The private key is: Fs3E9gV6DXsYzf7Fqx1fVBQPQXV695eP3k5XbmHEZVRLkMdD9qCK
The public key is: FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q
Let's import this address to our sandbox container:
This command should return the public key mentioned above. Note it down somewhere as we will be using it later. We now need an Entry Credit address which we’ll generate:
You should see an EC address returned (it starts with EC
). Write down this address as well, as we’ll be using it later.
By default, Factom holds all the blockchain, wallet, etc data in the user's home directory in a folder called .factom/m2/custom-database
. This may be a hidden folder, so make sure to display hidden folders on your OS.
To reset the blockchain, first close factomd
and factom-walletd
. Delete all the folders and files in .factom/m2/custom-database
except factomd.conf
.
If you did run factomd
before setup, follow the directions found to reset the blockchain.
Three programs are installed: factomd
, factom-walletd
, and factom-cli
. You may also wish to install the GUI .
Save the configuration file to your .factom/m2
directory. Open factomd.conf
and edit the following:
Once factomd
is running you can use an internet browser and navigate to view the factomd
Control Panel, found at .
You can get some diagnostic info from the control panel (which incidentally doesn't control anything). Browse to .
Your Factom sandbox container is now setup, you're now ready to interact with the Factom blockchain! Why not follow one of the hello-world examples for your favorite client? Head over to the section for an overview.
On a remote machine, setup a Factom server. Both the client and server must be run of different machines.
Use the same directions as and . Run factomd
. Make sure that port 8110 is open on the server. Only factomd needs to be running on the remote server.
Save the configuration file to your .factom/m2
directory. Open factomd.conf
and edit the following:
Your Factom sandbox container is now setup, you're now ready to interact with the Factom blockchain! Why not follow one of the hello-world examples for your favorite client? Head over to the section for an overview.
A current ANO maintains a docker image for a Factom sandbox. This tutorial assumes you know how to use and that it's installed. To run the Factom sandbox container without any modifications, simply run one of the two below depending on what you need:
Your Factom sandbox container is now setup, you're now ready to interact with the Factom blockchain! Why not follow one of the hello-world examples for your favorite client? Head over to the section for an overview..