@@ -172,6 +172,13 @@ cat > peers.json <<EOF
172172EOF
173173```
174174
175+ The ` blockchain-module-testnet ` directory is a setup workspace for the peer file
176+ and related blockchain commands.
177+ If an existing node was created with the older ` blockchain-module-devnet `
178+ directory name, do not rename a running node just to match this guide.
179+ Keep the existing path or update all local scripts and services consistently
180+ during a planned reprovision.
181+
175182Load the module and generate ` user_config.yaml ` :
176183
177184``` sh
@@ -213,6 +220,91 @@ Operator-facing fields in `user_config.yaml`:
213220| ` state.base_folder ` | State directory | Use a persistent local path |
214221| logger filters | Log verbosity | Use ` INFO ` for unattended operation |
215222
223+
224+ ### Joining Blend Network
225+
226+ Request funds to both the BlendZk and SdpFunding keys from your ` keystore.yaml ` from the [ faucet] ( https://testnet.blockchain.logos.co/web/faucet/ )
227+ ``` bash
228+ # keystore.yaml
229+ public_keys:
230+ ...
231+ BlendZk: 13cccf99f90fd78c2134891ce3c1afce0605753a7694b9d56678d63a8d471820
232+ ...
233+ SdpFunding: 91d381a87e05d46fc9bc95246273b6930290506f0589ad039444decd3c24940e
234+ ...
235+ secret_keys:
236+ ...
237+ ```
238+
239+ Wait until you receive funds to both addresses, you can check the balance of your accounts with the following commands, you may need to repeat the faucet requests since only one drip is allowed per block.
240+
241+ ``` bash
242+ # check BlendZk key has received funds
243+ logoscore call blockchain_module wallet_get_notes 13cccf99f90fd78c2134891ce3c1afce0605753a7694b9d56678d63a8d471820 " " \
244+ | jq -r .result.value | jq .notes
245+ # > [
246+ # > {
247+ # > "id": "de5f5b6d2baac23bf562d89676ebd304e8d6e6f67afc22f378b5dabf164d142d",
248+ # > "value": "1000"
249+ # > }
250+ # > ]
251+
252+
253+ # check SdpFunding key has received funds
254+ logoscore call blockchain_module wallet_get_notes 91d381a87e05d46fc9bc95246273b6930290506f0589ad039444decd3c24940e " " \
255+ | jq -r .result.value | jq .notes
256+ # > [
257+ # > {
258+ # > "id": "47831c89a3609a7bd38755b2d2da7e2dfb63bef8515a8b8ad82c8a61b7b9a006",
259+ # > "value": "1000"
260+ # > }
261+ # > ]
262+ ```
263+
264+ Join the blend network by locking one of the notes held by your ` BlendZk ` key.
265+
266+ - ` <YOUR_IP> ` : must be your external ip address
267+ - ` <YOUR_BLEND_PORT> ` : Retrieve your configured blend port from the user_config.yaml (` blend.core.backend.listening_address ` ), note that if you do port-mapping, the external mapped port must be used.
268+ - ` <BLEND_ZK_NOTE_ID> ` : the note id of one of the notes held by your BlendZk key, as queried above.
269+
270+ Before joining, make sure the UDP port in the locator is reachable from the public Internet.
271+ The submitted locator should use the external address and port that other nodes can dial.
272+
273+ ```
274+ curl -X POST http://127.0.0.1:8080/blend/join \
275+ -H 'Content-Type: application/json' \
276+ -d '{"locator":"/ip4/<YOUR_IP>/udp/<YOUR_BLEND_PORT>/quic-v1","locked_note_id": "<BLEND_ZK_NOTE_ID>"}'
277+
278+ # successful call will return the declaration id:
279+ # > 2691821bd61394cc18939626de4e9231c699e8ddefd1ebf9e6c35b32229bdc65
280+ ```
281+
282+ Verify the declaration was accepted on chain by polling ` /mantle/sdp/declarations ` , looking for your declaration
283+
284+ ```
285+ curl http://127.0.0.1:8080/mantle/sdp/declarations | jq .
286+ # > [
287+ # > {
288+ # > "service_type": "BN",
289+ # > "provider_id": "35d60d973560b8344f83dc266a3fe89e35a3dcf9959c492d0a7a0b7a85c5d2ce",
290+ # > "locked_note_id": "<BLEND_ZK_NOTE_ID>",
291+ # > "locators": [
292+ # > "/ip4/<YOUR_IP>/udp/<YOUR_BLEND_PORT>/quic-v1"
293+ # > ],
294+ # > "zk_id": "13cccf99f90fd78c2134891ce3c1afce0605753a7694b9d56678d63a8d471820",
295+ # > "created": 1,
296+ # > "active": 3,
297+ # > "withdraw_at": null,
298+ # > "nonce": 0
299+ # > }
300+ # > ]
301+ ```
302+
303+ ` service_type: BN ` identifies it as a Blend node declaration, ` zk_id ` is your BlendZk public key, and ` provider_id ` is your BlendSigning key.
304+
305+ When in a block, the active epoch should be two epochs in the future (` active == created + 2 ` ), as that's when it will become active
306+
307+
216308## Storage
217309
218310Create the storage config:
@@ -252,66 +344,93 @@ The `logos.test` network preset provides the storage bootstrap settings.
252344Use fixed ` listen-port ` and ` disc-port ` .
253345Do not leave public nodes on random ports.
254346
347+ Start storage without mix:
348+
349+ ``` sh
350+ cd /var/lib/logos-node/storage-module
351+ logoscore load-module storage_module
352+ logoscore call storage_module init @config.json
353+ logoscore call storage_module start
354+ ```
355+
255356### Optional: Mix Support And Private Queries
256357
257358To run storage with mix support,
258359generate the storage config from the current published mix bootstrap data.
259360This replaces the basic ` config.json ` above.
361+ Replace ` <public-ip> ` before running this command.
260362
261363``` sh
262364cd /var/lib/logos-node/storage-module
263365cat > make-mix-storage-config.sh << 'EOF '
264366#!/usr/bin/env bash
265- set -e
266-
267- data_dir=${1:-"./logos-storage-data"}
268- udp_spr_json=$(curl -s https://logos-storage-network.fra1.digitaloceanspaces.com/v0.2/udp-sprs.json)
269- tcp_spr_json=$(curl -s https://logos-storage-network.fra1.digitaloceanspaces.com/v0.2/tcp-sprs.json)
270-
271- wget https://logos-storage-network.fra1.digitaloceanspaces.com/v0.2/mix-pool.json
272- mp_path=$(realpath "./mix-pool.json")
367+ set -euo pipefail
368+
369+ public_ip=${1:-}
370+ data_dir=${2:-"./logos-storage-data"}
371+
372+ if [ -z "${public_ip}" ]; then
373+ echo "Need to supply a public IP"
374+ exit 1
375+ fi
376+
377+ if ! command -v jq &> /dev/null; then
378+ echo "jq is not installed"
379+ exit 1
380+ fi
381+
382+ curl -fsSL "https://fleets.logos.co/logos-test/storage-network.json" > ./raw-data.json
383+
384+ tcp_spr_json=$(jq '[.[].tcpSpr]' ./raw-data.json)
385+ mix_pool_json=$(jq -c '{
386+ "version": 1,
387+ "relays": map({
388+ "peerId": .peerId,
389+ "mixPubKey": .mixPubKey,
390+ "libp2pPubKey": .libp2pPubKey,
391+ "multiAddr": "/ip4/\(.address)/tcp/\(.port)"
392+ })
393+ } | tostring' ./raw-data.json)
273394
274395cat <<JSON
275396{
276- "nat": "any ",
277- "log-level": "DEBUG ",
397+ "nat": "extip:${public_ip} ",
398+ "log-level": "INFO ",
278399 "mix-enabled": true,
279- "listen-port": 8080 ,
400+ "listen-port": 8091 ,
280401 "disc-port": 8090,
281- "bootstrap-node ": $udp_spr_json ,
402+ "network ": "logos.test" ,
282403 "dht-mix-proxy": $tcp_spr_json,
283404 "data-dir": "${data_dir}",
284- "mix-pool": "${mp_path}"
405+ "mix-pool-json ": ${mix_pool_json}
285406}
286407JSON
408+
409+ rm ./raw-data.json
287410EOF
288411
289412chmod 755 make-mix-storage-config.sh
290- ./make-mix-storage-config.sh > config.json
413+ ./make-mix-storage-config.sh < public-ip > > config.json
291414```
292415
293416Start storage with that config:
294417
295418``` sh
419+ cd /var/lib/logos-node/storage-module
296420logoscore load-module storage_module
297421logoscore call storage_module init @config.json
298422logoscore call storage_module start
299423logoscore call storage_module togglePrivateQueries true
300424```
301425
302- Privately query a known test object:
303-
304- ``` sh
305- logoscore call storage_module downloadToUrl zDvZRwzkzrrYB6sS1rRpRLt4gBhc1pWoyTSjkfszfmj1seaYYLCZ ./farewell-to-westphalia.pdf false 65536
306- ```
426+ After startup, allow the node time to populate routing state.
427+ If the first private query fails with a manifest lookup error,
428+ retry once after a short warm-up period.
307429
308- Start :
430+ Privately query a known test object :
309431
310432``` sh
311- cd /var/lib/logos-node/storage-module
312- logoscore load-module storage_module
313- logoscore call storage_module init @config.json
314- logoscore call storage_module start
433+ logoscore call storage_module downloadToUrl zDvZRwzkzrrYB6sS1rRpRLt4gBhc1pWoyTSjkfszfmj1seaYYLCZ /var/lib/logos-node/storage-module/farewell-to-westphalia.pdf false 65536
315434```
316435
317436## Delivery
0 commit comments