2020-03-16 07:43:08 +00:00
< h1 align = "center" >
< a href = "libp2p.io" > < img width = "250" src = "https://github.com/libp2p/libp2p/blob/master/logo/black-bg-2.png?raw=true" alt = "libp2p hex logo" / > < / a >
< / h1 >
2018-11-19 02:07:53 +00:00
2020-03-16 07:43:08 +00:00
< h3 align = "center" > The Nim implementation of the libp2p Networking Stack.< / h3 >
2020-02-06 15:07:50 +00:00
2020-03-16 07:43:08 +00:00
< p align = "center" >
< a href = "https://travis-ci.org/status-im/nim-libp2p" > < img src = "https://travis-ci.org/status-im/nim-libp2p.svg?branch=master" / > < / a >
< a href = "https://ci.appveyor.com/project/nimbus/nim-libp2p/branch/master" > < img src = "https://ci.appveyor.com/api/projects/status/pqgif5bcie6cp3wi/branch/master?svg=true" / > < / a >
< a href = "https://dev.azure.com/nimbus-dev/nim-libp2p/_build?definitionId=5&branchName=master" > < img src = "https://img.shields.io/azure-devops/build/nimbus-dev/dc5eed24-3f6c-4c06-8466-3d060abd6c8b/5/master?label=Azure%20%28Linux%2064-bit%2C%20Windows%2032-bit%2F64-bit%2C%20MacOS%2064-bit%29" / > < / a >
< / p >
< p align = "center" >
< a href = "https://opensource.org/licenses/Apache-2.0" > < img src = "https://img.shields.io/badge/License-Apache%202.0-blue.svg" / > < / a >
< a href = "https://opensource.org/licenses/MIT" > < img src = "https://img.shields.io/badge/License-MIT-blue.svg" / > < / a >
< a href = "" > < img src = "https://img.shields.io/badge/nim-%3E%3D1.0.6-orange.svg?style=flat-square" / > < / a >
< / p >
2018-11-19 02:07:53 +00:00
2019-08-14 08:56:56 +00:00
## Introduction
2020-03-16 07:43:08 +00:00
An implementation of [libp2p ](https://libp2p.io/ ) in Nim. Also provides a Nim wrapper of the [Libp2p Go daemon ](https://github.com/libp2p/go-libp2p ).
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
## Project Status
The current native Nim libp2p implementation support is experimental and shouldn't be relied on for production use. It is under active development and contributions are highly welcomed. :)
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
Check our [examples folder ](/examples ) to get started!
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
# Table of Contents
- [Background ](#background )
- [Install ](#install )
- [Prerequisite ](#prerequisite )
- [Usage ](#usage )
- [API ](#api )
- [Getting Started ](#getting-started )
- [Tutorials and Examples ](#tutorials-and-examples )
- [Using the Go Daemon ](#using-the-go-daemon )
- [Development ](#development )
- [Tests ](#tests )
- [Packages ](#packages )
- [Contribute ](#contribute )
- [Core Developers ](#core-developers )
- [License ](#license )
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
## Background
libp2p is a networking stack and library modularized out of [The IPFS Project ](https://github.com/ipfs/ipfs ), and bundled separately for other tools to use.
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
libp2p is the product of a long and arduous quest of understanding; a deep dive into the internet's network stack and the peer-to-peer protocols from the past. Building large scale peer-to-peer systems has been complex and difficult in the last 15 years and libp2p is a way to fix that. It is a "network stack", a suite of networking protocols that cleanly separates concerns and enables sophisticated applications to only use the protocols they absolutely need, without giving up interoperability and upgradeability.
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
libp2p grew out of IPFS, but it is built so that lots of people can use it, for lots of different projects.
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
- Learn more about libp2p at [**libp2p.io** ](https://libp2p.io ) and follow our evolving documentation efforts at [**docs.libp2p.io** ](https://docs.libp2p.io ).
- [Here ](https://github.com/libp2p/libp2p#description ) is an overview of libp2p and its implementations in other programming languages.
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
## Install
2019-09-30 15:58:20 +00:00
```
2020-03-16 07:43:08 +00:00
nimble install libp2p
```
### Prerequisite
- [Nim ](https://nim-lang.org/install.html )
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
## Usage
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
### API
The specification is available on [API.md ](doc/API.md ) (coming soon).
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
### Getting Started
Please read the [GETTING_STARTED.md ](doc/GETTING_STARTED.md ) guide.
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
### Tutorials and Examples
Examples can be found in the [examples folder ](/examples ).
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
### Using the Go Daemon
Please find the installation and usage intructions in [GO_DAEMON.md ](doc/GO_DAEMON.md ).
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
Examples can be found in the [examples/go-daemon folder ](https://github.com/status-im/nim-libp2p/tree/readme/examples/go-daemon );
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
## Development
**Clone and Install dependencies:**
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
```sh
git clone https://github.com/status-im/nim-libp2p
cd nim-libp2p
nimble install
```
2019-09-30 15:58:20 +00:00
2020-03-16 07:43:08 +00:00
### Tests
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
#### Prerequisite
- [Go 1.12+ ](https://golang.org/dl/ )
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
#### Run unit tests
```sh
# run all the unit tests
nimble test
```
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
### Packages
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
List of packages currently in existence for nim-libp2p:
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
#### Libp2p
- [libp2p ](https://github.com/status-im/nim-libp2p )
- [libp2p-daemon-client ](https://github.com/status-im/nim-libp2p/blob/master/libp2p/daemon/daemonapi.nim )
- [interop-libp2p ](https://github.com/status-im/nim-libp2p/blob/master/tests/testinterop.nim )
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
#### Transports
- [libp2p-tcp ](https://github.com/status-im/nim-libp2p/blob/master/libp2p/transports/tcptransport.nim )
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
#### Secure Channels
- [libp2p-secio ](https://github.com/status-im/nim-libp2p/blob/master/libp2p/protocols/secure/secio.nim )
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
#### Stream Multiplexers
- [libp2p-mplex ](https://github.com/status-im/nim-libp2p/blob/master/libp2p/muxers/mplex/mplex.nim )
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
#### Utilities
- [libp2p-crypto ](https://github.com/status-im/nim-libp2p/tree/master/libp2p/crypto )
- [libp2p-crypto-secp256k1 ](https://github.com/status-im/nim-libp2p/blob/master/libp2p/crypto/secp.nim )
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
#### Data Types
- [peer-id ](https://github.com/status-im/nim-libp2p/blob/master/libp2p/peer.nim )
- [peer-info ](https://github.com/status-im/nim-libp2p/blob/master/libp2p/peerinfo.nim )
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
#### Pubsub
- [libp2p-pubsub ](https://github.com/status-im/nim-libp2p/blob/master/libp2p/protocols/pubsub/pubsub.nim )
- [libp2p-floodsub ](https://github.com/status-im/nim-libp2p/blob/master/libp2p/protocols/pubsub/floodsub.nim )
- [libp2p-gossipsub ](https://github.com/status-im/nim-libp2p/blob/master/libp2p/protocols/pubsub/gossipsub.nim )
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
Packages that exist in the original libp2p specs and are under active development:
- libp2p-daemon
- libp2p-webrtc-direct
- libp2p-webrtc-star
- libp2p-websockets
- libp2p-spdy
- libp2p-bootstrap
- libp2p-kad-dht
- libp2p-mdns
- libp2p-webrtc-star
- libp2p-delegated-content-routing
- libp2p-delegated-peer-routing
- libp2p-nat-mgnr
- libp2p-utils
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
** Note that the current stack reflects the minimal requirements for the upcoming Eth2 implementation.
2019-12-10 20:50:35 +00:00
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
## Contribute
The libp2p implementation in Nim is a work in progress. We welcome contributors to help out! Specifically, you can:
- Go through the modules and **check out existing issues** . This would be especially useful for modules in active development. Some knowledge of IPFS/libp2p may be required, as well as the infrastructure behind it.
- **Perform code reviews**. Feel free to let us know if you found anything that can a) speed up the project development b) ensure better quality and c) reduce possible future bugs.
- **Add tests**. Help nim-libp2p to be more robust by adding more tests to the [tests folder ](https://github.com/status-im/nim-libp2p/tree/master/tests ).
2019-09-30 15:46:57 +00:00
2020-03-16 07:43:08 +00:00
### Core Developers
2020-03-16 08:17:31 +00:00
[@cheatfate ](https://github.com/cheatfate ), [Dmitriy Ryajov ](https://github.com/dryajov ), [Giovanni Petrantoni ](https://github.com/sinkingsugar ), [Zahary Karadjov ](https://github.com/zah )
2019-09-30 15:46:57 +00:00
2018-11-19 02:04:47 +00:00
## License
Licensed and distributed under either of
* MIT license: [LICENSE-MIT ](LICENSE-MIT ) or http://opensource.org/licenses/MIT
2019-01-02 14:05:50 +00:00
or
* Apache License, Version 2.0, ([LICENSE-APACHEv2](LICENSE-APACHEv2) or http://www.apache.org/licenses/LICENSE-2.0)
2018-11-19 02:04:47 +00:00
at your option. This file may not be copied, modified, or distributed except according to those terms.