0

how i can broadcast a enode address to another physical machine on the same network, in geth

take for example, this as my enode address:

"enode://d542cd9b172b59612d67b02ea2ac3f1f4a4e6e4b8e2760a35ba4806151a7@127.0.0.1:31303?discport=0"

as you can see, it is tied to localhost and port 31303

how then, can this enode be discovered by geth running on another machine ( albeit on the same Local network )

P.S : for context, this is a local network - with separate Linux Server machines that we're trying to connect to each other. We're running a PoS private testnet based on geth + lighthouse

1 Answer 1

0

You can use the bootnode tool (comes with geth) to generate the enode address for any particular node on your network. Then you can specify the list of such nodes as, the trusted nodes or static nodes in the toml config in the [Node.P2P] section:

# generate the private key and store it in enode.key
bootnode --genkey enode.key;
# generates the public key of the node and displays it
bootnode --nodekey=enode.key --writeaddress
# for example: 01234567....abcdef

You can generate the config toml file for your geth command with

geth <your args> dumpconfig > config.toml

Then edit the file by adding the enode address into the StaticNodes list :

StaticNodes = ["enode://01234567...abcdef@<ip-address>:30303"]

Finally, start your node with

geth --config config.toml --nodekey enode.key

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.