Peer to Peer Data Tranfer Protocol
For now, you need to compile it yourself:
git clone https://github.com/ansuman12chat/p2p.git
go install cmd/p2p/main.go
Make sure the $GOPATH/bin
is in your PATH
variable to access the installed p2p
executable.
The receiving peer runs:
$ p2p receive
Your identity:
16Uiu2HAm9YBEqaJE1fHt1XXrawCJoMAeYm5sN6nzUGWGMQB4kfb
Waiting for peers to connect... (cancel with strg+c)
The sending peer runs:
$ p2p send my_file
Querying peers that are waiting to receive files...
Found the following peer(s):
[0] 16Uiu2HAm9YBEqaJE1fHt1XXrawCJoMAeYm5sN6nzUGWGMQB4kfb
Select the peer you want to send the file to [#,r,q,?]:
At this point the sender needs to select the receiving peer, who in turn needs to confirm the file transfer.