ethereumproject / go-ethereum

Go language implementation of the original/classic design of the Ethereum protocol
GNU Lesser General Public License v3.0
441 stars 166 forks source link

Allows p2p connections only to/from specified nodes #688

Closed splix closed 5 years ago

splix commented 5 years ago

New command line option to specify file with approved remotes. The file should contain one potential node per line, as a full address or just ID. If full address is specified, the IP:PORT should be verified with the connection, in addition to node ID.

Example:

cat nodes.txt
enode://908db53d90ed1d157a7b543e9b6ceec63dbe00fcaad5cabc22dedb1892bc26533cd6005d6e4316723a3d48bdbcee46066b7029c4fc6dbb8f64f8b16cc920073f@10.10.0.16:30303
enode://00ab2b92fb2fffb9115f36a9fbd0e90a5ab54faa0316bce5e5e2d9789a9c5e9c9c4225183e5e10c86b72c89db69a893e2220ad9257cdea99b2a0266d2ae47e1a@10.10.0.17:30303
c9790eb4ecd07fb562b29e0a7c95fd23fce58ce57e57538a65a096289bfb57066f8869545950530decace6827f62d2860174f1aa6772e1fe09b7cb8f0196d2f4

geth --allow-peers nodes.txt

This should allow connection only to/from bootnodes and 3 nodes from that file