Full node with Binaries
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

Setup f(x)Core

Initializing fxcore:
1
fxcored init <your_name>
Copied!
Initializing fxcored will result in the creation of a few directories and most importantly the .fxcore directory (for more information on the directory tree, refer to the validator-recovery section). This will be where your validator keys are stored and this is important for recovery of your validator.
Fetching config file (copy this entire line of code and hit ENTER):
Mainnet
Testnet
1
wget https://raw.githubusercontent.com/functionx/fx-core/master/public/mainnet/genesis.json -O ~/.fxcore/config/genesis.json
2
wget https://raw.githubusercontent.com/functionx/fx-core/master/public/mainnet/config.toml -O ~/.fxcore/config/config.toml
3
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.
Additionally, what is important is that 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.
Also, you can consider generating a new consensus key and backing it up using a pin.
For a more stable way of setting up via running a daemon
Start Node:
1
nohup fxcored start 2>&1 > fxcore.log &
Copied!
Check logs:
1
tail -f fxcore.log
Copied!
View more startup configurations:
1
fxcored start -h
Copied!
For example, Start and open the 1317 restful service port:
1
nohup fxcored start --api.enable true --address 0.0.0.0:1317 2>&1 > fxcore.log &
Copied!
The execution of the previous command will return something like this (this is to check the status of nodes and which blocks are being synced/are syncing):
1
2 height=12893 module=state num_txs=0
2
5:05PM INF minted coins from module account amount=21043599215998775405FX from=mint module=x/bank
3
5:05PM INF indexed block height=12893 module=txindex
4
5:05PM INF executed block height=12894 module=state num_invalid_txs=0 num_valid_txs=0
5
5:05PM INF commit synced commit=436F6D6D697449447B5B32382032362035392036332037352031313920323920343520313230203137203137203630203438203133322032352031303220313734203134392038362039203139203138332031383520323332203136382039312031323420313234203220313320313138203137305D3A333235457D
6
5:05PM INF committed state app_hash=1C1A3B3F4B771D2D7811113C30841966AE95560913B7B9E8A85B7C7C020D76AA height=12894 module=state num_txs=0
7
5:05PM INF indexed block height=12894 module=txindex
8
5:05PM INF minted coins from module account amount=21043602938137090338FX from=mint module=x/bank
9
5:05PM INF executed block height=12895 module=state num_invalid_txs=0 num_valid_txs=0
10
5:05PM INF commit synced commit=436F6D6D697449447B5B32343320323039203634203234332031393220343120313238203138302034352031363720313038203135382031363520313430203338203233302032203136372032303720333320313535203138322031373020313738203234322035392031333220362031323720393920313132203132305D3A333235467D
Copied!
To check if fxcore is synced:
1
curl localhost:26657/status
2
or
3
fxcored 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.
Stop Node (will be running in the background if not stopped):
1
ps -ef | grep fxcored
2
kill -9 <PID>
Copied!

Running Server as a Daemon

It is important to keep fxcored running at all times. There are several ways to achieve this, and the simplest solution we recommend is to register fxcored as a systemd service so that it will automatically get started upon system reboots and other events.

Register fxcored as a service

First, create a service definition file in /etc/systemd/system.
Run this command to create the sample file above in the file path/etc/systemd/system/fxcored.service (if you are in the fx-core directory):
1
cat > /etc/systemd/system/fxcored.service
Copied!
hit the ENTER button on your keyboard and copy and paste the contents of the file below into the command line:

Sample file:

fxcored.service
1
[Unit]
2
Description=f(x)Core Node
3
After=network.target
4
[Service]
5
Type=simple
6
User=root
7
WorkingDirectory=/root
8
ExecStart=/usr/bin/fxcored start --home /root/.fxcore
9
Restart=on-failure
10
RestartSec=3
11
LimitNOFILE=4096
12
[Install]
13
WantedBy=multi-user.target
Copied!
Then hit the ENTER button on your keyboard before using Ctrl+D on your keyboard, your file with the above contents will be created. It should look like this:
run the command:which fxcored and replace the ExecStart file path with the return value of the command
1
[email protected]:~# cat > /etc/systemd/system/fxcored.service
2
[Unit]
3
Description=f(x)Core Node
4
After=network.target
5
[Service]
6
Type=simple
7
User=root
8
WorkingDirectory=/root
9
ExecStart=/usr/bin/fxcored start --home /root/.fxcore
10
Restart=on-failure
11
RestartSec=3
12
LimitNOFILE=4096
13
[Install]
14
WantedBy=multi-user.target
Copied!
Modify the Service section from the given sample above to suit your settings. Note that even if we raised the number of open files for a process, we still need to include LimitNOFILE.
After creating a service definition file, you should execute systemctl daemon-reload and systemctl enable fxcored

Controlling the service

Use systemctl to control (start, stop, restart)
Start
Stop
Restart
Status
1
sudo systemctl start fxcored
Copied!
1
sudo systemctl stop fxcored
Copied!
1
sudo systemctl restart fxcored
Copied!
1
sudo systemctl status fxcored
Copied!
To start the node, run sudo systemctl start fxcored, and thereafter run journalctl -t fxcored -f to see the latest and continuous logs.

Accessing logs

Entire Log
Entire log reversed
Latest and continuous log
1
journalctl -t fxcored
Copied!
1
journalctl -t fxcored -r
Copied!
1
journalctl -t fxcored -f
Copied!
Concluding tips: It is always better to sync f(x)Core using the Daemon method because this ensures stability and that your syncing is continuously running in the background.

Secret and updating consensus key

Use this at your own risk❗ I suggest trying it out on testnet first and also backing up your priv_validator_key.json if you already have this set up for a validator. The file can be found in this file path /.fxcore/config/priv_validator_key.json.

Updating your consensus key and tagging it to a pin

Before setting up your validator if you would like to have a backup of your keys with a pin. You may run the following command:
1
fxcored tendermint update-validator <secret>
Copied!
the <secret> key here must be longer than 32 characters
Running the above command will return:
1
WARNING: The consensus private key of the node will be replaced.
2
Ensure that the backup is complete.
3
USE AT YOUR OWN RISK. Continue? [y/N]
Copied!
After inputting y, your priv_validator_key.json will be replaced with a new file. This means you will have a new consensus private key and it will be tagged to your <secret> pin.

Checking to see if the pin works

If your .fxcore folder is in the root directory
1
cat ~/.fxcore/config/priv_validator_key.json
Copied!
Record the previous output before running the next command to remove this file:
1
rm ~/.fxcore/config/priv_validator_key.json
Copied!
The following command will recover your original consensus key:
1
fxcored tendermint update-validator <secret>
Copied!
Match this output with the previous output above:
1
cat ~/.fxcore/config/priv_validator_key.json
Copied!