-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: l2-optimism-bridge to local-infra
- Loading branch information
1 parent
d8de307
commit 0915a32
Showing
67 changed files
with
10,143 additions
and
7,750 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,15 @@ | ||
--- | ||
name: Tests @ l2-bridge-optimism | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- "l2-bridge-optimism/**" | ||
|
||
jobs: | ||
tests: | ||
uses: ./.github/workflows/_tests.yml | ||
with: | ||
path: ./l2-bridge-optimism | ||
secrets: inherit |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,15 @@ | ||
APP_NAME=l2-bridge-optimism | ||
INSTANCE=forta | ||
|
||
HTTP_PORT=3000 | ||
LOG_FORMAT=simple | ||
LOG_LEVEL=debug | ||
ETHEREUM_RPC_URL=https://eth.drpc.com | ||
OPTIMSIM_RPC_URL=https://optimism.drpc.com | ||
|
||
USE_FORTA_RPC_URL=true | ||
|
||
## FORTA compatible env names | ||
NODE_ENV=local | ||
AGENT_GRPC_PORT=50051 | ||
FORTA_CHAIN_ID=10 |
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,2 @@ | ||
generated | ||
proto |
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,14 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], | ||
"plugins": ["@typescript-eslint", "prettier"], | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
}, | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"curly": "error", | ||
"semi": "off" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -6,3 +6,9 @@ forta.config.json | |
*.log | ||
version.json | ||
.DS_Store | ||
/coverage/ | ||
|
||
tools/vendor | ||
bin | ||
|
||
.env |
This file was deleted.
Oops, something went wrong.
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,2 @@ | ||
generated | ||
proto |
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,7 @@ | ||
{ | ||
"semi": false, | ||
"trailingComma": "all", | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"tabWidth": 2 | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,29 +1,35 @@ | ||
# Build stage: compile Typescript to Javascript | ||
FROM node:16.17.1-alpine3.16 AS base | ||
FROM node:20.15.0-alpine3.20 AS base | ||
|
||
FROM base as builder | ||
WORKDIR /app | ||
|
||
COPY package*.json .yarnrc.yml yarn.lock ./ | ||
COPY .yarn/releases ./.yarn/releases/ | ||
RUN yarn install --immutable | ||
WORKDIR /app | ||
|
||
COPY . . | ||
RUN yarn install --immutable && yarn run build | ||
# Build app | ||
RUN yarn run build | ||
|
||
# Final stage: copy compiled Javascript from previous stage and install production dependencies | ||
FROM base as production | ||
LABEL "network.forta.settings.agent-logs.enable"="true" | ||
|
||
ENV APP_NAME=l2-bridge-optimism | ||
ENV NODE_ENV=production | ||
WORKDIR /app | ||
ENV ETHEREUM_RPC_URL=https://optimism.drpc.org | ||
|
||
ENV AGENT_GRPC_PORT=50051 | ||
ENV HTTP_PORT=3000 | ||
ENV LOG_FORMAT=simple | ||
ENV LOG_LEVEL=info | ||
ENV INSTANCE=forta | ||
ENV USE_FORTA_RPC_URL=true | ||
|
||
RUN apk add --no-cache tini=0.19.0-r0 | ||
WORKDIR /app | ||
|
||
COPY package*.json .yarnrc.yml yarn.lock ./ | ||
COPY .yarn/releases ./.yarn/releases/ | ||
COPY package*.json yarn.lock ./ | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/dist ./src | ||
COPY version.json ./ | ||
|
||
ENTRYPOINT ["/sbin/tini", "--"] | ||
CMD ["yarn", "run", "start:prod"] | ||
CMD ["yarn", "run", "start:docker:prod"] |
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,42 @@ | ||
# Makefile | ||
|
||
.PHONY: gen_proto_prod | ||
gen_proto_prod: | ||
# generate js codes via grpc-tools | ||
yarn grpc_tools_node_protoc \ | ||
--js_out=import_style=commonjs,binary:./dist/generated/proto \ | ||
--grpc_out=grpc_js:./dist/generated/proto \ | ||
--plugin=protoc-gen-grpc=./node_modules/.bin/grpc_tools_node_protoc_plugin \ | ||
-I ./src/brief/proto \ | ||
./src/brief/proto/*.proto | ||
|
||
.PHONY: gen_js | ||
gen_js: | ||
# generate js codes via grpc-tools | ||
yarn grpc_tools_node_protoc \ | ||
--js_out=import_style=commonjs,binary:./src/generated/proto \ | ||
--grpc_out=grpc_js:./src/generated/proto \ | ||
--plugin=protoc-gen-grpc=./node_modules/.bin/grpc_tools_node_protoc_plugin \ | ||
--proto_path=./src/brief/proto \ | ||
./src/brief/proto/*.proto | ||
|
||
.PHONY: gen_ts | ||
gen_ts: | ||
# generate d.ts codes | ||
yarn grpc_tools_node_protoc \ | ||
--plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \ | ||
--ts_out=grpc_js:./src/generated/proto \ | ||
--proto_path=./src/brief/proto \ | ||
./src/brief/proto/*.proto | ||
|
||
tools: | ||
cd tools && go mod tidy && go mod vendor && go mod verify && go generate -tags tools | ||
.PHONY: tools | ||
|
||
.PHONY: check_alerts_syntax | ||
check_alerts_syntax: | ||
./bin/promtool check rules ./alerts.yml | ||
|
||
.PHONY: test_alerts | ||
test_alerts: | ||
bin/promtool test rules ./alerts_tests.yml |
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
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,6 @@ | ||
/** @type {import("ts-jest").JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
testPathIgnorePatterns: ['dist'], | ||
} |
Oops, something went wrong.