Compare commits

...

8 Commits

Author SHA1 Message Date
David Boreham a55b9ebf77 Merge branch 'main' into dboreham/fixturenet-optimism
Former-commit-id: be0a521124
2023-03-27 21:53:45 -06:00
David Boreham 7e019bbc00 Add optimism contracts container
Former-commit-id: 8221289a71
2023-03-26 11:18:36 -06:00
David Boreham bd4c65fe00 Add optimism go code containers
Former-commit-id: 2f1c33c708
2023-03-26 11:13:34 -06:00
David Boreham fe713d26bb Build op-geth container
Former-commit-id: 7a0bb3bdc1
2023-03-26 10:34:45 -06:00
David Boreham ae288cae37 Update readme
Former-commit-id: 8a9d8cd132
2023-03-26 10:21:22 -06:00
David Boreham fb8c0e2580 Merge main
Former-commit-id: 26246755a8
2023-03-26 00:59:39 +00:00
David Boreham 8dc09c215a Merge main
Former-commit-id: 5324c3648e
2023-03-26 00:58:35 +00:00
David Boreham c8347debee Initial version
Former-commit-id: bec4869555
2023-03-23 13:40:42 -06:00
13 changed files with 168 additions and 2 deletions

View File

@ -0,0 +1,54 @@
# Originally from: https://github.com/devcontainers/images/blob/main/src/javascript-node/.devcontainer/Dockerfile
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=18-bullseye
FROM node:${VARIANT}
ARG USERNAME=node
ARG NPM_GLOBAL=/usr/local/share/npm-global
# This container pulls npm packages from a local registry configured via these env vars
ARG CERC_NPM_URL
ARG CERC_NPM_AUTH_TOKEN
# Add NPM global to PATH.
ENV PATH=${NPM_GLOBAL}/bin:${PATH}
RUN \
# Configure global npm install location, use group to adapt to UID/GID changes
if ! cat /etc/group | grep -e "^npm:" > /dev/null 2>&1; then groupadd -r npm; fi \
&& usermod -a -G npm ${USERNAME} \
&& umask 0002 \
&& mkdir -p ${NPM_GLOBAL} \
&& touch /usr/local/etc/npmrc \
&& chown ${USERNAME}:npm ${NPM_GLOBAL} /usr/local/etc/npmrc \
&& chmod g+s ${NPM_GLOBAL} \
&& npm config -g set prefix ${NPM_GLOBAL} \
&& su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \
# Install eslint
&& su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
&& npm cache clean --force > /dev/null 2>&1
# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends jq
# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
# [Optional] Uncomment if you want to install more global node modules
# RUN su node -c "npm install -g <your-package-list-here>"
# Configure the local npm registry
RUN npm config set @cerc-io:registry ${CERC_NPM_URL} \
&& npm config set @lirewine:registry ${CERC_NPM_URL} \
&& npm config set -- ${CERC_NPM_URL}:_authToken ${CERC_NPM_AUTH_TOKEN}
# TODO: the image at this point could be made a base image for several different CLI images
# that install different Node-based CLI commands
# Build TS packages
RUN yarn install && yarn build
# Default command sleeps forever so docker doesn't kill it
CMD ["sh", "-c", "while :; do sleep 600; done"]

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Build cerc/optimism-contracts
# See: https://stackoverflow.com/a/246128/1701505
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
docker build -t cerc/optimism-contracts:local -f ${SCRIPT_DIR}/Dockerfile \
--add-host gitea.local:host-gateway \
--build-arg CERC_NPM_AUTH_TOKEN --build-arg CERC_NPM_URL ${SCRIPT_DIR}

View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
# Build cerc/optimism-l2geth
docker build -t cerc/optimism-l2geth:local ${CERC_REPO_BASE_DIR}/op-geth

View File

@ -0,0 +1,30 @@
FROM golang:1.19.0-alpine3.15 as builder
ARG VERSION=v0.0.0
RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
# build op-batcher with the shared go.mod & go.sum files
COPY ./op-batcher /app/op-batcher
COPY ./op-bindings /app/op-bindings
COPY ./op-node /app/op-node
COPY ./op-service /app/op-service
COPY ./op-signer /app/op-signer
COPY ./go.mod /app/go.mod
COPY ./go.sum /app/go.sum
COPY ./.git /app/.git
WORKDIR /app/op-batcher
RUN go mod download
ARG TARGETOS TARGETARCH
RUN make op-batcher VERSION="$VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH
FROM alpine:3.15
COPY --from=builder /app/op-batcher/bin/op-batcher /usr/local/bin
ENTRYPOINT ["op-batcher"]

View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build cerc/optimism-op-batcher
# TODO: use upstream Dockerfile once its buildx-specific content has been removed
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
docker build -t cerc/optimism-op-batcher:local -f ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/optimism

View File

@ -0,0 +1,28 @@
FROM golang:1.19.0-alpine3.15 as builder
ARG VERSION=v0.0.0
RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
# build op-node with the shared go.mod & go.sum files
COPY ./op-node /app/op-node
COPY ./op-chain-ops /app/op-chain-ops
COPY ./op-service /app/op-service
COPY ./op-bindings /app/op-bindings
COPY ./go.mod /app/go.mod
COPY ./go.sum /app/go.sum
COPY ./.git /app/.git
WORKDIR /app/op-node
RUN go mod download
ARG TARGETOS TARGETARCH
RUN make op-node VERSION="$VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH
FROM alpine:3.15
COPY --from=builder /app/op-node/bin/op-node /usr/local/bin
CMD ["op-node"]

View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build cerc/optimism-op-node
# TODO: use upstream Dockerfile once its buildx-specific content has been removed
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
docker build -t cerc/optimism-op-node:local -f ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/optimism

View File

@ -28,5 +28,8 @@ cerc/builder-js
cerc/keycloak cerc/keycloak
cerc/tx-spammer cerc/tx-spammer
cerc/builder-gerbil cerc/builder-gerbil
cerc/optimism-l2geth
cerc/optimism-op-batcher
cerc/optimism-op-node
cerc/act-runner cerc/act-runner
cerc/act-runner-task-executor cerc/act-runner-task-executor

View File

@ -22,3 +22,4 @@ keycloak
tx-spammer tx-spammer
kubo kubo
foundry foundry
fixturenet-optimism

View File

@ -20,6 +20,8 @@ vulcanize/assemblyscript
cerc-io/eth-probe cerc-io/eth-probe
cerc-io/tx-spammer cerc-io/tx-spammer
dboreham/foundry dboreham/foundry
ethereum-optimism/op-geth
ethereum-optimism/optimism
lirewine/gem lirewine/gem
lirewine/debug lirewine/debug
lirewine/crypto lirewine/crypto

View File

@ -1,9 +1,8 @@
version: "1.0" version: "1.1"
name: fixturenet-eth name: fixturenet-eth
decription: "Ethereum Fixturenet" decription: "Ethereum Fixturenet"
repos: repos:
- cerc-io/go-ethereum - cerc-io/go-ethereum
- cerc-io/tx-spammer
- dboreham/foundry - dboreham/foundry
containers: containers:
- cerc/go-ethereum - cerc/go-ethereum

View File

@ -0,0 +1,4 @@
# fixturenet-eth
Experimental Optimism Fixturenet

View File

@ -0,0 +1,23 @@
version: "1.0"
name: fixturenet-optimism
decription: "Optimism Fixturenet"
repos:
- cerc-io/go-ethereum
- ethereum-optimism/op-geth
- ethereum-optimism/optimism
- cerc-io/tx-spammer
- dboreham/foundry
containers:
- cerc/go-ethereum
- cerc/lighthouse
- cerc/fixturenet-eth-geth
- cerc/fixturenet-eth-lighthouse
- cerc/optimism-l2geth
- cerc/optimism-op-batcher
- cerc/optimism-op-node
- cerc/optimism-contracts
- cerc/foundry
pods:
- fixturenet-eth
- fixturenet-optimism
- foundry