https://github.com/sandeepsukhani/devp2p-example
Go program to connect two machines using devp2p, a p2p protocol by Ethereum
https://github.com/sandeepsukhani/devp2p-example
devp2p golang
Last synced: 11 months ago
JSON representation
Go program to connect two machines using devp2p, a p2p protocol by Ethereum
- Host: GitHub
- URL: https://github.com/sandeepsukhani/devp2p-example
- Owner: sandeepsukhani
- Created: 2018-05-16T17:24:49.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-17T03:41:40.000Z (about 8 years ago)
- Last Synced: 2023-03-22T04:16:19.549Z (about 3 years ago)
- Topics: devp2p, golang
- Language: Go
- Homepage:
- Size: 2.3 MB
- Stars: 5
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About:
A sample Go program to connect two machines using devp2p.
A p2p protocol is defined which sends and receives a message between connected peers.
Program supports 2 optional arguments:
--port: This is used for changing default 30301 port to some other port, where the server listens.
--connect-to: This is used for connecting to a server for communicating. If this is not given, server runs forever and keeps accepting connection requests otherwise server stops after sending and receiving message from connected peer.
**How to build:**
* go build
**How to start peer-1:**
* ./devp2p-sample
* Get printed enode url, to be used for connecting with second peer. Replace '[::]' after @ with ip of the machine, which is reachable from second peer.
**How to start peer-2:**
* ./devp2p-sample --connect-to [copied-enode-url-with-ip]
This can be run on same or different machine. For running on same machine, both the servers needs to run on different ports.