Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: split anvil/allo containers; update image; unblock foundry #3

Open
wants to merge 1 commit into
base: updates
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules
.openzeppelin*
.upgradable
.vscode
Makefile
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@ RUN apt-get update && \
COPY . /app
WORKDIR /app


# Check when foundry supports dumping events
# https://github.com/foundry-rs/foundry/issues/5906
RUN curl -L https://foundry.paradigm.xyz | bash

RUN ~/.foundry/bin/foundryup

ENV PATH="$PNPM_HOME:$PATH"

RUN corepack enable
RUN pnpm install

FROM node:16-bullseye-slim as prod
FROM node:20-slim as prod
RUN apt-get update && \
apt-get install -y curl git && \
apt-get clean -y && \
Expand All @@ -28,7 +21,6 @@ COPY . /app
WORKDIR /app

COPY --from=base /app/node_modules /app/node_modules
COPY --from=base /root/.foundry/bin/anvil /root/.foundry/bin/anvil

ENV DEV_CHAIN_ID=313371
ENV PNPM_HOME="/pnpm"
Expand All @@ -37,6 +29,4 @@ RUN corepack enable

RUN pnpm hardhat compile

EXPOSE 8545/tcp

ENTRYPOINT ./docker/start-chain.sh
ENTRYPOINT ./docker/deploy-contracts.sh
17 changes: 8 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
.PHONY: docker-build docker-run docker-kill docker-stop docker-logs docker-deploy-contracts docker-all

IMAGE_NAME=allo
CONTAINER_NAME=allo

docker-all: docker-kill docker-build docker-run docker-deploy-contracts

docker-build:
docker build . -t $(IMAGE_NAME) --no-cache --progress=plain
docker build . -t allo

docker-run:
docker run --name $(CONTAINER_NAME) --rm -d -p 127.0.0.1:8545:8545/tcp $(IMAGE_NAME)
-docker network create allo-devenv-tmp-net
docker run --network allo-devenv-tmp-net --name localchain --rm -d -p 127.0.0.1:8545:8545/tcp ghcr.io/foundry-rs/foundry:latest "anvil --host 0.0.0.0 --chain-id 313371"

docker-kill:
-docker kill $(CONTAINER_NAME)
-docker kill localchain

docker-stop:
docker stop $(CONTAINER_NAME)
docker stop localchain

docker-logs:
docker logs -f $(CONTAINER_NAME)
docker logs -f localchain

docker-deploy-contracts:
docker exec allo bash ./docker/deploy-contracts.sh
docker run --network=allo-devenv-tmp-net -e DEV_CHAIN_HOST=localchain allo

41 changes: 21 additions & 20 deletions docker/deploy-contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@ export SKIP_CONFIRMATIONS=true

TIMEFORMAT='(🟢 %3R seconds)';

time pnpm run deploy-project-registry dev && \
time pnpm hardhat run scripts/dev/populate/projects.ts --network dev && \
pnpm run deploy-project-registry dev && \
\
time pnpm run deploy-program-factory dev && \
time pnpm run deploy-program-implementation dev && \
time pnpm run link-program-implementation dev && \
pnpm run deploy-program-factory dev && \
pnpm run deploy-program-implementation dev && \
pnpm run link-program-implementation dev && \
\
time pnpm run deploy-qf-factory dev && \
time pnpm run deploy-qf-implementation dev && \
time pnpm run link-qf-implementation dev && \
pnpm hardhat run scripts/dev/populate/projects.ts --network dev && \
\
time pnpm run deploy-merkle-factory dev && \
time pnpm run deploy-merkle-implementation dev && \
time pnpm run link-merkle-implementation dev && \
pnpm run deploy-qf-factory dev && \
pnpm run deploy-qf-implementation dev && \
pnpm run link-qf-implementation dev && \
\
time pnpm run deploy-direct-factory dev && \
time pnpm run deploy-direct-implementation dev && \
time pnpm run link-direct-implementation dev && \
pnpm run deploy-merkle-factory dev && \
pnpm run deploy-merkle-implementation dev && \
pnpm run link-merkle-implementation dev && \
\
time pnpm run deploy-allo-settings dev && \
time pnpm run set-protocol-fee dev && \
pnpm run deploy-direct-factory dev && \
pnpm run deploy-direct-implementation dev && \
pnpm run link-direct-implementation dev && \
\
time pnpm run deploy-round-factory dev && \
time pnpm run deploy-round-implementation dev && \
time pnpm run link-round-implementation dev && \
time pnpm run link-allo-settings dev
pnpm run deploy-allo-settings dev && \
pnpm run set-protocol-fee dev && \
\
pnpm run deploy-round-factory dev && \
pnpm run deploy-round-implementation dev && \
pnpm run link-round-implementation dev && \
pnpm run link-allo-settings dev

# pnpm run create-program dev
# pnpm run create-qf-contract dev
Expand Down
1 change: 0 additions & 1 deletion docker/start-chain.sh

This file was deleted.