Skip to content

Commit

Permalink
Merge pull request #21 from chocolatenetwork/development
Browse files Browse the repository at this point in the history
Development - Sync with main
  • Loading branch information
islami00 authored Sep 3, 2022
2 parents 30223d6 + ba44c07 commit d0e8761
Show file tree
Hide file tree
Showing 39 changed files with 3,268 additions and 889 deletions.
14 changes: 14 additions & 0 deletions .github/dockerfiles/Dockerfile.collator
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM gitpod/workspace-full

# Change to machine user/group
ARG USER=gitpod
ARG GROUP=gitpod
USER ${USER}:${GROUP}

EXPOSE 30333 9933 9944

ARG COLLATOR_BIN=./target/release/parachain-collator

COPY ${COLLATOR_BIN} /usr/local/bin

ENTRYPOINT ["/usr/local/bin/parachain-collator"]
32 changes: 14 additions & 18 deletions .github/dockerfiles/Dockerfile.gitpod-base
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,23 @@ RUN . $HOME/.cargo/env
RUN rustup toolchain install nightly --allow-downgrade --profile minimal --component cargo
RUN rustup target add wasm32-unknown-unknown --toolchain nightly
# Rustup and cargo should be available

# TODO: Validate bins
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \
rm kubectl
RUN wget https://github.com/paritytech/zombienet/releases/download/v1.2.46/zombienet-linux -O zombienet && \
sudo install -o root -g root -m 0755 zombienet /usr/local/bin/zombienet && \
rm zombienet
# Change to machine user/group
ARG USER=gitpod
ARG GROUP=gitpod
USER ${USER}:${GROUP}

RUN mkdir /home/${USER}/relay
WORKDIR /home/${USER}/relay
# Clone the Polkadot Repository
# Build the relay chain Node
# Checkout the proper commit
# Check if the help page prints to ensure the node is built correctly
ARG BIN="polkadot"
RUN git clone https://github.com/paritytech/polkadot.git && \
cd polkadot && \
git checkout release-v0.9.23 && \
cargo build --release && \
./target/release/${BIN} --help && \
find target -type f ! -name ${BIN} -exec rm {} +




RUN mkdir -p /home/${USER}/relay/polkadot/target/release
WORKDIR /home/${USER}/relay/polkadot/target/release

# Download latest polkadot release
ARG VER="v0.9.24"
RUN wget https://github.com/paritytech/polkadot/releases/download/${VER}/polkadot && chmod +x ./polkadot
# Ease:
ENV POLKADOT_BIN=/home/${USER}/relay/polkadot/target/release/polkadot
12 changes: 12 additions & 0 deletions .github/dockerfiles/Dockerfile.relay
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM gitpod/workspace-full

ARG USER=gitpod
ARG GROUP=gitpod
USER ${USER}:${GROUP}

ARG POLKADOT_BIN=./bins/polkadot

COPY ${POLKADOT_BIN} /usr/local/bin
EXPOSE 30333 9933 9944

ENTRYPOINT ["/usr/local/bin/polkadot"]
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@

.DS_Store
.idea
.vscode
.vscode
/ch_spec
28 changes: 22 additions & 6 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
image:
file: .github/dockerfiles/Dockerfile.gitpod-base
context: .
tasks:
- name: Collator 1
init: cargo build
command: ./target/debug/parachain-collator --dev
- name: Relay
command: ~/relay/polkadot/target/release/polkadot --dev

- name: Collator
init: bash ./scripts/prep-collator.sh main && gp sync-await relay
command: bash ./scripts/start-collator.sh
- name: Relay Alice
init: bash ./scripts/prep-relay.sh main
command: bash ./scripts/start-relay.sh alice
- name: Relay Bob
# Wait for alice
init: gp sync-await relay
command: bash ./scripts/start-relay.sh bob
# - name: Test Net
# init: gp sync-await collator && gp sync-await relay
# command: zombienet spawn zombienet/config.toml -p native

github:
prebuilds:
development: true
ports:
- port: 8844
visibility: public
- port: 9944
visibility: public
Loading

0 comments on commit d0e8761

Please sign in to comment.