Skip to content

Commit 1fade05

Browse files
committed
update README and justfile
1 parent fa67370 commit 1fade05

File tree

2 files changed

+38
-35
lines changed

2 files changed

+38
-35
lines changed

examples/README.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
11
# How to Run
22

3+
## Using `just`
4+
5+
### Run prerequisites
6+
7+
It's only needed once after checkout or when dependencies change:
8+
- `just build`
9+
- `just npm-install`
10+
11+
### Run full workflow example
12+
- `just authorize-and-store papi` - for PAPI,
13+
- `just authorize-and-store pjs` - for PJS.
14+
15+
#### Run individual commands for manual testing
16+
- `just ipfs-init` - Initialize IPFS (if needed),
17+
- `just ipfs-start` - Start IPFS daemon,
18+
- `just ipfs-connect` - Connect to IPFS nodes,
19+
- `just bulletin-zombienet-start` - Start zombienet,
20+
- `just ipfs-reconnect-start` - Start IPFS reconnect script,
21+
- `just papi-generate` - Generate PAPI descriptors,
22+
- `just run-example papi` - Run example with PAPI or PJS,
23+
- `just stop-services` - Stop all services
24+
25+
## Manually
26+
327

428
```shell
529
cd polkadot-bulletin-chain # make you are inside the project directory for the following steps
630
```
731

8-
## Download Zombienet
32+
### Download Zombienet
933

1034
```shell
1135
OS="$(uname -s)"
@@ -29,7 +53,7 @@ wget "https://github.com/paritytech/zombienet/releases/download/v1.3.133/${zb_bi
2953
chmod +x "${zb_bin}"
3054
```
3155

32-
## Run Kubo
56+
### Run Kubo
3357

3458
#### Execute Locally
3559

@@ -51,7 +75,7 @@ docker run -d --name ipfs-node -v ipfs-data:/data/ipfs -p 4001:4001 -p 8080:8080
5175
docker logs -f ipfs-node
5276
```
5377

54-
## Run Bulletin Solochain with `--ipfs-server`
78+
### Run Bulletin Solochain with `--ipfs-server`
5579

5680
```shell
5781
# Bulletin Solochain
@@ -63,7 +87,7 @@ cargo build --release -p polkadot-bulletin-chain
6387
POLKADOT_BULLETIN_BINARY_PATH=./target/release/polkadot-bulletin-chain \
6488
./$(ls zombienet-*-*) -p native spawn ./zombienet/bulletin-polkadot-local.toml
6589
66-
### Connect IPFS Nodes
90+
#### Connect IPFS Nodes
6791
6892
```shell
6993
# Uses Kubo
@@ -86,9 +110,9 @@ docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/12347/ws/p2p/12
86110
./scripts/ipfs-reconnect-solo.sh
87111
```
88112

89-
## Run Bulletin (Westend) Parachain with `--ipfs-server`
113+
### Run Bulletin (Westend) Parachain with `--ipfs-server`
90114

91-
### Prerequisites
115+
#### Prerequisites
92116

93117
```shell
94118
mkdir -p ~/local_bridge_testing/bin
@@ -114,7 +138,7 @@ cp target/release/polkadot-parachain ~/local_bridge_testing/bin
114138
# polkadot-parachain 1.20.2-165ba47dc91 or higher
115139
```
116140

117-
### Launch Parachain
141+
#### Launch Parachain
118142

119143
```shell
120144
# Bulletin Parachain (Westend)
@@ -124,7 +148,7 @@ POLKADOT_BINARY_PATH=~/local_bridge_testing/bin/polkadot \
124148
./$(ls zombienet-*-*) -p native spawn ./zombienet/bulletin-westend-local.toml
125149
```
126150

127-
### Connect IPFS Nodes
151+
#### Connect IPFS Nodes
128152

129153
```shell
130154
# Uses Kubo
@@ -147,19 +171,19 @@ docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/12347/ws/p2p/12
147171
./scripts/ipfs-reconnect-westend.sh
148172
```
149173

150-
## Trigger Authorize, Store and IPFS Get
174+
### Trigger Authorize, Store and IPFS Get
151175

152-
### Example for Simple Authorizing and Store
176+
#### Example for Simple Authorizing and Store
153177

154-
#### Using Legacy @polkadot/api (PJS)
178+
##### Using Legacy @polkadot/api (PJS)
155179
```
156180
cd examples
157181
npm install
158182
159183
node authorize_and_store.js
160184
```
161185

162-
#### Using Modern PAPI (Polkadot API)
186+
##### Using Modern PAPI (Polkadot API)
163187
```bash
164188
cd examples
165189
npm install
@@ -175,7 +199,7 @@ npm run papi:update
175199
node authorize_and_store_papi.js
176200
```
177201

178-
### Example for Multipart / Chunked Content / Big Files
202+
#### Example for Multipart / Chunked Content / Big Files
179203

180204
The code stores one file, splits it into chunks, and then uploads those chunks to Bulletin.
181205

examples/justfile

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,6 @@
11
# Polkadot Bulletin Chain - Just Commands
2-
# Install just: brew install just
3-
# Run `just --list` to see all available commands
42
#
5-
# Usage:
6-
# 1. Run prerequisites (only needed once after checkout or when deps change):
7-
# just build
8-
# just npm-install
9-
#
10-
# 2. Run full workflow example (this builds the chain and installs npm deps if not yet done):
11-
# just authorize-and-store papi
12-
# just authorize-and-store pjs
13-
#
14-
# 3. Run individual commands for manual testing:
15-
# just ipfs-init # Initialize IPFS (if needed)
16-
# just ipfs-start # Start IPFS daemon
17-
# just ipfs-connect # Connect to IPFS nodes
18-
# just bulletin-zombienet-start # Start zombienet
19-
# just ipfs-reconnect-start # Start IPFS reconnect script
20-
# just papi-generate # Generate PAPI descriptors
21-
# just run-example papi # Run example with PAPI or PJS
22-
# just stop-services # Stop all services
23-
#
24-
# (Use 'papi' for Polkadot API or 'pjs' for Polkadot JS)
3+
# See README.md for usage instructions.
254

265
# PID file locations
276
PID_DIR := "/tmp/bulletin-pids"

0 commit comments

Comments
 (0)