Function X Docs
Search…
Full node with Docker
This guide will explain how to install the fxcored mainnet or fxcored testnet command line interface (CLI) on your system. With these installed on a server, you can participate on the mainnet or testnet as a Validator.

Install f(x)Core

You need to install f(x)Core before you go further

Use Docker

  • pull docker images
if you do not already have docker installed, there will be a prompt for you to install it. Follow the instructions given.
Mainnet
Testnet
1
docker pull functionx/fx-core:mainnet-1.0
Copied!
1
docker pull functionx/fx-core:v2.1.0
Copied!
  • Initializing fxcore
Mainnet
Testnet
1
docker run -v $HOME/.fxcore:/root/.fxcore functionx/fx-core:mainnet-1.0 init fx-zakir
Copied!
1
docker run -v $HOME/.fxcore:/root/.fxcore functionx/fx-core:v2.1.0 init fx-zakir
Copied!
  • download genesis (copy and run each line, line by line)
Mainnet
Testnet
1
sudo wget https://raw.githubusercontent.com/functionx/fx-core/master/public/mainnet/genesis.json -O ~/.fxcore/config/genesis.json
2
sudo wget https://raw.githubusercontent.com/functionx/fx-core/master/public/mainnet/config.toml -O ~/.fxcore/config/config.toml
3
sudo wget https://raw.githubusercontent.com/functionx/fx-core/master/public/mainnet/app.toml -O ~/.fxcore/config/app.toml
Copied!
1
wget https://raw.githubusercontent.com/FunctionX/fx-core/release/v2.1.x/public/testnet/genesis.json -O ~/.fxcore/config/genesis.json
2
wget https://raw.githubusercontent.com/FunctionX/fx-core/release/v2.1.x/public/testnet/config.toml -O ~/.fxcore/config/config.toml
3
wget https://raw.githubusercontent.com/FunctionX/fx-core/release/v2.1.x/public/testnet/app.toml -O ~/.fxcore/config/app.toml
Copied!
At this stage **BEFORE **starting the node, if you would like to do a fast sync with the snapshot guide, please refer to this link.
And at this stage, what is important is your validator keys that is stored in a json file for you to do a recovery in the future. For more information how to access the files.
  • run docker
Mainnet
Testnet
1
docker run --name fxcore -d --restart=always -p 26656:26656 -p 26657:26657 -p 1317:1317 -p 26660:26660 -v $HOME/.fxcore:/root/.fxcore functionx/fx-core:mainnet-1.0 start
Copied!
1
docker run --name fxcore -d --restart=always -p 26656:26656 -p 26657:26657 -p 1317:1317 -p 26660:26660 -v $HOME/.fxcore:/root/.fxcore functionx/fx-core:v2.1.0 start
Copied!
To check if fxcore is synced:
1
curl localhost:26657/status
Copied!
Return:
1
{
2
"jsonrpc": "2.0",
3
"id": -1,
4
"result": {
5
"node_info": {
6
"protocol_version": {
7
"p2p": "8",
8
"block": "11",
9
"app": "0"
10
},
11
"id": "123868554adafd679f5dc6367bddea39aa5adb94",
12
"listen_addr": "tcp://0.0.0.0:26656",
13
"network": "fxcore",
14
"version": "v0.34.9",
15
"channels": "40202122233038606100",
16
"moniker": "moniker",
17
"other": {
18
"tx_index": "on",
19
"rpc_address": "tcp://0.0.0.0:26657"
20
}
21
},
22
"sync_info": {
23
"latest_block_hash": "239609FE5FD475389C1ACFCEF46DCF6B0343F0C04E43A7968677809C2D489F3F",
24
"latest_app_hash": "0D2F1299950E0DE86BFF1CDEEEDE3BA57F7899EF1492A6E6809DF3060164046D",
25
"latest_block_height": "810805",
26
"latest_block_time": "2021-09-01T07:56:29.166926257Z",
27
"earliest_block_hash": "12B0FB286BD34C077CACF97D3D2757B27C49E63FB81E6262399FF11A3C3C002E",
28
"earliest_app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
29
"earliest_block_height": "1",
30
"earliest_block_time": "2021-07-12T07:42:23.292429Z",
31
"catching_up": false
32
},
33
"validator_info": {
34
"address": "214999E9412502DE8DE13F626F9D32D41C1B5015",
35
"pub_key": {
36
"type": "tendermint/PubKeyEd25519",
37
"value": "fUlPjsYSLi04vwzeNiFObBVabV6TKhB6WB3c65iEayU="
38
},
39
"voting_power": "0"
40
}
41
}
Copied!
To ensure that the blocks are synced up with your node, under "sync_info", "catching_up value" should be false "catching_up value": false. This may take a few hours and your node has to be fully synced up before proceeding to the next step. You may cross reference the latest block you are synced to "sync_info": "latest_block_height" and the latest block height of our Testnet blockchain on our Testnet blockchain explorer or our Mainnet.

Upgrading Your Node

These instructions are for full nodes that have ran on previous versions of and would like to upgrade to the latest testnet.

Reset Data

First, remove the outdated files and reset the data.
1
rm $HOME/.fxcore/config/addrbook.json $HOME/.fxcore/config/genesis.json
2
fxcored unsafe-reset-all
Copied!
Your node is now in a pristine state while keeping the original priv_validator.json and config.toml. If you had any sentry nodes or full nodes setup before, your node will still try to connect to them, but may fail if they haven't also been upgraded.
Make sure that every node has a unique priv_validator.json. Do not copy the priv_validator.json from an old node to multiple new nodes. Running two nodes with the same priv_validator.json will cause you to double sign.