Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fork to zombienet #949

Merged
merged 7 commits into from
Dec 27, 2024
Merged
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
3 changes: 3 additions & 0 deletions launch-configs/fork/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
state.json
forked-chainspec.json
data/
40 changes: 40 additions & 0 deletions launch-configs/fork/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM node:18-bookworm

RUN apt-get update && apt-get install -y \
curl \
wget \
nodejs \
npm \
ca-certificates \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /zombienet/hydration-node/launch-configs/fork

RUN wget -q https://github.com/paritytech/zombienet/releases/latest/download/zombienet-linux-x64 -O /usr/local/bin/zombienet && \
chmod +x /usr/local/bin/zombienet
RUN zombienet version

RUN mkdir -p /zombienet/polkadot-sdk/target/release
RUN for binary in polkadot polkadot-execute-worker polkadot-prepare-worker; do \
wget -q https://github.com/paritytech/polkadot-sdk/releases/latest/download/$binary \
-O /zombienet/polkadot-sdk/target/release/$binary \
&& chmod +x /zombienet/polkadot-sdk/target/release/$binary \
&& /zombienet/polkadot-sdk/target/release/$binary --version; \
done

RUN mkdir -p /zombienet/hydration-node/target/release
RUN wget -q https://github.com/galacticcouncil/hydration-node/releases/latest/download/hydradx -O /zombienet/hydration-node/target/release/hydradx && \
chmod +x /zombienet/hydration-node/target/release/hydradx
RUN /zombienet/hydration-node/target/release/hydradx --version

COPY . .

RUN npm i

VOLUME /zombienet/hydration-node/launch-configs/fork/data
EXPOSE 9988

ENV STATE_SOURCE=https://snapshots.play.hydration.cloud/state.json

CMD npm start
13 changes: 13 additions & 0 deletions launch-configs/fork/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
starts zombienet instance with forked state downloaded from `STATE_SOURCE` (by default loaded from latest snapshot available)

### run with docker
```
docker run -d -p 9988:9988 galacticcouncil/fork
```

### run locally
- node >18 required
- you have to have all binaries present on correct paths in `config.json`
```
npm i && npm start
```
66 changes: 66 additions & 0 deletions launch-configs/fork/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"settings": {
"provider": "native"
},
"relaychain": {
"default_command": "../../../polkadot-sdk/target/release/polkadot",
"chain": "rococo-local",
"nodes": [
{
"name": "alice",
"command": "../../../polkadot-sdk/target/release/polkadot",
"args": [
"--pruning=archive"
],
"ws_port": 9944,
"invulnerable": true
},
{
"name": "bob",
"ws_port": 9955,
"invulnerable": true
},
{
"name": "charlie",
"ws_port": 9966,
"invulnerable": true
},
{
"name": "dave",
"ws_port": 9977,
"invulnerable": true
}
]
},
"types": {},
"hrmp_channels": [],
"parachains": [
{
"id": 2034,
"cumulus_based": true,
"chain": "local",
"chain_spec_path": "forked-chainspec.json",
"collators": [
{
"name": "alice",
"command": "../../target/release/hydradx",
"args": [
"--pruning=archive",
"--log=info"
],
"ws_port": 9988,
"rpc_port": 9999
},
{
"name": "bob",
"command": "../../target/release/hydradx",
"args": [
"--pruning=archive",
"--log=info"
],
"ws_port": 9989
}
]
}
]
}
Loading
Loading