-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dan moore
authored and
dan moore
committed
Jul 27, 2022
1 parent
87128f3
commit 517c52e
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Phase 0: Builder | ||
# ========================= | ||
FROM paritytech/ci-linux:production as builder | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y git openssh-client && \ | ||
rm -rf /var/lib/apt/lists && \ | ||
mkdir -p /avail | ||
|
||
COPY . /avail/ | ||
|
||
RUN \ | ||
mkdir -p /da/bin && \ | ||
mkdir -p /da/genesis && \ | ||
# Build DA \ | ||
cp -r /avail/misc/genesis /da && \ | ||
cd /avail && \ | ||
cargo build --release -p data-avail && \ | ||
# Install binaries \ | ||
mv target/release/data-avail /da/bin | ||
|
||
|
||
# Phase 1: Binary deploy | ||
# ========================= | ||
FROM debian:buster-slim | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl && \ | ||
rm -rf /var/lib/apt/lists | ||
|
||
COPY --from=builder /da/ /da | ||
COPY entrypoint.sh / | ||
WORKDIR /da | ||
|
||
ENV \ | ||
DA_CHAIN="/da/genesis/testnet.chain.spec.raw.json" \ | ||
DA_NAME="AvailNode" \ | ||
DA_MAX_IN_PEERS=50 \ | ||
DA_MAX_OUT_PEERS=50 \ | ||
DA_P2P_PORT="30333" | ||
|
||
VOLUME ["/tmp", "/da/state", "/da/keystore"] | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
cat /entrypoint.sh; | ||
|
||
trap cleanup 1 2 3 6 | ||
|
||
cleanup() | ||
{ | ||
echo "Done cleanup ... quitting." | ||
exit 1 | ||
} | ||
|
||
/da/bin/data-avail \ | ||
--validator \ | ||
--base-path /da/state \ | ||
--keystore-path /da/keystore \ | ||
--execution=NativeElseWasm \ | ||
--offchain-worker=Always \ | ||
--enable-offchain-indexing=true \ | ||
--name $DA_NAME \ | ||
--chain $DA_CHAIN \ | ||
--port $DA_P2P_PORT \ | ||
--bootnodes=/ip4/52.47.205.129/tcp/30333/p2p/12D3KooW9tVuCzq3eknsevL5uyqQ3LpVcuqtkTqropjNccbhsWBz \ | ||
--bootnodes=/ip4/15.237.127.118/tcp/30333/p2p/12D3KooWQtxig5HukFDwQzshGWgQEZAqGqdCN7AQBW7cQRJWCyxL \ | ||
--bootnodes=/ip4/52.47.205.129/tcp/30333/p2p/12D3KooW9tVuCzq3eknsevL5uyqQ3LpVcuqtkTqropjNccbhsWBz \ | ||
$@ |