Heartbeat plugin to coordinate BP node status and metadata on-chain.
The goal is to show that a standby or active BP is ready for block production in terms version, blacklist sync, configuration, etc.
This plugin is intended for both standby and active BPs. it is intended to run on the block producing node.
Contains version, head_block_num
- Works on any EOSIO node that runs v1.1.4 and up.
- run
cd <eosio-source-dir>/plugins
git clone https://github.com/bancorprotocol/eos-producer-heartbeat-plugin.git producer_heartbeat_plugin
- Add the following line to
<eosio-source-dir>/plugins/CMakeLists.txt
with otheradd_subdirectory
items
add_subdirectory(producer_heartbeat_plugin)
- Add the following line to the bottom of
<eosio-source-dir>/programs/nodeos/CMakeLists.txt
target_link_libraries( nodeos PRIVATE -Wl,${whole_archive_flag} producer_heartbeat_plugin -Wl,${no_whole_archive_flag})
- Build and install nodeos as usual. You could even just
cd <eosio-source-dir>/build
and thensudo make install
Enable this plugin using --plugin
option to nodeos or in your config.ini. Use nodeos --help
to see options used by this plugin.
Use a dedicated key for this action.
cleos create key # HEARBEAT_PRIVATE_KEY and HEARBEAT_PUB_KEY
cleos set account permission PRODUCERACCT heartbeat '{"threshold":1,"keys":[{"key":"HEARBEAT_PUB_KEY","weight":1}]}' "active" -p PRODUCERACCT@active
cleos set action permission PRODUCERACCT heartbeat123 heartbeat heartbeat
plugin = eosio::producer_heartbeat_plugin
heartbeat-period = 300
heartbeat-signature-provider = HEARBEAT_PUB_KEY=KEY:HEARBEAT_PRIVATE_KEY
heartbeat-contract = heartbeat123
- You should see an entry for producer_heartbeat_plugin in the logs when you restart nodeos.
- Any suggestions and pull requests are welcome :)