Telos Technical How To #3
In Telos Technical How To #1 you learnt how to build a Node and sync it to the Telos Testnet. Providing API and Seed services are key to being part of the Telos Service Provider Ecosystem, however to be rewarded for your efforts and to participate in the governance of the chain you will need to become a Telos Block Producer.
Rewards and governance participation can only be achieved by being elected as a Block Producer on the Telos Mainnet. However a prerequisite for Mainnet registration requires all candidate Telos Block Producers to successfully register and produce on the Telos Testnet for a minimum of 1,200,000 blocks which is roughly 1 week or so without missing any rounds.
You can read more about Block Producer Minimum Requirements in the Official Telos Governance Documentation.
Also Official Telos Documentation is exceptional and certainly worth reading.
This 3rd Edition will show you how to configure a Telos Testnet Block Production Node and register your account as a Telos Testnet Block Producer.
How to Set Up a Telos Testnet Block Producer Node
In this example we will be using the same Telos software build process for the Block Producer Node and Cleos Interface Node as used in the first Telos Technical How To.
The Block Producer Node also needs to be configured and sync’d up to the Telos Testnet precisely the same as the first Telos example, additional configuration will be applied later in this guide.
Environment
There is consensus amongst Block Producers that best practice for any EOSIO production deployment is that each node serve a specific function. In particular the Block Producer Node should not be publicly accessible or used as a Public API or Peer.
In this example we will have three different nodes serving specific functions:
Public API and Peer Node
This is the Node created in the First Telos How To Article and will be used to provide public API and Peer services. It will need to be Sync’d to the current Telos Testnet Headblock.
Block Producer Node
This is the Node used to securely sign blocks on the Telos Testnet and the main additional production Node in this example. It will need to be Sync’d to the current Telos Testnet Headblock. In addition to configuring the latest available peer list, it is a good idea to allow it to peer to your own Public Peer Node.
The best place to locate a valid peer list is by using the EOS Nation Validator Tool which dynamically tests availability of all advertised peers.
Cleos Interface Node
This Node is completely private and used to interact with the Public Testnet Network via command line. Ubuntu Terminal / MacOS Terminal / Windows Ubuntu Shell are great lightweight OS’s for running this private interface.
Two EOSIO software included applications are used: cleos
which is the command line interface for the EOSIO software and keosd
which is essentially a wallet / key manager service daemon for storing private keys and signing digital messages. If you hadn’t run the installation script after compiling the EOSIO Software you can find the binary’s here: ~/eos/build/programs
As you will be importing your private keys into keosd
it is important that this Node is secured and treated as private.
cleos
uses your keys imported into keosd
as authority to execute privileged actions on the network through an API running in nodeos
Getting a Testnet Account
A Telos Testnet Block Producer requires an account to be created that can be used to register intent to become a producer that Token Holders (Or the Testnet Supreme Powers) are able to vote for.
There is a cost in Telos Testnet Tokens associated with registering an account, however you need an account to hold tokens. This would be problematic, however there is an excellent tool to get over this hurdle.
The Telos Testnet Faucet is the place to create an account and fund it with Testnet Tokens.
To create an account two key pairs are needed, an active_key and owner_key. It is best practice to generate your own keys offline using cleos
.
Create two key pairs on the Cleos Interface Node as below:
> cleos create key --to-console
Private key: 5J3PE2w8HAhyvw9gnG1W3snokS5AjodpoPL4pBh9qPf9y5B
Public key: EOS8PN4Efbq2TN9juguhBpYzh3PLDcGr1GAVmnkBnbCtsVMWeB928
> cleos create key --to-console
Private key: 5HrUQFAPXZ56zSm64ntQWcycso3aVBjzeRbhDfS5zLmbJkc
Public key: EOS8Q5QyTZUv7naa9dHjkgmg5CeTxFbn6pUCHM4prfWDBCAdd1d9s
Next use the Telos Testnet Faucet by filling in an <Account Name> and an <Owner Key> and <Active Key> and selecting [Create Testnet Account] to create your account on chain.
The first key generated will be used as the owner_key and the second as the active_key, notice that the public keys are used.
Keep both of these pairs safely stored, in this example we will primarily be using the active_key.
Import your account key to keosd
Now that we have an account lets’s import it to a keosd
wallet so we can use it with cleos
On your Cleos Interface Node create a Telos Testnet Wallet:
> cleos wallet create -n telostestnet --to-console
Creating wallet: telostestnet
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5KRBL5VwSCqGyGqJUzfsDAHgwthpMgbjgxeq4mFjs7xrKuoNvwr"
keosd
is automatically started (you may have to make sure it’s in the local path) .. the wallet is then created. This password is for your local wallet called telostestnet, keep is safe. By default the wallets are stored here: ~/eosio-wallet
Then import your private active account key:
#Unlock your wallet with the password from before
> cleos wallet unlock -n telostestnet
password: Unlocked: telostestnet#Import your active_key : private
> cleos wallet import -n telostestnet
private key: imported private key for: EOS8Q5QyTZUv7naa9dHjkgmg5CeTxFbn6pUCHM4prfWDBCAdd1d9s
Configure the Block Producer Node
As already mentioned previously the Block Producer Node needs some specific configuration that enables block signing.
Firstly we need another EOSIO key-pair specifically for signing use, which can be accomplished using the Cleos Interface Node:
> cleos create key --to-console
Private key: 5KT5V1EuY8nT7gHde8ferbY16Y8GgJogFzqbFYYGjsfV7gD
Public key: EOS5RzyvDbtrFrkefdwtpdDp8p7epWGdmAhDX9XsU1PkgKdeoij1X
Next configure the config.ini
on your Block Producer Node with the following block production additions specific to your deployment:
#This is your BP account name
producer-name = eospherewoot#This is your block signing key-pair
signature-provider = EOS5RzyvDbtrFrkefdwtpdDp8p7epWGdmAhDX9XsU1PkgKdeoij1X=KEY:5KT5V1EuY8nT7gHde8ferbY16Y8GgJogFzqbFYYGjsfV7gD#Optimises hand off by producing a bit earlier
last-block-time-offset-us = -200000#Lowers CPU time available on last block for better hand off
last-block-cpu-effort-percent = 20#Enables block production on this node
plugin = eosio::producer_plugin
Now restart nodeos
on your Block Producer Node and ensure it catches back up to the headblock.
You can check on both your nodeos
Nodes by querying them from your Cleos Interface Node to ensure they are in a good state.. and on the correct chain:
> cleos -u https://telos-testnet.eosphere.io get info
{
"server_version": "c75fa31d",
"chain_id": "1eaa0824707c8c16bd25145493bf062aecddfeb56c736f6ba6397f3195f33c9f",
"head_block_num": 180517888,
"last_irreversible_block_num": 180517555,
"last_irreversible_block_id": "0ac27ab39652d6a09595f5fd1d77848a92876eed3d9603fbe68e610449d1a7a2",
"head_block_id": "0ac27c00ddbd3ad95d6f1046c2eed43714ade27b24274ea9cbe0b87807922f33",
"head_block_time": "2022-07-04T03:29:16.000",
"head_block_producer": "telosindiabp",
"virtual_block_cpu_limit": 200000000,
"virtual_block_net_limit": 1048576000,
"block_cpu_limit": 199900,
"block_net_limit": 1048576,
"server_version_string": "v2.0.13",
"fork_db_head_block_num": 180517888,
"fork_db_head_block_id": "0ac27c00ddbd3ad95d6f1046c2eed43714ade27b24274ea9cbe0b87807922f33",
"server_full_version_string": "v2.0.13-c75fa31d119d9e026115f96c5e30a74475786b7c"
}
Registering your Block Producer Account
Now that you are sure all is correctly configured and your Nodes are in sync with the network, you can register your intent to sign blocks and allow token holders to vote for you.
Before you execute the regproducer
action, now is probably a good time to advertise your intent to the rest of the Telos Testnet Community.
There is a Telos Testnet Telegram Group where you can interact with other Block Producers, Service Providers and DApp builders. You will need to be voted into the #21 to be able to produce blocks, the Telegram Group is the place to ask for these votes as well.
There has been some testing recently in regards to optimum path hand-over between Block Production Nodes across the globe. Depending on where your BP is located you will need to choose a unique identifier to ensure the handoff schedule is efficient.
Choose your unique identifier in this google sheet based on your global location.
You can view all valid BP identifiers and account names with the EOSUSA BP Location Tool.
When you have selected an identifier, execute the regproducer
action as below with your specific details:
#The last number is your unique location identifier
> cleos -u https://telos-testnet.eosphere.io system regproducer eospherewoot EOS5RzyvDbtrFrkefdwtpdDp8p7epWGdmAhDX9XsU1PkgKdeoij1X https://www.eosphere.io 8888
As the action is executed on the block-chain level you can actually point your request to any sync’d testnet API i.e you don’t have to execute this action on your own Nodes.
If/When you have been voted into the top #21 your nodeos
output will look something like this for 12 blocks in a round:
info 2022-07-04T03:45:22.735 nodeos producer_plugin.cpp:379 on_incoming_block ] Received block d54c18e631a34649... #180519822 @ 2022-07-04T03:45:23.000 signed by eospherewoot [trxs: 0, lib: 180519487, conf: 0, latency: -264 ms]
info 2022-07-04T03:45:23.184 nodeos producer_plugin.cpp:379 on_incoming_block ] Received block 556d49fa0fe6e7ec... #180519823 @ 2022-07-04T03:45:23.500 signed by eospherewoot [trxs: 0, lib: 180519487, conf: 0, latency: -315 ms]
info 2022-07-04T03:45:24.021 nodeos producer_plugin.cpp:379 on_incoming_block ] Received block 7bca8cc0c0ddbcdf... #180519824 @ 2022-07-04T03:45:24.000 signed by eospherewoot [trxs: 0, lib: 180519499, conf: 0, latency: -270 ms]
If you have any questions or challenges with getting your Telos Testnet Block Producer Node up and running feel free to reach-out to me or one of the team in the EOSphere Telegram Channel.
EOSphere Guild is a Block Producer on the Telos Mainnet and Testnet Blockchains as well as many other EOSIO based Blockchains.
If you find our work helpful, please vote us on the Telos Mainnet: eosphereiobp
Connect with EOSphere via these channels:
TELEGRAM | MEDIUM |YOUTUBE | FACEBOOK | TWITTER | INSTAGRAM