1

i have followed this guide and set up my own private blockchain. Now the only node that mines and sets smart contracts is my own computer, but I want to connect another computer to my network. How do I do that? And not just for mining, but to be seen in Mist, too (to participate in smart contracts).

Also a "bonus" simple question - the guide says to download the entire Ethereum blockchain and then set up a private network, but i don't understand why download the entire blockchain, when youre in the end setting up your private network anyway? Isn't the guide wrong?

  • just modify params/bootnodes.go to add your bootnode, then run bootnode binary, now distribute your geth binary and everybody will connect to your network automatically – Nulik Mar 19 '18 at 1:53
1

By another computer, I'm assuming you mean a separate machine within your the same LAN? Did you assign it a unique IP or is just on a subnet?

Either way, try admin.addPeer("enode://address@ip:port")in console.

Another option is to set up a static-peers.json file. I answered a similar question a couple days ago you can refer to for more details.

I didn't read the guide you posted, but you definitely don't need to download the Ethereum main net in order to launch your own private network. You just need to init a customgenesis.json that specifies the networkid and then get to work. Be sure to indicate --networkid when launching your geth instance.

  • Thank you! I have seen other people saying to indicate --networkid when launching, but I went by the guide, and it didn't specify that. I do have "chainId": 15 in the genesis.json file, though. Could that be it? And if I didn't indicate it, should I start from scratch? And what is the "address" part in the command you mentioned? – Mark OD Mar 18 '18 at 9:26
  • ChainID and networkid are the same thing. I'd choose something longer than 15 unless you're ok with other nodes who have the same genesis file potentially syncing with your testnet. – zakcole Mar 18 '18 at 17:34
  • Example: "enode://82bf100dc69d83e49741fd6fd727c51513bc24b2340d12c285ebab1cbdfb6c9a92d78bc4738e89733cebcf5477046081f1ec8aeb2e8250f6b6241f8b79a7e27e@[::]:30303" When indicating a peer, add this enode address, but be sure to replace [::] with that particular node's IP address and specify the port if it's different than the default port number. Example: "enode://82bf100dc69d83e49741fd6fd727c51513bc24b2340d12c285ebab1cbdfb6c9a92d78bc4738e58963cebcf5477046081f1ec8aeb2e8250f6b6241f8b79a7e27e@10.10.101.5:30303" – zakcole Mar 18 '18 at 17:39
  • enode address is similar to a mac address. You can find it in console with admin.nodeInfo.enode – zakcole Mar 18 '18 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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