Skip to content

Commit 47cc8cc

Browse files
committed
Clippy + nits for bulletin-westend
1 parent ad3221b commit 47cc8cc

File tree

4 files changed

+37
-36
lines changed

4 files changed

+37
-36
lines changed

examples/README.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ curl -L -o zombienet-macos-arm64 https://github.com/paritytech/zombienet/release
2626
chmod +x zombienet-macos-arm64
2727
```
2828

29-
### Run Bulletin nodes with `--ipfs-server`
30-
```
31-
POLKADOT_BULLETIN_BINARY_PATH=./target/release/polkadot-bulletin-chain ./zombienet-linux-x64 -p native spawn ./zombienet/bulletin-polkadot-local.toml
32-
```
33-
34-
### Run Kubo locally and connect Bulletin nodes
29+
### Run Kubo locally
3530

3631
#### Either locally
3732
```
@@ -42,12 +37,6 @@ sudo bash install.sh
4237
ipfs version
4338
ipfs init
4439
ipfs daemon & # run in background
45-
46-
# Connect nodes
47-
ipfs swarm connect /ip4/127.0.0.1/tcp/10001/ws/p2p/12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm
48-
# connect 12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm success
49-
ipfs swarm connect /ip4/127.0.0.1/tcp/12347/ws/p2p/12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby
50-
# connect 12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby success
5140
```
5241

5342
#### Or use docker (uses 172.17.0.1 or host.docker.internal for swarm connect)
@@ -56,19 +45,36 @@ ipfs swarm connect /ip4/127.0.0.1/tcp/12347/ws/p2p/12D3KooWRkZhiRhsqmrQ28rt73K7V
5645
docker pull ipfs/kubo:latest
5746
docker run -d --name ipfs-node -v ipfs-data:/data/ipfs -p 4001:4001 -p 8080:8080 -p 5001:5001 ipfs/kubo:latest
5847
docker logs -f ipfs-node
59-
# Connect nodes
60-
docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/10001/ws/p2p/12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm && docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/12347/ws/p2p/12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby
48+
```
49+
50+
## Run Bulletin solochain with `--ipfs-server`
51+
```
52+
# Bulletin Solochain
53+
POLKADOT_BULLETIN_BINARY_PATH=./target/release/polkadot-bulletin-chain ./zombienet-linux-x64 -p native spawn ./zombienet/bulletin-polkadot-local.toml
6154
62-
# specific version
63-
# docker pull ipfs /kubo:v0.35.0
64-
# docker run -d --name ipfs-node-v0.35.0 -v ipfs-data:/data/ipfs-v0.35 -p 4001:4001 -p 8080:8080 -p 5001:5001 ipfs/kubo:v0.35.0
65-
# docker logs -f ipfs-node-v0.35.0
6655
# Connect nodes
67-
# docker exec -it ipfs-node-v0.35.0 ipfs swarm connect /ip4/172.17.0.1/tcp/10001/ws/p2p/12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm
68-
# docker exec -it ipfs-node-v0.35.0 ipfs swarm connect /ip4/172.17.0.1/tcp/12347/ws/p2p/12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby
56+
ipfs swarm connect /ip4/127.0.0.1/tcp/10001/ws/p2p/12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm
57+
# connect 12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm success
58+
ipfs swarm connect /ip4/127.0.0.1/tcp/12347/ws/p2p/12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby
59+
# connect 12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby success
60+
61+
# Or docker (change 127.0.0.1 -> 172.17.0.1)
62+
docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/10001/ws/p2p/12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm
63+
docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/12347/ws/p2p/12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby
64+
```
65+
66+
## Run Bulletin (Westend) parachain with `--ipfs-server`
67+
```
68+
# Bulletin parachain (Westend)
69+
./scripts/create_bulletin_westend_spec.sh
70+
POLKADOT_BINARY_PATH=~/local_bridge_testing/bin/polkadot POLKADOT_PARACHAIN_BINARY_PATH=~/local_bridge_testing/bin/polkadot-parachain ./zombienet-linux-x64 -p native spawn ./zombienet/bulletin-westend-local.toml
71+
72+
# For docker (change 127.0.0.1 -> 172.17.0.1)
73+
docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/10001/ws/p2p/12D3KooWJKVVNYByvML4Pgx1GWAYryYo6exA68jQX9Mw3AJ6G5gQ
74+
docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/12347/ws/p2p/12D3KooWJ8sqAYtMBX3z3jy2iM98XGLFVzVfUPtmgDzxXSPkVpZZ
6975
```
7076

71-
### Trigger authorize, store and IPFS get
77+
## Trigger authorize, store and IPFS get
7278
```
7379
# cd polkadot-bulletin-chain - make sure we are here
7480
cd examples

examples/authorize_and_store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const ipfs = create({
3939
async function read_from_ipfs(cid) {
4040
// Fetch the block (downloads via Bitswap if not local)
4141
console.log('Trying to get cid: ', cid);
42-
const block = await ipfs.block.get(cid, {timeout: 10000});
42+
const block = await ipfs.block.get(cid, {timeout: 15000});
4343
console.log('Received block: ', block);
4444
if (block.length !== 0) {
4545
return block

runtimes/bulletin-westend/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
159159
spec_name: alloc::borrow::Cow::Borrowed("bulletin-westend"),
160160
impl_name: alloc::borrow::Cow::Borrowed("bulletin-westend"),
161161
authoring_version: 1,
162-
spec_version: 1_018_001,
163-
impl_version: 0,
162+
spec_version: 1_000_000,
163+
impl_version: 1,
164164
apis: RUNTIME_API_VERSIONS,
165-
transaction_version: 2,
165+
transaction_version: 1,
166166
system_version: 1,
167167
};
168168

@@ -288,7 +288,7 @@ impl sp_runtime::traits::TransactionExtension<RuntimeCall> for ValidateSigned {
288288

289289
let validity = match call {
290290
RuntimeCall::TransactionStorage(inner_call) =>
291-
TransactionStorage::validate_signed(&who, inner_call),
291+
TransactionStorage::validate_signed(who, inner_call),
292292

293293
_ => Ok(ValidTransaction::default()),
294294
}?;
@@ -307,7 +307,7 @@ impl sp_runtime::traits::TransactionExtension<RuntimeCall> for ValidateSigned {
307307
// Only enforce pre-dispatch for transaction storage calls; pass through others.
308308
if let Some(who) = origin.as_system_origin_signer() {
309309
if let RuntimeCall::TransactionStorage(inner_call) = call {
310-
TransactionStorage::pre_dispatch_signed(&who, inner_call)?;
310+
TransactionStorage::pre_dispatch_signed(who, inner_call)?;
311311
}
312312
}
313313
Ok(())

zombienet/bulletin-westend-local.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ chain = "westend-local"
2424
rpc_port = 9943
2525
balance = 2000000000000
2626

27-
# not needed
28-
[[relaychain.nodes]]
29-
name = "charlie"
30-
validator = true
31-
rpc_port = 9944
32-
balance = 2000000000000
33-
3427
[[parachains]]
3528
id = 1006
3629
chain_spec_path = "./zombienet/bulletin-westend-spec.json"
@@ -40,7 +33,8 @@ cumulus_based = true
4033
name = "bulletin-westend-collator-1"
4134
command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}"
4235
validator = true
43-
rpc_port = 9930
36+
p2p_port = 10001
37+
rpc_port = 10000
4438
args = [
4539
"--ipfs-server", "-lparachain=debug,runtime=trace,xcm=trace,bitswap=trace,sub-libp2p::bitswap=trace"
4640
]
@@ -49,7 +43,8 @@ cumulus_based = true
4943
name = "bulletin-westend-collator-2"
5044
command = "{{POLKADOT_PARACHAIN_BINARY_PATH}}"
5145
validator = true
52-
rpc_port = 9931
46+
p2p_port = 12347
47+
rpc_port = 12346
5348
args = [
5449
"--ipfs-server", "-lparachain=debug,runtime=trace,xcm=trace,bitswap=trace,sub-libp2p::bitswap=trace"
5550
]

0 commit comments

Comments
 (0)