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 Binaries option. With these installed on a server, you can participate on the mainnet or testnet as a Validator.
Install Pundi AIFX
You need to install Pundi AIFX before you go further
Setup Pundi AIFX
Initializing fxcore:
fxcored init <custom-moniker> --chain-id fxcorefxcored init <custom-moniker> --chain-id dhobyghautNote: Monikers can contain only ASCII characters. Using Unicode characters is not supported and renders the node unreachable.
The moniker can be edited in the ~/.fxcore/config/config.toml file:
# A custom human readable name for this node
moniker = "<custom_moniker>"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 genesis file (copy this entire line of code and hit ENTER):
wget https://raw.githubusercontent.com/PundiAI/fx-core/main/public/mainnet/genesis.json -O ~/.fxcore/config/genesis.jsonwget https://raw.githubusercontent.com/PundiAI/fx-core/main/public/testnet/genesis.json -O ~/.fxcore/config/genesis.jsonUpon startup the node will need to connect to peers. you can add peers to the config.toml config file:
fxcored config config.toml p2p.seeds "c5877d9d243af1a504caf5b7f7a9c915b3ae94ae@fxcore-mainnet-seed-node-1.functionx.io:26656,b289311ece065c813287e3a25835bb6378999aa5@fxcore-mainnet-seed-node-2.functionx.io:26656,96f04dffc25ffcce11e179581d2a3ab6cb5535d5@fxcore-mainnet-node-1.functionx.io:26656,836ded83bac83a4ac8511826fa1ad4ca2238f960@fxcore-mainnet-node-2.functionx.io:26656,7c7a260eeefda37eac896ae423e78cf345a2ef70@fxcore-mainnet-node-3.functionx.io:26656,0fee38117655b6961319950d6beb929fb194217c@fxcore-mainnet-node-4.functionx.io:26656,6e8818051a2ca9b8be67a6f2ba48c33d8c489d5c@fxcore-mainnet-node-5.functionx.io:26656"fxcored config config.toml p2p.seeds "e922b34e660976a64d6024bde495666752141992@dhobyghaut-seed-node-1.functionx.io:26656,a817685c010402703820be2b5a90d9e07bc5c2d3@dhobyghaut-node-1.functionx.io:26656"you can optionally download the address book. Make sure to move this to ~/.fxcore/config/addrbook.json.
Start Node:
Check logs:
View more startup configurations:
For example, Start and open the 1317 restful service port:
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):
To check if fxcore is synced:
Return:
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):
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
fxcored as a serviceFirst, 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):
hit the ENTER button on your keyboard and copy and paste the contents of the file below into the command line:
Sample file:
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:
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:
Controlling the service
Use systemctl to control (start, stop, restart)
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
Concluding tips: It is always better to sync Pundi AIFX 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:
Running the above command will return:
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
Record the previous output before running the next command to remove this file:
The following command will recover your original consensus key:
Match this output with the previous output above:
Last updated