Skip to content

Commit 2807665

Browse files
authored
docs: update guides to match dev setup guide (#36)
1 parent ac324a9 commit 2807665

5 files changed

Lines changed: 79 additions & 60 deletions

File tree

docs/guides/01-getting-started-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Getting Started with mump2p CLI
22

3-
The `mump2p` CLI is the quickest way to interact with [Optimum Network](https://github.com/getoptimum/optimum-p2p) without running your own infrastructure.
3+
The `mump2p` CLI is the quickest way to interact with Optimum Network without running your own infrastructure.
44

55
In the next 5 minutes, you'll have:
66

docs/guides/02-getting-started-docker.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Choose the deployment mode that best fits your use case:
6262

6363
| Component | Purpose | Docker Images |
6464
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
65-
| **mump2p Node** | RLNC-enabled mesh peer, encodes/decodes message shards, handles peer discovery and subscriptions. Optional gRPC API for direct clients. | `getoptimum/p2pnode:v0.0.1-rc2` |
66-
| **Optimum Proxy** | Bridges clients and the mesh, manages subscriptions, shard reassembly, threshold logic, and node selection. | `getoptimum/proxy:v0.0.1-rc3` |
65+
| **mump2p Node** | RLNC-enabled mesh peer, encodes/decodes message shards, handles peer discovery and subscriptions. Optional gRPC API for direct clients. | `getoptimum/p2pnode:${P2P_NODE_VERSION-latest}` |
66+
| **Optimum Proxy** | Bridges clients and the mesh, manages subscriptions, shard reassembly, threshold logic, and node selection. | `getoptimum/proxy:${PROXY_VERSION-latest}` |
6767

6868

6969

@@ -96,13 +96,21 @@ Before starting, create your `.env` file:
9696
cp .env.example .env
9797
```
9898

99+
**Important:** After copying, you need to replace the `BOOTSTRAP_PEER_ID` in your `.env` file with the peer ID generated by `make generate-identity`.
100+
101+
**Workflow:**
102+
103+
1. Run `make generate-identity` - this creates a unique peer ID
104+
2. Copy the generated peer ID from the output
105+
3. Edit your `.env` file and replace the example `BOOTSTRAP_PEER_ID` with your generated one
106+
99107
Edit with your values:
100108

101109
```bash
102110
BOOTSTRAP_PEER_ID=<your-generated-peer-id>
103111
CLUSTER_ID=my-cluster
104-
PROXY_VERSION=v0.0.1-rc7
105-
P2P_NODE_VERSION=v0.0.1-rc6
112+
PROXY_VERSION=v0.0.1-rc16
113+
P2P_NODE_VERSION=v0.0.1-rc16
106114
```
107115

108116
> **Complete Guide:** [Environment configuration](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md#environment-variables-env)
@@ -117,7 +125,7 @@ make generate-identity
117125

118126
This creates `./identity/p2p.key` with your unique Peer ID.
119127

120-
> **Complete Guide:** [Identity generation and Makefile commands](https://github.com/getoptimum/optimum-dev-setup-guide#quick-start) - all make commands, direct binary usage
128+
> **Complete Guide:** [Identity generation and Makefile commands](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md#getting-started) - all make commands, direct binary usage
121129
122130
## 5. Mode A — OptimumProxy + mump2p (Recommended)
123131

@@ -156,20 +164,20 @@ services:
156164
> **Complete Docker Compose:**
157165
>
158166
> * [Full configuration with 2 proxies + 4 nodes](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docker-compose-optimum.yml)
159-
> * [All environment variables](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md#p2p-node-variables)
167+
> * [All environment variables](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md#environment-variables-env)
160168
161169
### Start the Network
162170
163171
```sh
164172
export BOOTSTRAP_PEER_ID=<your-peer-id>
165-
docker compose up -d
173+
docker-compose -f docker-compose-optimum.yml up --build -d
166174
```
167175

168176
### Verify Health
169177

170178
```sh
171179
# Check containers
172-
docker compose ps
180+
docker-compose -f docker-compose-optimum.yml ps
173181

174182
# Test endpoints
175183
curl http://localhost:8081/api/v1/health # Proxy
@@ -251,12 +259,14 @@ services:
251259
```
252260
253261
> **Complete Docker Compose:** [Full configuration for direct P2P mode](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docker-compose-optimum.yml)
262+
>
263+
> **Note:** The docker-compose file uses environment variables from `.env` for versions. Ensure your `.env` file has `PROXY_VERSION` and `P2P_NODE_VERSION` set.
254264

255265
### Start and Verify
256266

257267
```sh
258268
export BOOTSTRAP_PEER_ID=<your-peer-id>
259-
docker compose up -d
269+
docker-compose -f docker-compose-optimum.yml up --build -d
260270
curl http://localhost:9091/api/v1/health
261271
```
262272

@@ -266,15 +276,15 @@ Connect using the P2P client with trace handling and metrics:
266276

267277
```bash
268278
# Subscribe
269-
./p2p-client -mode=subscribe -topic=testtopic --addr=127.0.0.1:33221
279+
./grpc_p2p_client/p2p-client -mode=subscribe -topic=testtopic --addr=127.0.0.1:33221
270280
271281
# Publish
272-
./p2p-client -mode=publish -topic=testtopic -msg="Hello" --addr=127.0.0.1:33222
282+
./grpc_p2p_client/p2p-client -mode=publish -topic=testtopic -msg="Hello" --addr=127.0.0.1:33222
273283
```
274284

275285
> **Complete Implementation:**
276286
>
277-
> * [P2P Client Source](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/grpc_p2p_client/p2p_client.go)
287+
> * [P2P Client Source](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/grpc_p2p_client/cmd/single/main.go)
278288
> * [Usage Guide with Makefile commands](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md#using-p2p-nodes-directly-optional--no-proxy)
279289
> * [Message format explanation](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md#understanding-message-output-format)
280290

@@ -284,16 +294,16 @@ For all configuration variables, see the [Parameters Section](./03-parameters.md
284294

285295
### "Connection refused" from client
286296

287-
* Ensure youre pointing to the host-mapped ports (e.g., 33221, 8081).
288-
* Run docker compose ps and confirm port bindings.
297+
* Ensure you're pointing to the host-mapped ports (e.g., 33221, 8081).
298+
* Run `docker-compose -f docker-compose-optimum.yml ps` and confirm port bindings.
289299
* Firewalls: allow inbound localhost traffic.
290300

291301
### Proxy can’t reach nodes
292302

293303
* Inside the proxy container, resolve and ping node hosts:
294304

295305
```sh
296-
docker compose exec proxy sh -lc 'nc -zv p2pnode-1 33212'
306+
docker-compose -f docker-compose-optimum.yml exec proxy-1 sh -lc 'nc -zv p2pnode-1 33212'
297307
```
298308

299309
* Make sure `P2P_NODES` hostnames match the `service names` in compose.
@@ -311,11 +321,11 @@ docker compose exec proxy sh -lc 'nc -zv p2pnode-1 33212'
311321
Stop:
312322

313323
```sh
314-
docker compose down
324+
docker-compose -f docker-compose-optimum.yml down
315325
```
316326

317327
Full reset (containers, volumes, images created by this compose file):
318328

319329
```sh
320-
docker compose down -v --rmi local
330+
docker-compose -f docker-compose-optimum.yml down -v --rmi local
321331
```

docs/guides/03-parameters.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,17 @@ Example Docker service:
111111
proxy-1:
112112
image: 'getoptimum/proxy:${PROXY_VERSION-latest}'
113113
environment:
114-
- PROXY_HTTP_PORT=:8080
114+
- PROXY_PORT=:8080
115115
- PROXY_GRPC_PORT=:50051
116-
- CLUSTER_ID=proxy-1
116+
- CLUSTER_ID=${CLUSTER_ID}
117117
- ENABLE_AUTH=false
118118
- LOG_LEVEL=debug
119119
- P2P_NODES=p2pnode-1:33212,p2pnode-2:33212
120120
```
121121

122122
| Parameter | Default | Purpose |
123123
| --------------------------------- | ------- | ---------------------------------------------------------- |
124-
| `PROXY_HTTP_PORT` | :8080 | HTTP API port for clients. |
124+
| `PROXY_PORT` | :8080 | HTTP API port for clients. |
125125
| `PROXY_GRPC_PORT` | :50051 | gRPC API port for clients. |
126126
| `ENABLE_AUTH` | false | Enable Auth0 authentication. |
127127
| `AUTH0_DOMAIN` / `AUTH0_AUDIENCE` | (none) | Auth0 settings (required if `ENABLE_AUTH`=true). |
@@ -139,16 +139,15 @@ The following table shows the **production defaults**, which are optimized for t
139139
```yaml
140140
environment:
141141
- NODE_MODE=optimum
142-
- LOG_LEVEL=production
142+
- LOG_LEVEL=debug
143143
- CLUSTER_ID=my-cluster
144144
- SIDECAR_PORT=33212
145-
- API_PORT=8081
145+
- API_PORT=9090
146146
- IDENTITY_DIR=/identity
147147
- OPTIMUM_PORT=7070
148148
- OPTIMUM_MAX_MSG_SIZE=1048576
149-
- OPTIMUM_RANDOM_MSG_SIZE=512
150149
- OPTIMUM_MESH_TARGET=6
151-
- OPTIMUM_MESH_MIN=4
150+
- OPTIMUM_MESH_MIN=3
152151
- OPTIMUM_MESH_MAX=12
153152
- OPTIMUM_SHARD_FACTOR=4
154153
- OPTIMUM_SHARD_MULT=1.5
@@ -161,10 +160,10 @@ environment:
161160
```yaml
162161
environment:
163162
- NODE_MODE=gossipsub
164-
- LOG_LEVEL=production
163+
- LOG_LEVEL=debug
165164
- CLUSTER_ID=my-cluster
166165
- SIDECAR_PORT=33212
167-
- API_PORT=8081
166+
- API_PORT=9090
168167
- IDENTITY_DIR=/identity
169168
- GOSSIPSUB_PORT=6060
170169
- GOSSIPSUB_MAX_MSG_SIZE=1048576
@@ -178,17 +177,16 @@ environment:
178177

179178
| Parameter | Default Value | Used In Mode | Description |
180179
| ---------------------------- | ------------- | ------------ | ---------------------------------------------- |
181-
| `LOG_LEVEL` | production | Both | Log verbosity (production/debug/info/warn/error) |
180+
| `LOG_LEVEL` | debug | Both | Log verbosity (debug/info/warn/error) |
182181
| `CLUSTER_ID` | "" | Both | Logical group name for metrics |
183182
| `NODE_MODE` | "" | Both | Protocol mode (optimum/gossipsub) |
184183
| `SIDECAR_PORT` | 33212 | Both | gRPC sidecar port |
185-
| `API_PORT` | 8081 | Both | HTTP API port |
186-
| `IDENTITY_DIR` | /tmp | Both | Directory for node private key |
184+
| `API_PORT` | 9090 | Both | HTTP API port |
185+
| `IDENTITY_DIR` | /identity | Both | Directory for node private key |
187186
| `OPTIMUM_PORT` | 7070 | optimum | TCP port for RLNC gossip |
188187
| `OPTIMUM_MAX_MSG_SIZE` | 1048576 | optimum | Max message size (1MB) |
189-
| `OPTIMUM_RANDOM_MSG_SIZE` | 512 | optimum | Random message size for testing |
190188
| `OPTIMUM_MESH_TARGET` | 6 | optimum | Desired peers in mesh |
191-
| `OPTIMUM_MESH_MIN` | 4 | optimum | Minimum peers before adding more |
189+
| `OPTIMUM_MESH_MIN` | 3 | optimum | Minimum peers before adding more |
192190
| `OPTIMUM_MESH_MAX` | 12 | optimum | Max peers before pruning |
193191
| `OPTIMUM_SHARD_FACTOR` | 4 | optimum | Number of shards per message |
194192
| `OPTIMUM_SHARD_MULT` | 1.5 | optimum | Redundancy multiplier (extra shards) |
@@ -198,7 +196,7 @@ environment:
198196
| `GOSSIPSUB_MESH_TARGET` | 6 | gossipsub | Desired peers in mesh |
199197
| `GOSSIPSUB_MESH_MIN` | 4 | gossipsub | Minimum peers before adding more |
200198
| `GOSSIPSUB_MESH_MAX` | 12 | gossipsub | Max peers before pruning |
201-
| `BOOTSTRAP_PEERS` | [] | Both | List of peer multiaddrs for bootstrap |
199+
| `BOOTSTRAP_PEERS` | (none) | Both | List of peer multiaddrs for bootstrap |
202200

203201
> **Note:** These are the production defaults used by mump2p nodes. For experimental tuning, see [Common Experiments](./04-experiments.md).
204202

docs/guides/04-experiments.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Each experiment below lists the **goal**, a quick **how-to**, and **what to obse
1313
You can run them using:
1414

1515
* **mump2p CLI** (see [CLI Guide](./01-getting-started-cli.md))
16-
* **gRPC client** (with `MessageTraceGossipSub` or `MessageTraceOptimump2p` for protocol metrics)
16+
* **gRPC P2P client** (trace collection is automatic when subscribing - see [Trace Collection](#metrics-collection))
1717

1818

1919

@@ -112,33 +112,35 @@ You can run them using:
112112
**Expected Result:** mump2p should handle higher stress levels before failing compared to GossipSub.
113113

114114

115-
> **Tip:** Enable protocol traces in the gRPC client to get hop-by-hop delivery info:
116-
>
117-
> * `MessageTraceGossipSub` for GossipSub mode.
118-
> * `MessageTraceOptimump2p` for mump2p mode.
115+
> **Tip:** Trace collection is automatic when using the gRPC P2P client. Simply subscribe to a topic and trace events will be automatically parsed and displayed. See [Trace Collection](#metrics-collection) for details.
119116
120117
## Metrics Collection
121118

122119
For comprehensive metrics collection during experiments, use the gRPC P2P client with trace handling:
123120

124121
**[P2P Client with Metrics Collection](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md#collecting-trace-data-for-experiments)**
125122

126-
**[Complete Code](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/grpc_p2p_client/p2p_client.go)**
123+
**[Complete Code](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/grpc_p2p_client/cmd/single/main.go)**
127124

128-
The client automatically captures and displays:
125+
The client automatically captures and displays trace events when you subscribe:
129126

130127
* **GossipSub traces**: Peer routing, message delivery status, hop counts, latency
131128
* **mump2p traces**: Shard encoding/decoding, reconstruction efficiency, redundancy metrics
132129
* **Message-level data**: Delivery success rates, end-to-end latency, bandwidth usage
133130

134-
**Key trace handlers:**
131+
**Usage:**
132+
133+
```bash
134+
# Subscribe to a topic - trace events are automatically collected and displayed
135+
./grpc_p2p_client/p2p-client -mode=subscribe -topic=your-topic --addr=127.0.0.1:33221
136+
```
137+
138+
Trace parsing is implemented in `grpc_p2p_client/shared/utils.go` and handles both `ResponseType_MessageTraceGossipSub` and `ResponseType_MessageTraceMumP2P` automatically.
135139

136-
```go
137-
case protobuf.ResponseType_MessageTraceGossipSub:
138-
fmt.Printf("[TRACE] GossipSub trace received: %s\n", string(resp.GetData()))
140+
For multi-node experiments with trace data collection, use the multi-subscribe client:
139141

140-
case protobuf.ResponseType_MessageTraceOptimump2p:
141-
fmt.Printf("[TRACE] mump2p trace received: %s\n", string(resp.GetData()))
142+
```bash
143+
./grpc_p2p_client/p2p-multi-subscribe -topic=test-topic -ipfile=ips.txt -output-data=data.tsv -output-trace=trace.tsv
142144
```
143145

144-
Use this client instead of the CLI for detailed performance analysis during experiments.
146+
See the [dev setup guide](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md#multi-node-client-tools) for more details on multi-node client tools.

docs/guides/05-faq-glossary.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,28 @@ It includes detailed troubleshooting for:
2020

2121
### Q: `docker run ... generate-key` command doesn't work
2222

23-
**A:** Use the identity generation script instead:
23+
**A:** Use the identity generation script or Makefile command:
2424

2525
```bash
26-
curl -sSL https://raw.githubusercontent.com/getoptimum/optimum-dev-setup-guide/main/script/generate-identity.sh | bash
26+
# Using Makefile (recommended)
27+
make generate-identity
28+
29+
# Or using the script directly
30+
./script/generate-identity.sh
2731
```
2832

29-
This generates `p2p.key` and exports `BOOTSTRAP_PEER_ID` automatically.
33+
This generates `./identity/p2p.key` and displays the `BOOTSTRAP_PEER_ID` that you need to add to your `.env` file.
3034

3135
### Container Startup Issues
3236

3337
### Q: Containers fail to start or can't connect to each other
3438

3539
**A:** Common fixes:
3640

37-
1. **Check Docker images**: Use correct versions (`getoptimum/proxy:v0.0.1-rc3`, `getoptimum/p2pnode:v0.0.1-rc2`)
41+
1. **Check Docker images**: Use correct versions from your `.env` file (`PROXY_VERSION=v0.0.1-rc16`, `P2P_NODE_VERSION=v0.0.1-rc16` by default)
3842
2. **Network conflicts**: Change subnet in docker-compose if `172.28.0.0/16` conflicts
39-
3. **Port conflicts**: Ensure ports 8080, 8081, 33221, 9091, 7071 are available
40-
4. **Platform issues**: Add `platform: linux/amd64` for M1 Macs
43+
3. **Port conflicts**: Ensure ports 8081, 8082, 50051, 50052, 33221-33224, 9091-9094, 7071-7074 are available
44+
4. **Platform issues**: Add `platform: linux/amd64` for M1 Macs (already included in docker-compose-optimum.yml)
4145

4246
### Q: "Connection refused" when clients try to connect
4347

@@ -60,14 +64,16 @@ This generates `p2p.key` and exports `BOOTSTRAP_PEER_ID` automatically.
6064
3. **Use latest client examples**: Reference [`optimum-dev-setup-guide/docs/guide.md#grpc-proxy-client-implementation`](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md#grpc-proxy-client-implementation)
6165

6266
**[Complete Code](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/grpc_proxy_client/proxy_client.go)**
67+
68+
For P2P direct client, see [`grpc_p2p_client/cmd/single/main.go`](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/grpc_p2p_client/cmd/single/main.go)
6369

6470
### Q: Getting "method not found" or protobuf errors
6571

6672
**A:** Use the correct protobuf definitions from [`optimum-dev-setup-guide/docs/guide.md`](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md#api-reference):
6773

6874
* See the [API Reference section](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md#api-reference) for complete protobuf definitions
6975
* All proto files are available in the repository's `grpc_*_client/proto/` directories:
70-
* [`grpc_proxy_client/proto/gateway_stream.proto`](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/grpc_proxy_client/proto/gateway_stream.proto)
76+
* [`grpc_proxy_client/proto/proxy_stream.proto`](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/grpc_proxy_client/proto/proxy_stream.proto)
7177
* [`grpc_p2p_client/proto/p2p_stream.proto`](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/grpc_p2p_client/proto/p2p_stream.proto)
7278

7379

@@ -97,14 +103,17 @@ This generates `p2p.key` and exports `BOOTSTRAP_PEER_ID` automatically.
97103

98104
When something doesn't work:
99105

100-
1. **Check container logs**: `docker logs <container-name>`
101-
2. **Verify network connectivity**: `docker network ls` and `docker network inspect`
102-
3. **Test basic connectivity**: `curl http://localhost:8080/health`
103-
4. **Check authentication**: `mump2p whoami`
104-
5. **Verify versions**: Use latest CLI and Docker images
106+
1. **Check container logs**: `docker-compose -f docker-compose-optimum.yml logs <service-name>` or `docker logs <container-name>`
107+
2. **Verify network connectivity**: `docker network ls` and `docker network inspect optimum-dev-setup-guide_optimum-network`
108+
3. **Test basic connectivity**:
109+
* Proxy: `curl http://localhost:8081/api/v1/health`
110+
* P2P Node: `curl http://localhost:9091/api/v1/health`
111+
4. **Check authentication**: `mump2p whoami` (if using CLI)
112+
5. **Verify versions**: Check your `.env` file for `PROXY_VERSION` and `P2P_NODE_VERSION` (default: v0.0.1-rc16)
113+
6. **Check service status**: `docker-compose -f docker-compose-optimum.yml ps`
105114

106115
### Getting Help
107116

108117
* **CLI Issues**: [mump2p-cli FAQ](https://github.com/getoptimum/mump2p-cli#faq---common-issues--troubleshooting)
109118
* **Setup Issues**: Check [`optimum-dev-setup-guide/docs/guide.md`](https://github.com/getoptimum/optimum-dev-setup-guide/blob/main/docs/guide.md)
110-
* **Protocol Questions**: See [mump2p Documentation](./p2p.md)
119+
* **Protocol Questions**: See [mump2p Documentation](../learn/overview/p2p.md)

0 commit comments

Comments
 (0)