pcp

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

README

pcp - Peer Copy

standard-readme compliant Go Report Card Maintainability Test Coverage

Command line peer-to-peer data transfer tool based on libp2p.

Demo animation

Table of Contents

Motivation

There already exists a long list of file transfer tools (see Related Efforts), so why bother building another one? The problem I had with the existing tools is that they rely on a limited set of servers to orchestrate peer matching and data relaying which poses a centralisation concern. Many of the usual centralisation vs. decentralisation arguments apply here, e.g. the servers are single points of failures, the service operator has the power over whom to serve and whom not, etc. Further, as this recent issue in croc shows, this is a real risk for sustainable operation of the provided service. Only because a benevolent big player jumps in as a sponsor the service continues to exist.

pcp leverages the peer-to-peer networking stack of libp2p. It uses multicast DNS to find peers locally and the distributed hash table of IPFS for remote peer discovery. Unfortunately there is a significant drawbacks with this approach: It's slower than established centralised methods if you want to transmit data over network boundaries. A DHT query to find your peer can take 2 - 3 minutes.

Usage

The sending peer runs:

$ pcp send my_file
Code is:  bubble-enemy-result-increase
On the other machine run:
	pcp receive bubble-enemy-result-increase

The receiving peer runs:

$ pcp receive december-iron-old-increase
Looking for peer december-iron-old-increase...

If you're on different networks the lookup can take quite long without any user facing output yet (~2 - 3 minutes).

Install

Release download

Head over to the releases and download the latest binary for your platform.

From source

For now, you need to compile it yourself:

git clone https://github.com/dennis-tra/pcp.git

Navigate into the pcp folder and run:

go install cmd/pcp/pcp.go

Make sure the $GOPATH/bin is in your PATH variable to access the installed pcp executable.

Package managers

It's on the roadmap to distribute pcp via apt, yum, brew, scoop and more ...

Development

Protobuf definitions

First install the protoc compiler:

make tools # downloads gofumpt and protoc
make proto # generates protobuf

The current proto definitions were generated with libprotoc 3.14.0.

Feature Roadmap

Shamelessly copied from croc:

  • allows any two computers to transfer data (using a relay)
  • provides end-to-end encryption (using PAKE)
    • ✅ actually PAKE is only used for authentication TLS for end-to-end encryption
  • enables easy cross-platform transfers (Windows, Linux, Mac)
    • 🤔✅ only tested Linux <-> Mac
  • allows multiple file transfers
    • ❌ not yet
  • allows resuming transfers that are interrupted
    • ❌ not yet
  • local server or port-forwarding not needed
  • ipv6-first with ipv4 fallback
    • 🤔 I think that's the case, but I'm not sure about the libp2p internals
  • can use proxy, like tor
    • ❌ not yet
  • croc - Easily and securely send things from one computer to another
  • magic-wormhole - get things from one computer to another, safely
  • dcp - Remote file copy, powered by the Dat protocol.
  • iwant - CLI based decentralized peer to peer file sharing
  • p2pcopy - Small command line application to do p2p file copy behind firewalls without a central server.
  • zget - Filename based peer to peer file transfer
  • sharedrop - Easy P2P file transfer powered by WebRTC - inspired by Apple AirDrop
  • filepizza - Peer-to-peer file transfers in your browser
  • toss - Dead simple LAN file transfers from the command line
  • Forgot yours? Open an issue or submit a PR :)

Maintainers

@dennis-tra.

Acknowledgment

  • go-libp2p - The Go implementation of the libp2p Networking Stack.
  • pake/v2 - PAKE library for generating a strong secret between parties over an insecure channel
  • progressbar - A really basic thread-safe progress bar for Golang applications

Contributing

Feel free to dive in! Open an issue or submit PRs.

License

Apache License Version 2.0 © Dennis Trautwein

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
pcp
internal
app
log
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
pkg
crypt
Taken and adapted from: https://github.com/schollz/croc/blob/8dc5bd6e046194d0c5b1dc34b0fd1602f8f6c7ad/src/crypt/crypt.go#L1
Taken and adapted from: https://github.com/schollz/croc/blob/8dc5bd6e046194d0c5b1dc34b0fd1602f8f6c7ad/src/crypt/crypt.go#L1
dht
pb

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL