Skip to content

Commit 34636d6

Browse files
committed
feat: update readme
1 parent 1d61881 commit 34636d6

1 file changed

Lines changed: 94 additions & 0 deletions

File tree

ipc-storage/README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,99 @@
11
# Bucket Storage Guide (Path-Based Access)
22

3+
## Quickstart (Subnet + Storage)
4+
5+
This section is the shortest end-to-end setup for local testing with `ipc-cli`.
6+
7+
### 0) Build the right binaries
8+
9+
`ipc-storage` actors are only present when `ipc-storage` feature is enabled.
10+
11+
```bash
12+
# IPC CLI + node stack (must include ipc-storage feature)
13+
cargo build --release -p ipc-cli --features ipc-storage
14+
15+
# Storage node/gateway binaries
16+
cargo build --release -p ipc-decentralized-storage --bin node --bin gateway
17+
```
18+
19+
### 1) Create subnet from YAML
20+
21+
Use your subnet config (for example `init-sub.yaml`):
22+
23+
Before running `subnet init`, make sure YAML placeholders are replaced:
24+
- `import-wallets[].private-key` (or `path`) for the account you control
25+
- `create.from` and `create.genesis-subnet-ipc-contracts-owner`
26+
- `activate.validator-pubkeys` with your validator public key(s)
27+
28+
If the generated `~/.ipc/node_<SUBNET_ID>.yaml` contains a validator key placeholder, fill `validator.private-key` before `node init`.
29+
The validator private key in `node_<SUBNET_ID>.yaml` must correspond to one of the pubkeys in `activate.validator-pubkeys`; otherwise `node start` runs but that validator identity is not the one activated on-chain.
30+
31+
Quick check:
32+
33+
```bash
34+
# Derive uncompressed pubkey from the validator private key you put in node_<SUBNET_ID>.yaml
35+
cast wallet public-key --private-key <VALIDATOR_PRIVATE_KEY_HEX>
36+
37+
# Ensure this exactly matches an entry in activate.validator-pubkeys from subnet-init YAML.
38+
```
39+
40+
```bash
41+
./target/release/ipc-cli subnet init --config /absolute/path/to/init-sub.yaml
42+
```
43+
44+
This generates `node_<SUBNET_ID>.yaml` in `~/.ipc/`.
45+
46+
### 2) Initialize and start the validator node
47+
48+
```bash
49+
# Use the generated node config path from previous step:
50+
./target/release/ipc-cli node init --config ~/.ipc/node_<SUBNET_ID>.yaml
51+
52+
# Start your local subnet node
53+
./target/release/ipc-cli node start --home ~/.node-ipc
54+
```
55+
56+
### 3) Initialize storage config (creates dedicated operator key)
57+
58+
```bash
59+
./target/release/ipc-cli storage init \
60+
--node-config ~/.ipc/node_<SUBNET_ID>.yaml
61+
```
62+
63+
This prints:
64+
- `operator secret key file` (defaults to `~/.node-ipc/storage/operator.sk`)
65+
- delegated operator address `t410...` (**fund this one**)
66+
- native address `t1...` (diagnostic only)
67+
68+
### 4) Fund the delegated operator address
69+
70+
Use the `t410...` printed by `storage init`:
71+
72+
```bash
73+
./target/release/ipc-cli cross-msg fund \
74+
--subnet "<SUBNET_ID>" \
75+
--from <PARENT_FUNDING_ADDRESS> \
76+
--to <OPERATOR_T410_ADDRESS> \
77+
1
78+
```
79+
80+
### 5) Register operator and run storage
81+
82+
```bash
83+
./target/release/ipc-cli storage run \
84+
--config ~/.ipc/storage_<SUBNET_ID>.yaml \
85+
--register-operator
86+
```
87+
88+
Expected healthy logs:
89+
- `Successfully registered as node operator`
90+
- node/gateway started
91+
- gateway uses delegated sender (`t410...`)
92+
93+
### 6) Important note about object uploads
94+
95+
`POST /v1/objects` uploads bytes to Iroh, but on-chain object registration is a separate step (for example `addObject(...)` via `cast`/dropbox). If registration is skipped, gateway can keep showing `Found 0 added blobs`.
96+
397
## Configuration
498

599
```bash

0 commit comments

Comments
 (0)