Socket Event Forwarder is an Ark.io bridgechain plugin for forwarding real-time blockchain events through socket.io protocol. It is designed to be installed on a relay node. It was developed by Friends of Little Yus member @emsy. We use this plugin on all of our relay nodes for monitoring special blockchain transactions, events, and node status.
Plugin Source: github.com/e-m-s-y/socket-event-forwarder
Installation on Compendia Blockchain Relay
- Add plugin to relay node.
cd ~/compendia-core/plugins && git clone https://github.com/e-m-s-y/socket-event-forwarder
- Open plugin configuration file
nano ~/.config/compendia-core/realmainnet/plugins.js
- Add configuration to bottom of file
"@foly/socket-event-forwarder": {
port: 3333, // The port the socket server server will listen to.
events: ['block.applied', 'transaction.applied'], // Events you want to forward.
customEvents: ['systeminformation', 'network.latency','blockheight.current'], // Enabled custom events
systeminformationInterval: 5000, // Interval of systeminformation event
networkLatencyInterval: 10000, // Interval of network.latency event
blockheightCurrentInterval: 10000, // Interval of blockheight.current event
}
- BootStrap the plugin
cd ~/compendia-core
yarn bootstrap
- Open up port in firewall
ufw allow 3333
- Restart relay and verify plugin loads correctly
ccontrol restart relay
ccontrol logs
Updating Plugin on Compendia Relay
cd ~/compendia-core/plugins/socket-event-forwarder
git pull
pm2 restart all
Installation on Radians Blockchain Relay
- Add plugin to relay node.
cd ~/core-radians/plugins && git clone https://github.com/e-m-s-y/socket-event-forwarder
- Open plugin configuration file
nano ~/.config/radians-core/mainnet/plugins.js
- Add configuration to bottom of file
"@foly/socket-event-forwarder": {
port: 3333, // The port the socket server server will listen to.
events: ['block.applied', 'transaction.applied'], // Events you want to forward.
customEvents: ['systeminformation', 'network.latency','blockheight.current'], // Enabled custom events
systeminformationInterval: 5000, // Interval of systeminformation event
networkLatencyInterval: 10000, // Interval of network.latency event
blockheightCurrentInterval: 10000, // Interval of blockheight.current event
}
- BootStrap the plugin
cd ~/radians-core
yarn bootstrap
- Open up port in firewall
ufw allow 3333
- Restart relay and verify plugin loads correctly
radians relay:stop
radians relay:start
radians relay:log
Installation on Ark Blockchain Relay
- Add plugin to relay node.
cd ~/ark-core/plugins && git clone https://github.com/e-m-s-y/socket-event-forwarder
- Open plugin configuration file
nano ~/.config/ark-core/mainnet/plugins.js
- Add configuration to bottom of file
"@foly/socket-event-forwarder": {
port: 3333, // The port the socket server server will listen to.
events: ['block.applied', 'transaction.applied'], // Events you want to forward.
customEvents: ['systeminformation', 'network.latency','blockheight.current'], // Enabled custom events
systeminformationInterval: 5000, // Interval of systeminformation event
networkLatencyInterval: 10000, // Interval of network.latency event
blockheightCurrentInterval: 10000, // Interval of blockheight.current event
}
- BootStrap the plugin
cd ~/ark-core
yarn bootstrap
- Open up port in firewall
ufw allow 3333
- Restart relay and verify plugin loads correctly
ark relay:stop
ark relay:start
ark relay:log
Plugin User Guide
Not yet complete.
systeminformation Event
{
"mem":{
"total":1954131968,
"free":18530304,
"used":1935601664,
"active":672628736,
"available":1281503232,
"buffers":215429120,
"cached":1137901568,
"slab":108171264,
"buffcache":1461501952,
"swaptotal":0,
"swapused":0,
"swapfree":0
},
"currentLoad":{
"avgload":0.11,
"currentload":7.9654997463216635,
"currentload_user":4.312531709791983,
"currentload_system":3.65296803652968,
"currentload_nice":0,
"currentload_idle":92.03450025367833,
"currentload_irq":0,
"raw_currentload":1570,
"raw_currentload_user":850,
"raw_currentload_system":720,
"raw_currentload_nice":0,
"raw_currentload_idle":18140,
"raw_currentload_irq":0,
"cpus":[
{
"load":8.23045267489712,
"load_user":4.320987654320987,
"load_system":3.909465020576132,
"load_nice":0,
"load_idle":91.76954732510289,
"load_irq":0,
"raw_load":400,
"raw_load_user":210,
"raw_load_system":190,
"raw_load_nice":0,
"raw_load_idle":4460,
"raw_load_irq":0
},
{
"load":6.288032454361055,
"load_user":3.8539553752535496,
"load_system":2.434077079107505,
"load_nice":0,
"load_idle":93.71196754563894,
"load_irq":0,
"raw_load":310,
"raw_load_user":190,
"raw_load_system":120,
"raw_load_nice":0,
"raw_load_idle":4620,
"raw_load_irq":0
},
{
"load":10.323886639676113,
"load_user":6.0728744939271255,
"load_system":4.251012145748987,
"load_nice":0,
"load_idle":89.67611336032388,
"load_irq":0,
"raw_load":510,
"raw_load_user":300,
"raw_load_system":210,
"raw_load_nice":0,
"raw_load_idle":4430,
"raw_load_irq":0
},
{
"load":7.028112449799197,
"load_user":3.0120481927710845,
"load_system":4.016064257028113,
"load_nice":0,
"load_idle":92.9718875502008,
"load_irq":0,
"raw_load":350,
"raw_load_user":150,
"raw_load_system":200,
"raw_load_nice":0,
"raw_load_idle":4630,
"raw_load_irq":0
}
]
},
"cpuTemperature":{
"main":36.998,
"cores":[
],
"max":36.998
},
"osInfo":{
"platform":"linux",
"release":"18.04.5 LTS"
},
"cpu":{
"speed":"1.50",
"cores":4,
"speedmin":"0.60",
"speedmax":"1.50",
"processors":1,
"physicalCores":4
},
"fs":[
{
"use":61.24,
"size":15347998720,
"used":9399152640
},
{
"use":31.02,
"size":264289280,
"used":81987584
}
]
}