Generate some random ID, e.g. using random dot org, let's use 88259
. On the first machine your run the client like that (note I also changed the network port and datadir to avoid conflicts with the main network):
geth --datadir "/home/user/.eth-private" --port 30259 --networkid 88259
This will run a new instance of a private ethereum network on your first machine.
I0621 10:19:02.655014 ethdb/database.go:82] Alloted 128MB cache and 1024 file handles to /home/user/.eth-private/chaindata
I0621 10:19:02.827145 ethdb/database.go:169] closed db:/home/user/.eth-private/chaindata
I0621 10:19:02.827243 cmd/utils/flags.go:601] WARNING: No etherbase set and no accounts found as default
I0621 10:19:02.827886 ethdb/database.go:82] Alloted 128MB cache and 1024 file handles to /home/user/.eth-private/chaindata
I0621 10:19:02.840042 ethdb/database.go:82] Alloted 16MB cache and 16 file handles to /home/user/.eth-private/dapp
I0621 10:19:02.841749 eth/backend.go:172] Protocol Versions: [63 62 61], Network Id: 88259
I0621 10:19:02.841907 eth/backend.go:201] Blockchain DB Version: 3
I0621 10:19:02.842241 core/blockchain.go:206] Last header: #0 [d4e56740…] TD=17179869184
I0621 10:19:02.842260 core/blockchain.go:207] Last block: #0 [d4e56740…] TD=17179869184
I0621 10:19:02.842271 core/blockchain.go:208] Fast block: #0 [d4e56740…] TD=17179869184
I0621 10:19:02.842952 p2p/server.go:313] Starting Server
I0621 10:19:04.844709 p2p/discover/udp.go:217] Listening, enode://6179e58bb512415a76e4169dd25ae5a171e34069660b233cf79dabd3581d8dd1221a7f3a5e5d64251aa7e8ac20eda5430e42eed161e68cb05d05e6c3cab68a6e@[::]:30259
I0621 10:19:04.845128 p2p/server.go:556] Listening on [::]:30259
I0621 10:19:04.848679 node/node.go:296] IPC endpoint opened: /home/user/.eth-private/geth.ipc
Now, you extract the enode uri from the first node and replace the IP with the ID of your local area network (LAN, or use the public IP if the nodes are distributed), like that:
enode://6179e58bb512415a76e4169dd25ae5a171e34069660b233cf79dabd3581d8dd1221a7f3a5e5d64251aa7e8ac20eda5430e42eed161e68cb05d05e6c3cab68a6e@192.168.1.159:30259
Now, you can pass this node as boot node to the 2nd and 3rd node, like that:
geth --datadir "/home/user/.eth-private" --port 30259 --networkid 88259 --bootnodes "enode://6179e58bb512415a76e4169dd25ae5a171e34069660b233cf79dabd3581d8dd1221a7f3a5e5d64251aa7e8ac20eda5430e42eed161e68cb05d05e6c3cab68a6e@192.168.1.159:30259"
Note the network ID has to be the same on all clients. It will try to connect to your first node.
If you have multiple nodes running, you can also add more nodes to the bootnodes parameter, just separate them by comma.
12588
and12345
, make sure they match.