Join the Mainnet

Make sure to have the latest go-bitsong version installed. First, initialize the node.

bitsongd init <your_custom_moniker>

Note Monikers can contain only ASCII characters. Using Unicode characters is not supported and renders your node unreachable.

By default, the init command creates your ~/.bitsongd directory with subfolders config and data. In the config directory, the most important files for configuration are app.toml and config.toml.

You can edit the moniker in the ~/.bitsongd/config/config.toml file:

# A custom human readable name for this node
moniker = "<your_custom_moniker>"

For optimized node performance, edit the ~/.bitsongd/config/app.toml file to enable the anti-spam mechanism and reject incoming transactions with less than the minimum gas prices:

# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml

###############################################################################
###                           Base Configuration                            ###
###############################################################################

# The minimum gas prices a validator is willing to accept for processing a
# transaction. A transaction's fees must meet the minimum of any denomination
# specified in this config (e.g. 0.25token1;0.0001token2).

minimum-gas-prices = "0.0025ubtsg"

Your full node has been initialized!

Genesis & Seeds

Copy the Genesis File

Fetch the mainnet's genesis.json file into bitsongd's config directory.

Set persistent peers

Your node needs to know how to find peers. You'll need to add healthy seed nodes to $HOME/.bitsongd/config/config.toml

Synchronise the Node

Now we have to syncronise the node with the current state of the blockchain. The fastest way to achieve this is by using state sync, which we will use for this purpose.

Enable the REST API

By default, the REST API is disabled. To enable the REST API, edit the ~/.bitsongd/config/app.toml file, and set enable to true in the [api] section.

Optionally, you can activate swagger by setting swagger to true or change the port of the REST API in the parameter address. After restarting your application, you can access the REST API on YOURNODEIP:1317.

GRPC Configuration

By default, gRPC is enabled on port 9090. In the ~/.bitsongd/config/app.toml file, you can make changes in the gRPC section. To disable the gRPC endpoint, set enable to false. To change the port, use the address parameter.

Background Process

To run the node in a background process with automatic restarts, you can use a service manager like systemd. To set this up run the following:

Then setup the daemon

We can then start the process and confirm that it is running

Last updated