Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
uses: actions/checkout@v2
with:
submodules: recursive
- name: Add SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Check to latest commit
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
Expand Down
6 changes: 1 addition & 5 deletions .maintain/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@ if [[ -z "$1" ]] ; then
VERSION=$(git rev-parse --short HEAD)
fi

eval $(ssh-agent)
ssh-add ~/.ssh/github_actions
DOCKER_BUILDKIT=1 docker build --ssh default -t "$NODE_NAME:$VERSION" .
docker push "$NODE_NAME:$VERSION"
docker push $NODE_NAME:latest
DOCKER_BUILDKIT=1 docker build -t "$NODE_NAME:$VERSION" .
4 changes: 0 additions & 4 deletions .maintain/build-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ RUSTC_VERSION="1.53.0"
EXTRA_ARGS='--json'
BIN_PATH=$(dirname $(readlink -f $0))
WORK_PATH=${BIN_PATH}/..
eval $(ssh-agent)
ssh-add ~/.ssh/github_actions

RUNTIME=$1

docker run --rm -it \
-e PACKAGE=$RUNTIME-runtime \
-e VERBOSE=1 \
-e CARGO_TERM_COLOR=always \
-e SSH_AUTH_SOCK=/ssh-agent \
-v $(readlink -f $SSH_AUTH_SOCK):/ssh-agent \
-v ${TMPDIR}/cargo:/cargo-home \
-v ${WORK_PATH}:/build \
paritytech/srtool:${RUSTC_VERSION} build ${EXTRA_ARGS}
Expand Down
11 changes: 11 additions & 0 deletions .maintain/publish-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

VERSION=$1
NODE_NAME=bifrostnetwork/bifrost

if [[ -z "$1" ]] ; then
VERSION=$(git rev-parse --short HEAD)
fi

docker push "$NODE_NAME:$VERSION"
docker push $NODE_NAME:latest
16 changes: 3 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate",
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" }

zenlink-protocol = { git = "ssh://git@github.com/bifrost-finance/Zenlink-DEX-Module", branch = "polkadot-v0.9.9" }
zenlink-protocol-rpc = { git = "ssh://git@github.com/bifrost-finance/Zenlink-DEX-Module", branch = "polkadot-v0.9.9" }
zenlink-protocol-runtime-api = { git = "ssh://git@github.com/bifrost-finance/Zenlink-DEX-Module", branch = "polkadot-v0.9.9" }
zenlink-protocol = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "polkadot-v0.9.9"}
zenlink-protocol-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "polkadot-v0.9.9" }
zenlink-protocol-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "polkadot-v0.9.9" }

orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "8d5432c3458702a7df14b374bddde43a2a20aa43" }
orml-currencies = {git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "8d5432c3458702a7df14b374bddde43a2a20aa43" }
Expand Down
20 changes: 12 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,39 @@ RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2021-06-17

WORKDIR /app
COPY . /app
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts

RUN --mount=type=ssh export PATH="$PATH:$HOME/.cargo/bin" && \
RUN export PATH="$PATH:$HOME/.cargo/bin" && \
make build-all-release

# ===== SECOND STAGE ======

FROM ubuntu:20.04
WORKDIR /bifrost

RUN rm -rf /usr/share && \
rm -rf /usr/lib/python* && \
useradd -m -u 1000 -U -s /bin/sh -d /bifrost bifrost && \
mkdir -p /bifrost/.local/data && \
chown -R bifrost:bifrost /bifrost && \
ln -s /bifrost/.local/data /data
mkdir -p /bifrost/.local/share && \
mkdir /data && \
chown -R bifrost:bifrost /data && \
ln -s /data /bifrost/.local/share/bifrost && \
mkdir /spec && \
chown -R bifrost:bifrost /spec && \
ln -s /spec /bifrost/.local/share/spec

USER bifrost
COPY --from=builder /app/target/release/bifrost /usr/local/bin
COPY ./node/service/res/asgard.json /bifrost
COPY ./node/service/res/bifrost.json /bifrost
COPY ./node/service/res/asgard.json /spec
COPY ./node/service/res/bifrost.json /spec

# checks
RUN ldd /usr/local/bin/bifrost && \
/usr/local/bin/bifrost --version


USER bifrost
EXPOSE 30333 9933 9944

VOLUME ["/data"]
VOLUME ["/spec"]

ENTRYPOINT ["/usr/local/bin/bifrost"]
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,8 @@ docker-compose up -d --build
### Create `bifrost-fullnode` directory, generate `node-key` and get `bifrost.json`

```sh
mkdir -p ~/bifrost-fullnode/network
subkey generate-node-key --file ~/bifrost-fullnode/network/node-key
wget -O ~/bifrost-fullnode/bifrost.json https://github.com/bifrost-finance/bifrost/releases/download/bifrost-v0.8.0/bifrost.json
mkdir -p ~/node-key
subkey generate-node-key --file ~/node-key/bifrost.key
```

### Start the node with docker
Expand All @@ -138,16 +137,16 @@ Replace your-fullnode-name
```sh
docker pull bifrostnetwork/bifrost:v0.8.3
docker run -d \
-v ~/bifrost-fullnode:/bifrost \
-v ~/node-key:/node-key \
-p 9944:9944 \
-p 9933:9933 \
-p 30333:30333 \
-p 9615:9615 \
bifrostnetwork/bifrost:v0.8.3 \
--name your-fullnode-name \
--base-path "/bifrost" \
--node-key-file "/bifrost/network/node-key" \
--chain "/bifrost/bifrost.json" \
--base-path "/data" \
--node-key-file "/node-key/bifrost.key" \
--chain "/spec/bifrost.json" \
--parachain-id 2001 \
--pruning=archive \
--prometheus-external \
Expand Down
1 change: 0 additions & 1 deletion node/service/res/asgard.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"relay_chain": "westend",
"para_id": 2001,
"consensusEngine": null,
"lightSyncState": null,
"codeSubstitutes": {},
"genesis": {
"raw": {
Expand Down
1 change: 0 additions & 1 deletion node/service/res/bifrost.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"relay_chain": "kusama",
"para_id": 2001,
"consensusEngine": null,
"lightSyncState": null,
"codeSubstitutes": {},
"genesis": {
"raw": {
Expand Down
13 changes: 2 additions & 11 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ set -e

echo "*** Initializing WASM build environment"

if [ -z $CI_PROJECT_NAME ] ; then
rustup update nightly
rustup update stable
fi
rustup default nightly-2021-06-17

rustup target add wasm32-unknown-unknown --toolchain nightly

rustup component add rustfmt

# Install wasm-gc. It's useful for stripping slimming down wasm binaries.
command -v wasm-gc || \
cargo +nightly install --git https://github.com/alexcrichton/wasm-gc --force
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-06-17