Becoming a Proton Block Producer

Becoming a Proton Block Producer

In this article I will detail the process of configuring a node on the proton test network. Although there are several guilds on the internet available, I did not find one that was very comprehensive, and spent much time Googling my way through issues. So here I will document the process as comprehensively as I can, taking care to note the things that I wish that I knew ahead of time and had to figure out for myself.

Server Specifications

The specifications for running on the test network are not as intense as the main network, however my client and I found that our execution time was too low when we tried starting with a cheaper server. Our first server was reasonably fast - quad core, 8 gigs of ram, but it was not cutting it. Thus we ended up upgrading our server (and there will be a separate post about that process soon).

The specs we ended up settling on are as follows:

  • 32 gigs of ram
  • Intel 8 core processor at 4.2 ghz
  • 500 GB SSD
  • I added an 8 gig swap file
  • one gigabit line

We got this box from OVH, it was only $120 per month if I recall correctly.

Installation

At the time of this writing, you want to use an Ubuntu 18 box for compatibility with the software. While I am sure you could get away with running this on any Linux distribution that you'd like, for the sake of simplicity I recommend Ubuntu 18 (LTS release).

After you deploy your server, you should harden its security. Of course this is more important on the main network than the test network, but you may as well get in this habit now. Turn off SSH password authentication and set up a firewall, at least.

The installation instructions can be found here:

GitHub - ProtonProtocol/proton-testnet.start
Contribute to ProtonProtocol/proton-testnet.start development by creating an account on GitHub.

For the most part, the installation instructions are reasonably straightforward. However, I do have a few suggestions to make this go easier.

The Process

First, do not bother compiling the software yourself. It takes forever and a half.

Let's begin. SSH to your box as root, and create a new user called "proton" or something. Add to sudo group, grab the latest compiled binaries, and install:

useradd -d /opt/ProtonTestnet proton
usermod -a -G sudo proton
passwd proton
sudo su proton
mkdir /opt/bin
mkdir /opt/bin/v2.1.0
cp /usr/opt/eosio/v2.1.0/bin/nodeos /opt/bin/v2.1.0/
cp /usr/opt/eosio/v2.1.0/bin/cleos /opt/bin/v2.1.0/
cp /usr/opt/eosio/v2.1.0/bin/keosd /opt/bin/v2.1.0/
ln -sf /opt/bin/v2.1.0/ /opt/bin/bin

Now that the software is installed, we need to configure our node.

mkdir /opt/ProtonTestnet
cd /opt/ProtonTestnet
git clone https://github.com/ProtonProtocol/proton-testnet.start.git ./

We need to create an account. To do that, you need to go to the proton testnet monitor and follow these instructions:

Click “Create Keypair” button located at the top left of the page, copy and save both public and private key. also you can create key pair using cleos command:

./cleos.sh create key

Click “Create Account” at the top left of the page, enter an account name, submit your previously saved public key in both Owner and Active Public Key field, complete the captcha, and hit create.

Edit the config.ini file:

server address: p2p-server-address = ENRT_YOUR_NODE_EXTERNAL_IP_ADDRESS:9876
replace p2p-peer-address list with fresh generated on monitor site: https://monitor.testnet.protonchain.com/#p2p
Check chain-state-db-size-mb value in config, it should be not bigger than you have RAM:
chain-state-db-size-mb = 16384
your producer name: producer-name = YOUR_BP_NAME
signature-provider = YOUR_PUB_KEY_HERE=KEY:YOUR_PRIV_KEY_HERE
comment out eos-vm-oc-enable and eos-vm-oc-compile-threads (EOSVM OC is not to be used on a block signing node)

After you have your config.ini setup correctly, you need to create a wallet. The process is pretty straightforward:

cd /opt/ProtonTestnet/protonNode
./cleos.sh wallet create --file pass.txt
./cleos.sh wallet import
./cleos.sh wallet unlock
cd ../Wallet
./start_wallet.sh

Now, you can register as producer ... but actually, before you can do that, you need to request approval to register as a producer. Please see the medium article on how to do this here. Keep in mind that this process does not actually seem to broadcast the transaction required to do this – rather it generates the command that you can run with cleos to do so.

When you get the command, you broadcast it like this:

./cleos.sh -u https://protontestnet.greymass.com push transaction '{
  "delay_sec": 0,
  "max_cpu_usage_ms": 0,
  "actions": [
    {
      "account": "eosio.msig",
      "name": "propose",
      "data": {
        "proposer": "luminaryvisn",
        "proposal_name": "thanks",
        "requested": [
          {
            "actor": "luminaryvisn",
            "permission": "active"
          }
        ],
        "trx": {
          "max_net_usage_words": 0,
          "max_cpu_usage_ms": 0,
          "delay_sec": 0,
          "context_free_actions": [],
          "actions": [
            {
              "account": "eosio.proton",
              "name": "reqperm",
              "authorization": [
                {
                  "actor": "luminaryvisn",
                  "permission": "active"
                }
              ],
              "data": "30B1DBFE9AE9A48E0772656770726F64"
            }
          ],
          "transaction_extensions": [],
          "expiration": "2022-03-15T17:57:09.000",
          "ref_block_num": 64677,
          "ref_block_prefix": 1145945814
        }
      },
      "authorization": [
        {
          "actor": "luminaryvisn",
          "permission": "owner"
        }
      ]
    }
  ]
}'

```

Then you need to wait for your request to be approved. Finally afterwards you can actually register ...

./cleos.sh system regproducer YOU_ACCOUNT PUBKEY "URL" 0

Finally, our node needs to be synchronized. Just restore from a snapshot and save yourself a ton of time. You should do this in a tmux session:

sudo apt -y install zstd
cd /opt/ProtonTestnet/protonNode/snapshots/
wget https://backup.cryptolions.io/ProtonTestNet/snapshots/latest-snapshot.bin.zst
unzstd latest-snapshot.bin.zst
cd /opt/ProtonTestnet/protonNode
./start.sh --snapshot /opt/ProtonTestnet/protonNode/snapshots/latest-snapshot.bin

Now you are in business. You need to demonstrate that you can run successfully for at least two weeks – UPDATE: You are also required to continuously run your testnet node even after you are approved for the main network!

Make sure you are active in the telegram channel, and do not be afraid to ask for votes – at some point you will want to request that your node be placed in the "top 21" so that you may determine whether it is working correctly or not.

You can check your execution time and other stats on various testnet monitors such as https://api.monitor.testnet.protonchain.com. Keep in mind that your execution time needs to be below 35 milliseconds.

Make sure that you set up your bp.json file so that your avatar and other information is shown on the monitors. There is a handy generator available that you can use. Place it at the root of your entity's domain. For example, ours is here:

https://luminaryvisn.com/bp.json

That's pretty much it! With a little luck, eventually you will be approved to go actually produce blocks on the main network, as we just were!

Final Considerations

The first thing that you should do is back up your keys! You will need them in the event that there is something wrong with your node and you need to unregister as producer. I would advise backing them up in multiple locations, both locally on a USB drive and remotely, encrypted in the cloud.

Stay tuned for my next article in this series, which details the process of configuring a node for the main network.