2018-11-19 03:58:31 +02:00
|
|
|
# nim-libp2p
|
2018-11-19 04:07:53 +02:00
|
|
|
|
|
|
|
[](https://travis-ci.org/status-im/nim-libp2p)
|
2019-06-17 17:34:57 +03:00
|
|
|
[](https://ci.appveyor.com/project/nimbus/nim-libp2p/branch/master)
|
2019-08-22 13:40:49 +03:00
|
|
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
|
|
[](https://opensource.org/licenses/MIT)
|
|
|
|

|
2018-11-19 04:07:53 +02:00
|
|
|
|
2019-08-14 10:56:56 +02:00
|
|
|
## Introduction
|
|
|
|
|
|
|
|
An implementation of [libp2p](https://libp2p.io/) in Nim, as a wrapper of the [Libp2p Go daemon](https://github.com/libp2p/go-libp2p).
|
|
|
|
|
|
|
|
Note that you need Go 1.12+ for the below instructions to work!
|
|
|
|
|
|
|
|
Install dependencies and run tests with:
|
|
|
|
|
|
|
|
```bash
|
2019-08-14 15:41:16 +02:00
|
|
|
git clone https://github.com/status-im/nim-libp2p && cd nim-libp2p
|
2019-08-14 10:56:56 +02:00
|
|
|
nimble install
|
|
|
|
nimble test
|
|
|
|
git submodule update --init --recursive
|
|
|
|
go version
|
|
|
|
git clone https://github.com/libp2p/go-libp2p-daemon
|
|
|
|
cd go-libp2p-daemon
|
|
|
|
git checkout v0.0.1
|
|
|
|
go install ./...
|
|
|
|
cd ..
|
|
|
|
```
|
|
|
|
|
|
|
|
Try out the chat example:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nim c -r --threads:on examples\chat.nim
|
|
|
|
```
|
|
|
|
|
|
|
|
This will output a peer ID such as `QmbmHfVvouKammmQDJck4hz33WvVktNEe7pasxz2HgseRu` which you can use in another instance to connect to it.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
./example/chat
|
|
|
|
/connect QmbmHfVvouKammmQDJck4hz33WvVktNEe7pasxz2HgseRu
|
|
|
|
```
|
|
|
|
|
|
|
|
You can now chat between the instances!
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
## API
|
|
|
|
|
|
|
|
Coming soon...
|
2018-11-19 04:04:47 +02:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
Licensed and distributed under either of
|
|
|
|
|
|
|
|
* MIT license: [LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT
|
2019-01-02 15:05:50 +01:00
|
|
|
|
|
|
|
or
|
|
|
|
|
|
|
|
* Apache License, Version 2.0, ([LICENSE-APACHEv2](LICENSE-APACHEv2) or http://www.apache.org/licenses/LICENSE-2.0)
|
2018-11-19 04:04:47 +02:00
|
|
|
|
|
|
|
at your option. This file may not be copied, modified, or distributed except according to those terms.
|