Any account can register as a Block Producer by calling the regproducer action in the system contract and signing up on the Block Producer Directory. It is expected that BPs would specify the website as a parameter and this website would contain a bp.json file in the root folder. Register your on-chain account via a system smart contract, set up a full node, receive votes from Guardians and keep it up and running for block production.
Setting up a read-only full node
Install binaries:
MacOS
brew tap Remmeauth/remprotocol &&
brew install remprotocol
Ubuntu 18.04
wget https://github.com/Remmeauth/remprotocol/releases/download/0.4.2/remprotocol_0.4.2.amd64.deb && sudo apt install ./remprotocol_0.4.2.amd64.deb
CentOS
wget https://github.com/Remmeauth/remprotocol/releases/download/0.4.2/remprotocol_0.4.2.el7.x86_64.rpm && sudo yum install ./remprotocol_0.4.2.el7.x86_64.rpm
Boot node and wallet
Get the genesis.json file that contains information about the REMChain:
wget https://remchain.remme.io/genesis.json
Create config and data directories.
mkdir data && mkdir config && touch config/config.ini
In your configuration file (config/config.ini), add these options:
plugin = eosio::chain_api_plugin
plugin = eosio::net_api_plugin
http-server-address = 0.0.0.0:8888
p2p-listen-endpoint = 0.0.0.0:9876
p2p-peer-address = p2p.remchain.remme.io:2087
p2p-peer-address = Add someone else’s node here who you trust
p2p-peer-address = Add someone else’s node here who you trust
p2p-peer-address = Add someone else’s node here who you trust
p2p-peer-address = Add someone else’s node here who you trust
verbose-http-errors = true
chain-state-db-size-mb = 100480
reversible-blocks-db-size-mb = 10480
These config options will get you into the basic operation mode, with your node API available at port 8888. P2p-peer-address points to the other nodes where new blocks are fetched from. Make sure you specify multiple entries that you trust; p2p.remchain.remme.io is the address of a node hosted by Remme. It’s fine to have the Remme node as the only one in the list, however, if it becomes unavailable or undergoes maintenance, your node will get isolated and become out of sync.
Run the wallet daemon
remvault &
Create default wallet
remcli wallet create --file walletpass
Unlock wallet
remcli wallet unlock < walletpass
Run the node
The first node run:
remnode --config-dir ./config/ --data-dir ./data/ --delete-all-blocks --genesis-json genesis.json
It should start syncing blocks now. Wait until it downloads previous blocks and starts to receive current blocks. Press ctrl+с to stop it.
For subsequent runs of the node, use:
remnode --config-dir ./config/ --data-dir ./data/ >> remnode.log 2>&1 &
The command above will run the node in the background and will save its output to the remnode.log file. If you want to stop the node that runs in the background, run this:
killall remnode
At this point, you must be ready to start and connect your node to the network. If your node is connected and synced, this command should provide you with information about the chain:
remcli get info
{
"server_version": "96796929",
"chain_id": "93ece941df27a5787a405383a66a7c26d04e80182adf504365710331ac0625a7",
"head_block_num": 680455,
"last_irreversible_block_num": 680121,
"last_irreversible_block_id": "000a60b93d787895c905e36d7cf8d37a2bbed21d6f4b04f55645aefe459a32c0",
"head_block_id": "000a62074d3b6919262d90beecdffcc021fca03dc9ecd01ce4bfb91f8af36720",
"head_block_time": "2019-08-12T15:08:58.500",
"head_block_producer": "remproduce21",
...
}
Please check the “head_block_time” parameter: it shows the time your node is currently at. If it shows you a date from the past, it means your node is not yet synced with the network. Before interacting with the network, please wait until this command starts to display the current UTC time, otherwise your transactions may fail.
remcli (analog of cleos in EOSIO terms) is a command-line tool that has a rich variety of functions. It has nearly everything that you may need to interact with the blockchain. You can start familiarizing yourself with it by running remcli --help.
Configure the node as a Block Producer
To become a BP you need to register your on-chain account via a system smart contract by calling the action regproducer, setting up your node as a full node (described above) and preparing it for block production (so it starts to produce blocks in case you make it to the top21); you also need to get enough votes from Guardians. Before running these commands, please make sure your node is in sync with the network.
remcli system regproducer YOUR_BPACCOUNT_NAME
YOUR_PUBLIC_KEY https://yoursite.com
Make sure your website is correct and has a bp.json file in the root directory (https://yoursite.com/bp.json) and conforms to the standard.
In your node config file, add these options:
plugin = eosio::producer_plugin
plugin = eosio::producer_api_plugin
producer-name = YOUR_BPACCOUNT_NAME
signature-provider = YOUR_PUBLIC_KEY=KEY:YOUR_PRIVATE_KEY
Once you run remnode, these config options should get you into BP operation mode with your node. Once your BP account gets into the top21 list, your node will automatically start producing blocks.
Please be aware that, unlike the EOS network, BPs on REMChain are required to validate token swaps between the chains and have to enable additional plugins that ingest data from the external world.
As of today, the mandatory external sources are:
- Swap transactions on the Ethereum network.
- Currency exchange rates related to the REM token.
In the future, it will also cover other sources (such as DNS records or URL endpoints).
BPs who do not submit their data or happen to submit incorrect/misleading values are likely to be penalized by the network or voted out by their Guardians.
Configure swap validation
To activate a plugin which monitors the Ethereum network (for the testnet case), add these options to the config file:
plugin = eosio::eth_swap_plugin
swap-authority = YOUR_BPACCOUNT_NAME@PERMISSION
swap-signing-key = SWAP_SIGNING_KEY
eth-https-provider = YOUR_ETHEREUM_NODE_ADDRESS
SWAP_SIGNING_KEY should be the private key of YOUR_BPACCOUNT_NAME@PERMISSION. This permission must be allowed to call rem.swap account actions (init action in particular). For example, YOUR_BPACCOUNT_NAME@active.
You can set up your own Ethereum node or use other services like Infura. Check out the tutorial for creating an Infura API key.
A link to the Ethereum node should look similar to this:
https://mainnet.infura.io/v3/<your_infura_id>
or if you set up your own Ethereum node:
https://<eth_node_ip>:<websocket_port>
Configure exchange rate data feed
To activate the price oracle plugin which monitors the REM token price via CoinGecko and CryptoCompare, add these options to the config file:
plugin = eosio::rem_oracle_plugin
cryptocompare-apikey = YOUR_CRYPTOCOMPARE_API_KEY
oracle-authority = YOUR_BPACCOUNT_NAME@PERMISSION
oracle-signing-key = ORACLE_SIGNING_KEY
To obtain YOUR_CRYPTOCOMPARE_API_KEY, register on CryptoCompare.
ORACLE_SIGNING_KEY should be the private key of YOUR_BPACCOUNT_NAME@PERMISSION. This permission must be allowed to call rem.oracle account actions (setprice action in particular). For example, YOUR_BPACCOUNT_NAME@active.
Please find an example of a config file here.
It is expected that the community will seek consensus and define trustworthy sources to be monitored by producers. CoinGecko and CryptoCompare sources are integrated into the oracle plugin as an example, and in no way are endorsed by Remme.
For the purposes of distributing infrastructure risks, BPs may split the function of remnode that produces blocks and other plugins (e.g. Swap and Exchange Rate processing plugins) to run on independent machines.
What's next:
What’s required to maintain Guardian status
Comments
0 comments
Please sign in to leave a comment.