Skip to content

Commit aa4ebb0

Browse files
docs(general): Improve docs (#1021)
1 parent e0f70b7 commit aa4ebb0

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- [Background](#background)
2121
- [Install](#install)
2222
- [Getting Started](#getting-started)
23+
- [Go-libp2p-daemon](#go-libp2p-daemon)
2324
- [Modules](#modules)
2425
- [Users](#users)
2526
- [Stability](#stability)
@@ -40,18 +41,20 @@ Learn more about libp2p at [**libp2p.io**](https://libp2p.io) and follow libp2p'
4041
## Install
4142
**Prerequisite**
4243
- [Nim](https://nim-lang.org/install.html)
44+
> The currently supported Nim version is 1.6.18.
45+
4346
```
4447
nimble install libp2p
4548
```
4649

4750
## Getting Started
4851
You'll find the nim-libp2p documentation [here](https://status-im.github.io/nim-libp2p/docs/).
4952

50-
**Go Daemon:**
51-
Please find the installation and usage intructions in [daemonapi.md](examples/go-daemon/daemonapi.md).
53+
### Testing
54+
Remember you'll need to build the `go-libp2p-daemon` binary to run the `nim-libp2p` tests.
55+
To do so, please follow the installation instructions in [daemonapi.md](examples/go-daemon/daemonapi.md).
5256

5357
## Modules
54-
5558
List of packages modules implemented in nim-libp2p:
5659

5760
| Name | Description |

examples/go-daemon/daemonapi.md

+21-16
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
11
# Table of Contents
22
- [Introduction](#introduction)
3+
- [Prerequisites](#prerequisites)
34
- [Installation](#installation)
5+
- [Script](#script)
46
- [Usage](#usage)
57
- [Example](#example)
68
- [Getting Started](#getting-started)
79

810
# Introduction
911
This is a libp2p-backed daemon wrapping the functionalities of go-libp2p for use in Nim. <br>
1012
For more information about the go daemon, check out [this repository](https://github.com/libp2p/go-libp2p-daemon).
13+
> **Required only** for running the tests.
14+
15+
# Prerequisites
16+
Go with version `1.15.15`.
17+
> You will *likely* be able to build `go-libp2p-daemon` with different Go versions, but **they haven't been tested**.
1118
1219
# Installation
20+
Follow one of the methods below:
21+
22+
## Script
23+
Run the build script while having the `go` command pointing to the correct Go version.
24+
We recommend using `1.15.15`, as previously stated.
25+
```sh
26+
./scripts/build_p2pd.sh
27+
```
28+
If everything goes correctly, the binary (`p2pd`) should be built and placed in the correct directory.
29+
If you find any issues, please head into our discord and ask for our asistance.
30+
31+
After successfully building the binary, remember to add it to your path so it can be found. You can do that by running:
1332
```sh
14-
# clone and install dependencies
15-
git clone https://github.com/status-im/nim-libp2p
16-
cd nim-libp2p
17-
nimble install
18-
19-
# perform unit tests
20-
nimble test
21-
22-
# update the git submodule to install the go daemon
23-
git submodule update --init --recursive
24-
go version
25-
git clone https://github.com/libp2p/go-libp2p-daemon
26-
cd go-libp2p-daemon
27-
git checkout v0.0.1
28-
go install ./...
29-
cd ..
33+
export PATH="$PATH:$HOME/go/bin"
3034
```
35+
> **Tip:** To make this change permanent, add the command above to your `.bashrc` file.
3136
3237
# Usage
3338

scripts/build_p2pd.sh

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ build_target() {
8989
mkdir "$CACHE_DIR"
9090
cp -a "$TARGET_DIR"/* "$CACHE_DIR"/
9191
fi
92+
echo "Binary built successfully."
9293
}
9394

9495
if target_needs_rebuilding; then

0 commit comments

Comments
 (0)