Skip to content

Configuration file best practices

Meri Herrera edited this page May 17, 2018 · 7 revisions

Configuration file best practices

There are three types of networks:

RegTest

A local testing environment. There are two modes: Standalone network (a RegTest network with 1 one) and Private network (a RegTest network with more than 1 node).

Standalone network

Just one node, generating transactions and mining them. It is mostly used for first steps and testing.

Here you have an example of RegTest configuration file. The options you should consider are:

  • peers: because the node is alone in this network, we don't need to find peers to sync with. So:
peer.discovery.enable = false
peer.trusted = []
peer.active = []
  • peer.privateKey: your node needs a privateKey, you can use this article to generate an RSK account.
  • rpc: define which modules you want to enable.
  • cors: if you are going to use a browser app to interact with the node, please configure this option with your domain.
  • database: configure your path to save the database. Also consider the reset option if you want to restart the database when the node is restarted.
  • scoring: can be disabled. It's not important as we have no other peers to connect with.
  • genesis: using rsk-dev.json as value, you'll have 10 accounts with SBTC to use.
  • wallet: you can use this module to add your own accounts to the node.
  • miner: must be enabled. If miner isn't enabled transactions are not going to appear in the blockchain. Remember your node is the only one, so it's encharged of mining too. The minGasPrice could be set in 0. Replace <COINBASE_SECRET> with a word you decide.
miner {
    server.enabled = true
    client.enabled = true
    minGasPrice = 0
    gasUnitInDollars = 0.001
    minFeesNotifyInDollars = 30
    coinbase.secret = <COINBASE_SECRET>
}

Private network

Many nodes, connected to each other but disconnected to any external network. It can have 1 or more nodes mining.

As an example, you can launch a private network with 3 nodes, using these config files: Node1, Node2 and Node3.

The options you should consider in each config file on a private network are:

  • peer.privateKey: each node needs a privateKey, you can use this article to generate an RSK account.
  • peer.port: you need to choose a different port for each config file.
  • peer.discovery.enabled: it should be enabled, to be discovered by the other nodes on the private network.
  • peer.ip.list: it should be set in each node config file, listing the ip:port of the rest of nodes on the network.
  • peer.active: you should set it in each node config file, listing the ip:port of the rest of nodes on the network.
  • peer.networkId: choose a random number for the network.
  • genesis: using rsk-dev.json as value, you'll have 10 accounts with SBTC to use.
  • cors: if you are going to use a browser app to interact with the nodes, please configure this option with your domain.
  • database: configure your path to save the database. Also consider the reset option if you want to restart the database when the node is restarted.
  • wallet: you can use this module to add your own accounts to the node.
  • miner: at least one node must enable the miner section. If not, transactions are not going to appear in the blockchain. The minGasPrice could be set in 0. Replace <COINBASE_SECRET> with a word you decide.
miner {
    server.enabled = true
    client.enabled = true
    minGasPrice = 0
    gasUnitInDollars = 0.001
    minFeesNotifyInDollars = 30
    coinbase.secret = <COINBASE_SECRET>
}

TestNet

RSK TestNet is a public network that is used for testing. One of the most important differences with MainNet is that it allows you to send transactions with testing purpose SBTC.

Here you have an example of TestNet configuration file. Here you have the real status of this network.

The options you should consider are:

  • blockchain.config.name: should be testnet.
  • peers: set discovery on. We need to find peers to sync with as it's a public network. Check here for some bootstrap nodes provided by RSK to start the discovering of the TestNet.
  • peer.port: for TestNet is 50505.
  • peer.networkId: for TestNet is 779.
  • peer.privateKey: your node needs a privateKey, you can use this article to generate an RSK account.
  • bind.address: wildcard value is 0.0.0.0.
  • public.ip: fulfills the purpose, it is reported as our host during discovery.
  • rpc: define which modules you want to enable.
  • cors: if you are going to use a browser app to interact with the node, please configure this option with your domain.
  • genesis: for TestNet is bamboo-testnet.json.
  • database: configure your path to save the database. Also consider the reset option if you want to restart the database when the node is restarted (have in mind that restarting the database implies resyncing your node).
  • wallet: it's not safe to store wallets on public nodes.

MainNet

RSK MainNet is the main public network wherein actual transactions take place on a distributed ledger. Transactions have real economic value on this network.

Here you have an example of MainNet configuration file. Here you have the real status of this network.

The options you should consider are:

  • blockchain.config.name: should be mainnet.
  • peers: set discovery on. We need to find peers to sync with as it's a public network. Check here for some bootstrap nodes provided by RSK to start the discovering of the MainNet.
  • peer.port: for MainNet is 5050.
  • peer.networkId: for MainNet is 775.
  • peer.privateKey: your node needs a privateKey, you can use this article to generate an RSK account.
  • bind.address: wildcard value is 0.0.0.0.
  • public.ip: fulfills the purposefulfills the purpose, it is reported as our host during discovery.
  • rpc: define which modules you want to enable.
  • cors: if you are going to use a browser app to interact with the node, please configure this option with your domain.
  • genesis: for MainNet is rsk-mainnet.json.
  • database: configure your path to save the database. Also consider the reset option if you want to restart the database when the node is restarted.
  • wallet: it's not safe to store wallets on public nodes.
Clone this wiki locally