2

i want to run private blockchain network , on the server I'm running:

geth --networkid 4224 --mine --minerthreads 2 --datadir "D:\mydirectory\private-network" --nodiscover --rpc --rpcport "8545" --port "30303" --lightkdf --cache 16 --rpccorsdomain "*" --nat "any" --rpcapi eth,web3,personal,net --unlock 0 --password ./password.sec --allow-insecure-unlock

then on another machine I want to run the client, then my question is how to run the client on another machine and connect to the server?

4
  • What do you call a client ? Is it another geth node or something else ? Mar 4, 2020 at 7:06
  • geth nodes are run on other computers and are connected to each other, for example like running geth nodes that are connected to each other but are different machines
    – nero
    Mar 4, 2020 at 10:05
  • I still do not understand: Do you want to run several nodes or do you want to connect any other kind of application via RPC ? Mar 4, 2020 at 10:11
  • i want to run multiple nodes on different machines with the same genesis.json
    – nero
    Mar 4, 2020 at 10:29

1 Answer 1

1

Based on this comment: i want to run multiple nodes on different machines with the same genesis.json

To run multiple nodes, you have two solutions:


Solution one: Static nodes

One your second (or more) machine, instal geth and initiate the genesis like you did with the first one.

Into your datadir/geth, create a file named static-nodes.json.

This file should contain the enode(s) of the nodes you want, for example:

[
  "enode://f4642fa65af50cfdea8fa7414a5def7bb7991478b768e296f5e4a54e8b995de102e0ceae2e826f293c481b5325f89be6d207b003382e18a8ecba66fbaf6416c0@33.4.2.1:30303",
  "enode://pubkey@ip:port"
]

More information here: https://github.com/ethereum/go-ethereum/wiki/Connecting-to-the-network#static-nodes


Solution two: bootnode(s)

While the first solution works, it is quite hard to maintain with a lot of nodes. This is why the bootnode exists: it is basically a node that tells other nodes connected to it: "hey, look, you can have a peer there".

I won't go into details here because it is a bit long and it has already been described here: https://github.com/ethereum/go-ethereum/wiki/Setting-up-private-network-or-local-cluster#private-network

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.