eth-net-intelligence-api
eth-net-intelligence-api copied to clipboard
how to connect with multiple rpc ip:port ?
i have three nodes which running on 3 different server. I want to list all 3 node on my eth-netstat app for example
- enode://pubkey1@ip1:port1
- enode://pubkey2@ip2:port2
- enode://pubkey3@ip3:port3 how can I achive this?
right now I can attach with one node by setting env in app.json.
{ "NODE_ENV" : "production", "RPC_HOST" : "ip1", "RPC_PORT" : "port1", "LISTENING_PORT" : "30303", "INSTANCE_NAME" : "my_node", "CONTACT_DETAILS" : "", "WS_SERVER" : "ws://localhost:3000", "WS_SECRET" : "ChangeWsSecret", "VERBOSITY" : "2" }
my goal is to list multiple node.
Just create 3 json files like this
{
"NODE_ENV" : "production1",
"RPC_HOST" : "ip1",
"RPC_PORT" : "port1",
"LISTENING_PORT" : "lis_port1",
"INSTANCE_NAME" : "my_node1",
"CONTACT_DETAILS" : "",
"WS_SERVER" : "ws://localhost:3000",
"WS_SECRET" : "ChangeWsSecret",
"VERBOSITY" : "2"
}
{
"NODE_ENV" : "production2",
"RPC_HOST" : "ip2",
"RPC_PORT" : "port2",
"LISTENING_PORT" : "lis_port2",
"INSTANCE_NAME" : "my_node2",
"CONTACT_DETAILS" : "",
"WS_SERVER" : "ws://localhost:3000",
"WS_SECRET" : "ChangeWsSecret",
"VERBOSITY" : "2"
}
{
"NODE_ENV" : "production3",
"RPC_HOST" : "ip3",
"RPC_PORT" : "port3",
"LISTENING_PORT" : "lis_port3",
"INSTANCE_NAME" : "my_node3",
"CONTACT_DETAILS" : "",
"WS_SERVER" : "ws://localhost:3000",
"WS_SECRET" : "ChangeWsSecret",
"VERBOSITY" : "2"
}
where can I address these file in app? sorry I didn't understand the solution could you please explain?
copy app.json
to node1.json
, node2.json
, node3.json
, edit them as stated above and then start all of them
pm2 start node1.json
pm2 start node2.json
pm2 start node3.json
Thanks @5chdn, This solution work for me.