1

I am setting up a private Ethereum network using puppeth whic creates the sealer nodes on various servers.

To aid peer discovery, it has been suggested that we include a list of enodes in the file static-nodes.json for geth to use.

Where do we place static-nodes.json?

  1. The datadir directory containing folders geth and keystore, and the filegeth.ipc`

  2. The datadir/geth directory containing folders chaindata, lightchaindata, nodes, and the files LOCK, nodekey, transactions.rlp?

Additionally, where do we place trusted-nodes.json? Can we let geth use both files trusted-nodes.json and static-nodes.json, or must we choose one of the two to use?

Does the nodes added using admin.addPeer gets stored somewhere, or must we re-add these nodes again if we restart geth?

  • You've got too many questions. Split them up to increase the chance of getting an answer. – cleanunicorn Jul 17 '18 at 21:05
2

Where do we place static-nodes.json? Additionally, where do we place trusted-nodes.json?

If you specify --datadir=./ when running your node, the files: static-nodes.json and trusted-nodes.json should be in the current directory.

If for example you do not specify the datadir directory, place the files next to the nodekey, keystore folders (on the same level)

Does the nodes added using admin.addPeer gets stored somewhere, or must we re-add these nodes again if we restart geth?

Using admin.addPeer is volatile, it will not be persisted on the disk.

  • If you do not specify a directory, will the datadir be ~/.ethereum? In this case, you will add static-nodes.json to ~/.ethereum, but in my case my directory has the directories geth and keystore, but nodekey file is inside the geth folder. Where then should I place static-nodes.json? – Athena Wisdom Jul 17 '18 at 22:34

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.