Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: revert docker stack to IBFT and fix a few commands (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan authored and atanmarko committed Sep 15, 2023
1 parent 75601ad commit a4de796
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -40,9 +38,6 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Compile contracts
run: cd core-contracts && npm install && npm run compile

- name: Push to GitHub Container Registry
uses: docker/build-push-action@v3
Expand Down
3 changes: 0 additions & 3 deletions docker/local-topos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ RUN go mod download

COPY . .

RUN go run ./consensus/polybft/contractsapi/artifacts-gen/main.go

RUN go build -o polygon-edge main.go

FROM alpine:latest AS runner
Expand All @@ -21,7 +19,6 @@ WORKDIR /polygon-edge

COPY --from=builder /polygon-edge/polygon-edge ./
COPY ./docker/local-topos/polygon-edge.sh ./
COPY ./core-contracts/artifacts ./core-contracts/artifacts

# Expose json-rpc, libp2p and grpc ports
EXPOSE 8545 9632 1478 5001
Expand Down
17 changes: 11 additions & 6 deletions docker/local-topos/polygon-edge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,23 @@ case "$1" in
echo "Secrets have already been generated."
else
echo "Generating secrets..."
secrets=$("$POLYGON_EDGE_BIN" secrets init --insecure --num "$NUMBER_OF_NODES" --data-dir "$data_dir" --json)
secrets=$("$POLYGON_EDGE_BIN" secrets init --insecure \
--num "$NUMBER_OF_NODES" --data-dir "$data_dir" --json)
chmod -R 755 /data # TOPOS: To make secret readable from the sequencer
echo "Secrets have been successfully generated"

BOOTNODE_ID=$(echo $secrets | jq -r '.[0] | .node_id')
BOOTNODE_ADDRESS=$(echo $secrets | jq -r '.[0] | .address')

echo "Generating IBFT Genesis file..."
"$POLYGON_EDGE_BIN" genesis $CHAIN_CUSTOM_OPTIONS \
--dir "$GENESIS_PATH" \
cd /data && /polygon-edge/polygon-edge genesis $CHAIN_CUSTOM_OPTIONS \
--dir genesis.json \
--consensus ibft \
--ibft-validators-prefix-path data- \
--validator-set-size=$NUMBER_OF_NODES \
--bootnode /dns4/"$BOOTNODE_DOMAIN_NAME"/tcp/1478/p2p/$BOOTNODE_ID \
--premine=$BOOTNODE_ADDRESS:1000000000000000000000
--premine=$BOOTNODE_ADDRESS:1000000000000000000000 \
&& cd /polygon-edge
fi
;;

Expand All @@ -56,15 +59,17 @@ case "$1" in
echo "Secrets have already been generated."
else
echo "Generating PolyBFT secrets..."
secrets=$("$POLYGON_EDGE_BIN" polybft-secrets init --insecure --num "$NUMBER_OF_NODES" --data-dir "$data_dir" --json)
secrets=$("$POLYGON_EDGE_BIN" polybft-secrets init --insecure \
--num "$NUMBER_OF_NODES" --data-dir "$data_dir" --json)
chmod -R 755 /data # TOPOS: To make secret readable from the sequencer
echo "Secrets have been successfully generated"

BOOTNODE_ID=$(echo $secrets | jq -r '.[0] | .node_id')
BOOTNODE_ADDRESS=$(echo $secrets | jq -r '.[0] | .address')

echo "Generating manifest..."
"$POLYGON_EDGE_BIN" manifest --path /data/manifest.json --validators-path /data --validators-prefix data-
"$POLYGON_EDGE_BIN" manifest --path /data/manifest.json --validators-path /data \
--validators-prefix data- --chain-id "$CHAIN_ID"

echo "Generating PolyBFT Genesis file..."
"$POLYGON_EDGE_BIN" genesis $CHAIN_CUSTOM_OPTIONS \
Expand Down

0 comments on commit a4de796

Please sign in to comment.