Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smolgroot/go-libp2p-boilerplate
Go libp2p node boilerplate
https://github.com/smolgroot/go-libp2p-boilerplate
Last synced: about 1 month ago
JSON representation
Go libp2p node boilerplate
- Host: GitHub
- URL: https://github.com/smolgroot/go-libp2p-boilerplate
- Owner: smolgroot
- Created: 2023-08-08T06:28:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-08T06:30:46.000Z (over 1 year ago)
- Last Synced: 2024-06-21T17:01:29.525Z (6 months ago)
- Language: Go
- Size: 30.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Run a Ping go-libp2p node
Tutorial can be found here in the libp2p documentation:
https://docs.libp2p.io/guides/getting-started/go/
## Build
```
go build -o libp2p-ping-node
```## Usage
Run a first node
```bash
./libp2p-ping-node# libp2p node address: /ip4/127.0.0.1/tcp/36881/p2p/12D3KooWKvgdrVAKBGFgax2APfFrCjfRSZvREfXD1sxT6nJ61QDa
```And run another one, requesting to ping it.
```bash
./libp2p-ping-node /ip4/127.0.0.1/tcp/36881/p2p/12D3KooWKvgdrVAKBGFgax2APfFrCjfRSZvREfXD1sxT6nJ61QDa# libp2p node address: /ip4/127.0.0.1/tcp/36627/p2p/12D3KooWA2wxB2aPMcSAwCio1JmKRd9XRHRywtwyy1juDUQGkxLm
# sending 5 ping messages to /ip4/127.0.0.1/tcp/36881/p2p/12D3KooWKvgdrVAKBGFgax2APfFrCjfRSZvREfXD1sxT6nJ61QDa
# pinged /ip4/127.0.0.1/tcp/36881/p2p/12D3KooWKvgdrVAKBGFgax2APfFrCjfRSZvREfXD1sxT6nJ61QDa in 1.016553ms
# pinged /ip4/127.0.0.1/tcp/36881/p2p/12D3KooWKvgdrVAKBGFgax2APfFrCjfRSZvREfXD1sxT6nJ61QDa in 1.099507ms
# pinged /ip4/127.0.0.1/tcp/36881/p2p/12D3KooWKvgdrVAKBGFgax2APfFrCjfRSZvREfXD1sxT6nJ61QDa in 657.763µs
# pinged /ip4/127.0.0.1/tcp/36881/p2p/12D3KooWKvgdrVAKBGFgax2APfFrCjfRSZvREfXD1sxT6nJ61QDa in 371.321µs
# pinged /ip4/127.0.0.1/tcp/36881/p2p/12D3KooWKvgdrVAKBGFgax2APfFrCjfRSZvREfXD1sxT6nJ61QDa in 2.291167ms
```