Skip to content

Commit

Permalink
Merge pull request #949 from galacticcouncil/zombienet-support
Browse files Browse the repository at this point in the history
feat: fork to zombienet
  • Loading branch information
mrq1911 authored Dec 27, 2024
2 parents 47ec56e + 9968849 commit c533e50
Show file tree
Hide file tree
Showing 10 changed files with 2,841 additions and 7 deletions.
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

0 comments on commit c533e50

Please sign in to comment.