Skip to content

Get your Standalone RSK Node (RegTest)

herrerameri edited this page Jan 5, 2018 · 2 revisions

In this section you will learn how to get your own Standalone (RegTest) RSK Node.

You have 2 options to start:

Besides you have information about:


Option 1 - Create your Standalone RSK Node

Download the config file

You need this config file for Regtest mode.

Set the node specific configuration

The second step is to replace some properties in the config file. You can get it following this explanation. It allows you to fill the necessary fields to run the node.


Option 2 - Switch your TestNet RSK Node to Standalone

Update config file settings

Replace constants

Replace the following constants in /etc/rsk/node.conf:

blockchain.config.name = "regtest"

Turn OFF Peer Discovery:

peer {

    discovery = {

        # if peer discovery is off
        # the peer window will show
        # only what retrieved by active
        # peer [true/false]
        enabled = false

Remove TestNet Bootstraps (just in case):

        # List of the peers to start
        # the search of the online peers
        # values: [ip:port]
        ip.list = [
        ]

Remove Trusted Peers (just in case):

    # Boot node list
    # Use to connect to specific nodes
    active = [
    ]

Change Listen Port:

    # Peer for server to listen for incoming connections
    # 50505 for testnet
    listen.port = 50501

Change Network ID:

    # Network id
    networkId = 7771

Reset Database FALSE (if you want to preserve it):

database {
    # place to save physical storage files
    dir = /var/lib/rsk/database

    # every time the application starts the existing database will be destroyed and all the data will be downloaded from peers again
    # having this set on true does NOT mean that the block chain will start from the last point
    # [true/false]
    reset = false
}
# hello phrase will be included in the hello message of the peer
hello.phrase = RegTest

Add miner options

# miner options
miner {
    server.enabled = true
    client.enabled = true
    minGasPrice = 0

    # these are values used by MinerServer to set the notify flag on/off
    gasUnitInDollars = 0.001
    minFeesNotifyInDollars = 30

    # this is a hex-encoded, 32-byte length address where the miner gets the reward
    reward.address = <ENCODED_ADDRESS>
}

Miner with coinbase secret

This configuration is usually used for testing, along with a local wallet hosted in the node. This is not recommended to be enabled in production.

# miner options
miner {
    server.enabled = true
    client.enabled = true
    minGasPrice = 0

    # these are values used by MinerServer to set the notify flag on/off
    gasUnitInDollars = 0.001
    minFeesNotifyInDollars = 30

    # this is a secret passphrase that is used to derive the address where the miner gets the reward.
    # please note this is stored in a local wallet and not recommended for production.
    coinbase.secret = <COINBASE_SECRET>
}

The genesis block

You can change the genesis block to get initial funds. The folder resources/genesis contains several versions of genesis configuration according to the network the peer will run on. The genesis file called rsk-dev.json allow you to start with some wallets (accounts) on your node. It has a default account called "cow" (0xcd2a3d9f938e13cd947ec05abc7fe734df8dd826) because it has a high balance amount to use for testing.

To start your blockchain with rsk-dev.json genesis, you have to get this lines in the config file:

  • genesis = rsk-dev.json
  • wallet { enabled = true }

Besides, if you have a previous node, you should change the database path (or reset it) to allow the blockchain starts empty (from block number 0), with the chosen genesis block.

Your wallets/accounts

Maybe you have wallets and you want to start your node and work with your own accounts. You can add accounts to the node changing the wallet section in the config file in this way:

 wallet { 
    enabled = true,
    accounts = [
        {
            "publicKey" : "YOUR_WALLET_PUBLIC_KEY",
            "privateKey" : "YOUR_WALLET_PRIVATE_KEY"
        }
    ]
 }

Another option is to create a new account (or wallet) on the node. You can do this by connecting the RSK Console to the node and using the command:

 web3.personal.newAccount('password')

Where password is a secret word that you choose. It will create and add a new account to your node's accounts.

Note: you need to enable the personal module into modules section in the config file to use this command, by adding:

   {
       name: "personal",
       version: "1.0",
       enabled: "true"
   }
Clone this wiki locally