Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/zombienet-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -551,15 +551,11 @@ jobs:
# Re-enable (drop continue-on-error) once the previewnet preset's
# min_duration is lowered to match the demo (todo).
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 15
run: |
set -e
source ./config/ports.env
W3S_TAG=$(curl -sL -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/paritytech/web3-storage/releases/latest" \
| jq -r .tag_name)
W3S_TAG=$(jq -r '.releases["web3-storage"].tag' networks/previewnet.json)
echo "Cloning paritytech/web3-storage @ $W3S_TAG"
git clone --depth 1 --branch "$W3S_TAG" \
https://github.com/paritytech/web3-storage.git /tmp/w3s
Expand Down
9 changes: 1 addition & 8 deletions config/ports.env
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,12 @@ BOOTNODE_HOSTNAME=127.0.0.1
# webrtc-direct advertises what it binds, so a 127.0.0.1 listener is reachable by nobody else.
P2P_LISTEN_IP=127.0.0.1

# Storage-provider data dir (disk mode). Empty locally so the wrapper derives it
# Storage-provider data dir. Empty locally so the wrapper derives it
# from DATA_DIR; a deployment patches this to an absolute path under the
# persistent DATA_DIR, because zombie-cli does not forward env vars to
# custom_processes (same reason BOOTNODE_HOSTNAME is patched here).
WEB3_STORAGE_PROVIDER_DATA_DIR=

# Storage-provider storage mode: "disk" (persistent) or "inmemory" (ephemeral).
# Defaults to disk. zombie-cli does not forward env vars to custom_processes, so
# EPHEMERAL cannot reach the wrapper directly; for native runs `make start`
# regenerates config/ports.local.env (sourced after this file) to flip the mode
# to inmemory under EPHEMERAL=1. The server stays on the disk default.
WEB3_STORAGE_PROVIDER_STORAGE_MODE=disk

# Auxiliary service ports (defaults from binaries)
ETH_RPC_PORT=8545

Expand Down
2 changes: 1 addition & 1 deletion networks/previewnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"web3-storage": {
"repo": "paritytech/web3-storage",
"tag": "latest"
"tag": "v0.5.1-paseo"
}
},
"genesisConfig": {
Expand Down
28 changes: 12 additions & 16 deletions packages/cli/src/commands/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,10 @@ async function storageProviderNode(ctx: ServiceContext, _deps: ServiceDeps = {})
console.log(` using sibling build: ${binary}`);
}

const keyfile = path.join(fs.mkdtempSync(path.join(os.tmpdir(), 'ppn-sp-')), 'key');
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ppn-sp-'));
process.on('exit', () => fs.rmSync(tempDir, { recursive: true, force: true }));
const keyfile = path.join(tempDir, 'key');
fs.writeFileSync(keyfile, '//Alice\n', { mode: 0o600 });
process.on('exit', () => fs.rmSync(path.dirname(keyfile), { recursive: true, force: true }));

const chainPort = ctx.ports.WEB3_STORAGE_PORT;
console.log(`storage-provider-node: waiting for the web3-storage chain on 127.0.0.1:${chainPort}...`);
Expand All @@ -749,27 +750,22 @@ async function storageProviderNode(ctx: ServiceContext, _deps: ServiceDeps = {})
publicMultiaddr = `/dns4/${hostname}/tcp/443/tls/http/http-path/web3-storage-provider`;
}

const inMemory = (ctx.ports.WEB3_STORAGE_PROVIDER_STORAGE_MODE ?? 'disk') === 'inmemory';
const storageArgs = ['--storage-mode', 'inmemory'];
if (!inMemory) {
const storagePath =
process.env.STORAGE_PATH ||
ctx.ports.WEB3_STORAGE_PROVIDER_DATA_DIR ||
path.join(ctx.dataDir, 'web3-storage-provider');
fs.mkdirSync(storagePath, { recursive: true });
storageArgs.length = 0;
storageArgs.push('--storage-mode', 'disk', '--storage-path', storagePath);
}
const storagePath =
ctx.ports.PPN_EPHEMERAL === '1'
? path.join(tempDir, 'data')
: process.env.STORAGE_PATH ||
ctx.ports.WEB3_STORAGE_PROVIDER_DATA_DIR ||
path.join(ctx.dataDir, 'web3-storage-provider');
fs.mkdirSync(storagePath, { recursive: true });

const args = [
'--keyfile', keyfile,
...storageArgs,
'--storage-path', storagePath,
'--bind-addr', `127.0.0.1:${ctx.ports.WEB3_STORAGE_PROVIDER_PORT}`,
'--chain-rpc', `ws://127.0.0.1:${chainPort}`,
...(publicMultiaddr ? ['--public-multiaddr', publicMultiaddr] : []),
'--enable-checkpoint-coordinator',
];
console.log(` storage: ${storageArgs.join(' ')}`);
console.log(` storage: ${storagePath}`);
if (publicMultiaddr) console.log(` advertising: ${publicMultiaddr}`);

// Replaces this process for the lifetime of the network, the way the wrapper's exec did.
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/lib/spawn-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export interface LocalEnvFacts {
export function localEnvContent(f: LocalEnvFacts): string {
return (
'# Generated by `ppn start` — gitignored, do not edit.\n' +
`WEB3_STORAGE_PROVIDER_STORAGE_MODE=${f.ephemeral ? 'inmemory' : 'disk'}\n` +
`DUB_POSTGRES_DATA_DIR=${f.identityDataDir}\n` +
`PPN_NETWORK=${f.network}\n` +
// The services load the network themselves, and see the overlay's nodes only through this.
Expand Down
1 change: 1 addition & 0 deletions packages/network-config/src/toml-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ const CHAIN_ARGS: Record<ChainKey, ChainDef> = {
'web3-storage': {
required: [
'--collator',
'--authoring=slot-based',
'--rpc-max-connections=500',
'--unsafe-rpc-external',
'--rpc-max-response-size=50',
Expand Down
5 changes: 5 additions & 0 deletions packages/network-config/tests/toml-generator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ describe('generateToml with custom log targets', () => {
assert.ok(toml.includes('--force-authoring'));
assert.ok(toml.includes('-lsync=info'));
});

it('runs the web3-storage collator slot-based, the only authoring that sends the relay parent descendants its runtime requires', () => {
const toml = generateToml(['web3-storage']);
assert.ok(toml.includes('--authoring=slot-based'));
});
});

describe('generateToml with enableHop', () => {
Expand Down
2 changes: 1 addition & 1 deletion zombienet-configs/local-dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ rpc_port = 10040
p2p_port = 30337
prometheus_port = 20040
command = "{{SCRIPTS}}/omni-node.sh"
args = ["-lruntime=info", "--collator", "--rpc-max-connections=500", "--unsafe-rpc-external", "--rpc-max-response-size=50", "--listen-addr=/ip4/127.0.0.1/udp/30337/webrtc-direct"]
args = ["-lruntime=info", "--collator", "--authoring=slot-based", "--rpc-max-connections=500", "--unsafe-rpc-external", "--rpc-max-response-size=50", "--listen-addr=/ip4/127.0.0.1/udp/30337/webrtc-direct"]

[[hrmp_channels]]
sender = 1502
Expand Down
Loading