mirror of https://github.com/vacp2p/nim-libp2p.git
docs(general): Improve docs (#1021)
This commit is contained in:
parent
e0f70b7177
commit
aa4ebb0b3c
|
@ -20,6 +20,7 @@
|
||||||
- [Background](#background)
|
- [Background](#background)
|
||||||
- [Install](#install)
|
- [Install](#install)
|
||||||
- [Getting Started](#getting-started)
|
- [Getting Started](#getting-started)
|
||||||
|
- [Go-libp2p-daemon](#go-libp2p-daemon)
|
||||||
- [Modules](#modules)
|
- [Modules](#modules)
|
||||||
- [Users](#users)
|
- [Users](#users)
|
||||||
- [Stability](#stability)
|
- [Stability](#stability)
|
||||||
|
@ -40,6 +41,8 @@ Learn more about libp2p at [**libp2p.io**](https://libp2p.io) and follow libp2p'
|
||||||
## Install
|
## Install
|
||||||
**Prerequisite**
|
**Prerequisite**
|
||||||
- [Nim](https://nim-lang.org/install.html)
|
- [Nim](https://nim-lang.org/install.html)
|
||||||
|
> The currently supported Nim version is 1.6.18.
|
||||||
|
|
||||||
```
|
```
|
||||||
nimble install libp2p
|
nimble install libp2p
|
||||||
```
|
```
|
||||||
|
@ -47,11 +50,11 @@ nimble install libp2p
|
||||||
## Getting Started
|
## Getting Started
|
||||||
You'll find the nim-libp2p documentation [here](https://status-im.github.io/nim-libp2p/docs/).
|
You'll find the nim-libp2p documentation [here](https://status-im.github.io/nim-libp2p/docs/).
|
||||||
|
|
||||||
**Go Daemon:**
|
### Testing
|
||||||
Please find the installation and usage intructions in [daemonapi.md](examples/go-daemon/daemonapi.md).
|
Remember you'll need to build the `go-libp2p-daemon` binary to run the `nim-libp2p` tests.
|
||||||
|
To do so, please follow the installation instructions in [daemonapi.md](examples/go-daemon/daemonapi.md).
|
||||||
|
|
||||||
## Modules
|
## Modules
|
||||||
|
|
||||||
List of packages modules implemented in nim-libp2p:
|
List of packages modules implemented in nim-libp2p:
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# Table of Contents
|
# Table of Contents
|
||||||
- [Introduction](#introduction)
|
- [Introduction](#introduction)
|
||||||
|
- [Prerequisites](#prerequisites)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
|
- [Script](#script)
|
||||||
- [Usage](#usage)
|
- [Usage](#usage)
|
||||||
- [Example](#example)
|
- [Example](#example)
|
||||||
- [Getting Started](#getting-started)
|
- [Getting Started](#getting-started)
|
||||||
|
@ -8,26 +10,29 @@
|
||||||
# Introduction
|
# Introduction
|
||||||
This is a libp2p-backed daemon wrapping the functionalities of go-libp2p for use in Nim. <br>
|
This is a libp2p-backed daemon wrapping the functionalities of go-libp2p for use in Nim. <br>
|
||||||
For more information about the go daemon, check out [this repository](https://github.com/libp2p/go-libp2p-daemon).
|
For more information about the go daemon, check out [this repository](https://github.com/libp2p/go-libp2p-daemon).
|
||||||
|
> **Required only** for running the tests.
|
||||||
|
|
||||||
|
# Prerequisites
|
||||||
|
Go with version `1.15.15`.
|
||||||
|
> You will *likely* be able to build `go-libp2p-daemon` with different Go versions, but **they haven't been tested**.
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
Follow one of the methods below:
|
||||||
|
|
||||||
|
## Script
|
||||||
|
Run the build script while having the `go` command pointing to the correct Go version.
|
||||||
|
We recommend using `1.15.15`, as previously stated.
|
||||||
```sh
|
```sh
|
||||||
# clone and install dependencies
|
./scripts/build_p2pd.sh
|
||||||
git clone https://github.com/status-im/nim-libp2p
|
|
||||||
cd nim-libp2p
|
|
||||||
nimble install
|
|
||||||
|
|
||||||
# perform unit tests
|
|
||||||
nimble test
|
|
||||||
|
|
||||||
# update the git submodule to install the go daemon
|
|
||||||
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 ..
|
|
||||||
```
|
```
|
||||||
|
If everything goes correctly, the binary (`p2pd`) should be built and placed in the correct directory.
|
||||||
|
If you find any issues, please head into our discord and ask for our asistance.
|
||||||
|
|
||||||
|
After successfully building the binary, remember to add it to your path so it can be found. You can do that by running:
|
||||||
|
```sh
|
||||||
|
export PATH="$PATH:$HOME/go/bin"
|
||||||
|
```
|
||||||
|
> **Tip:** To make this change permanent, add the command above to your `.bashrc` file.
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ build_target() {
|
||||||
mkdir "$CACHE_DIR"
|
mkdir "$CACHE_DIR"
|
||||||
cp -a "$TARGET_DIR"/* "$CACHE_DIR"/
|
cp -a "$TARGET_DIR"/* "$CACHE_DIR"/
|
||||||
fi
|
fi
|
||||||
|
echo "Binary built successfully."
|
||||||
}
|
}
|
||||||
|
|
||||||
if target_needs_rebuilding; then
|
if target_needs_rebuilding; then
|
||||||
|
|
Loading…
Reference in New Issue