Execution of several complete nodes on one host: a guide
In this article, we will examine how to do several complete nodes on one host with Ethereum and other popular cryptocurrencies. We will also discuss the importance of choosing the node ports and give instructions for setting up a multi-node setup.
** Why do several knots?
Complete nodes are required to validate transactions and maintain a public general book or all Bitcoin, Litecoin, Darkcoin and other cryptocurrency transactions. By executing several complete nodes you can:
- Spread the load over several hosts and reduce the stretching of individual nodes.
- Use multi-core processors and faster network connections.
- Create a more resilient system if a node goes offline.
Port selection: The key to success
You are right; The execution of several complete nodes on the same port (8333) is not observed. Ethereum's Standard Port 8333 is reserved for its core protocol, which includes the consensus salgorithm, transaction validation and other essential services. The use of this port can be:
- Construction: Several nodes that compete for the same resource.
- Interference: contradicting knot traffic.
Alternative ports
To avoid conflicts, you can use alternative ports on your Ethereum node:
- 8545 (Standard for Web3 -APIS)
- 8546 (alternative port for progressive users)
- 8547 (additional port for tests and development)
Multi-node setup: a step-by-step instructions
Here you will find a step-by-step instructions for setting up several complete nodes on a host with Ethereum:
Select the cryptocurrencies you want to do and decide which node the leader or coordinator is.
- Bitcoin (BTCP)
- Litecoin (LTCP)
- Darkcoin (DCTC)
In this example we use BTCP and LTCP nodes.
Create a new Ethereum node configuration file (.json) for every cryptocurrency:
`Json
{
"Name": "BTCP",
"RPCHOST": "Your-BTCP-Node-1.com:8545",
"RPCport": 8546,
"RPCusername": "Username",
"RPCPassword": "Password"
}
Similarly, create a new configuration file for LTCP:
`Json
{
"Name": "LTCP",
"RPCHOST": "Your-ltcp-node-1.com:8545",
"RPCport": 8546,
"RPCusername": "Username",
"RPCPassword": "Password"
}
Set up a new application for each cryptocurrency node that hears connections on the selected port:
`Python
Import the socket
Create a socket object
Server_socket = socket.socket (socket.af_inet, socket.sock_stream)
Server_socket.bind (("your -btcp-node-1.com", 8546))
server_socket.listen (5)
Print ("BTCP node on port 8546"))
While true:
Client_socket, address = server_socket.amcept ()
Data = client_socket.recv (1024)
Print (data.dode ())
Client_socket.close ()
`Python
Import the socket
Server_socket = socket.socket (socket.af_inet, socket.sock_stream)
Server_socket.bind (("your-ltcp-node-1.com", 8546))
server_socket.listen (5)
Print ("LTCP node on port 8546"))
While true:
Client_socket, address = server_socket.amcept ()
Data = client_socket.recv (1024)
Print (data.dode ())
Client_socket.close ()