Skip to content

Commit

Permalink
prod sync (#4387)
Browse files Browse the repository at this point in the history
* feat: separate router and sequencer admin keys (#4316)

* feat: add nonce to stableswap staging events

* feat: add nonce to v0 stableswap events

* fix: event id

* feat: add nonce field to types

* feat: add nonce to stableswap db migration

* fix: database adapter for stableswap nonce

* chore: add commitlint local setup

* ci: update ci workflow for commitlint

* feat: update subgraph & poller logic with nonce

* feat: rebuild graph-client

* fix: query with bigInt params

* fix: carto poller unit tests

* fix: remove unused checkpoint for asset updates

* fix(test): unit tests for poller

* chore: add code owners (#4318)

* chore: add code owners

* (chore) testing gpg sign

* (chore) test signed commit

* (chore) testing signed commit

* ci: fix syntax

* ci: try different install

* ci: fix commitlint

* ci: validate commit

* feat: graph-client build

* Don't commitlint testnet-prod and prod

* Hot Fix: Update Linea goerli RPC

* Fix: Disable commitlint in testnet-prod

* feat: getSupportedAssets and tests added (#4324)

* feat: getSupportedAssets and tests added

* chore: use a mockable method

* fix(lint): auto fix order problems

* test(fix):  expect

* refactor: renaming

---------

Co-authored-by: Prathmesh Khandelwal <prathmeshkhandelwal83@gmail.com>
Co-authored-by: wanglonghong <wanglonghong4467@gmail.com>

* Fix aggregate root no exist (#4335)

* fix: use received aggregate root

* fix: lint

* feat: should ack and reject (#4336)

* chore: change comparison (#4330)

* Improve logging and refactor (#4337)

* feat: expose nonce api and refactors

* fix(utils):  mock

* test(fix): make optional

* Paginate reading pending txs from the redis cache (#4342)

* feat: implement pagination in the cache

* fix: random sort and keep the first timestamp

* fix: no need to retry within a execution window

* fix: commitlint

* chore: remove console logs

* ci: fix batch size

* feat: refactor sequencer subscriber (#4352)

* feat: dequeued

* feat: try without child process

* chore: remove and refactor

* chore: add dequeued check

* chore: remove conf

* fix: lint

* feat: dont scale with load (#4354)

* feat: dont scale with load

* chore: increase default size

* fix: resolve testnet prod sync conflicts (#4356)

* Testnet prod (#4353)

* ci: commitlint

* ci: db engine

* ci: fix

---------

Co-authored-by: Rahul Sethuram <rahul.eth@icloud.com>

* feat: query if processed root message exists in db

* fix: increase unprocessed root message limit to 100

* ci: commitlint

* fix: expire data check (#4357)

* feat: should not handle transfer status here

* feat: check root message status on db

* Fix commitlint

* fix: commitlint

* fix: message status query

* test: add more unit tests for poller

* test: add unit tests for database

* ci: commitlint

* fix: 4362 save transferid in the messages table (#4364)

* feat: add transfer_id to migration

* feat: zapatos

* fix: convert functions

* fix: unit tests for database

* chore: update graph packages

* ci: commitlint

* ci: set proverBatchSize per chain (#4375)

* chore: update (#4378)

* feat: 4326 scale sequencer http server (#4363)

* Implement new pub and sub tasks for http messages.

* Tune the http pub-sub setup

* Add server to seq TF configs

* Add seq server to build and test config

* Refactor helpers for seq server

* Update seq mq config to add http queue

* fix: Update config handling

* feat: Update unit tests

* fix : correct config

* fix : remove todo

* refactor : Validate http post as per schema

* tests : Update unit tests

* tests : update exclusions

* fix : remove unused imports

* fix: Use fastify body schema validation

* fix: update default ports

* fix: update sequencer url in smoke tests

* fix: sequencer exec data not found in the cache (#4383)

* fix: sequencer exec data not found in the cache (#4383)

* fix: remove unecessary prefetch config setup

* fix: remove unecessary prefetch config setup

* fix: wait until none (#4386)

* fix: wait until none

* fix: slowpath cache issue

* ci: testnet prod sync (#4379)

* feat: separate router and sequencer admin keys (#4316)

* feat: add nonce to stableswap staging events

* feat: add nonce to v0 stableswap events

* fix: event id

* feat: add nonce field to types

* feat: add nonce to stableswap db migration

* fix: database adapter for stableswap nonce

* chore: add commitlint local setup

* ci: update ci workflow for commitlint

* feat: update subgraph & poller logic with nonce

* feat: rebuild graph-client

* fix: query with bigInt params

* fix: carto poller unit tests

* fix: remove unused checkpoint for asset updates

* fix(test): unit tests for poller

* chore: add code owners (#4318)

* chore: add code owners

* (chore) testing gpg sign

* (chore) test signed commit

* (chore) testing signed commit

* ci: fix syntax

* ci: try different install

* ci: fix commitlint

* ci: validate commit

* feat: graph-client build

* Don't commitlint testnet-prod and prod

* Hot Fix: Update Linea goerli RPC

* Fix: Disable commitlint in testnet-prod

* feat: getSupportedAssets and tests added (#4324)

* feat: getSupportedAssets and tests added

* chore: use a mockable method

* fix(lint): auto fix order problems

* test(fix):  expect

* refactor: renaming

---------

Co-authored-by: Prathmesh Khandelwal <prathmeshkhandelwal83@gmail.com>
Co-authored-by: wanglonghong <wanglonghong4467@gmail.com>

* Fix aggregate root no exist (#4335)

* fix: use received aggregate root

* fix: lint

* feat: should ack and reject (#4336)

* chore: change comparison (#4330)

* Improve logging and refactor (#4337)

* feat: expose nonce api and refactors

* fix(utils):  mock

* test(fix): make optional

* Paginate reading pending txs from the redis cache (#4342)

* feat: implement pagination in the cache

* fix: random sort and keep the first timestamp

* fix: no need to retry within a execution window

* fix: commitlint

* chore: remove console logs

* ci: fix batch size

* feat: refactor sequencer subscriber (#4352)

* feat: dequeued

* feat: try without child process

* chore: remove and refactor

* chore: add dequeued check

* chore: remove conf

* fix: lint

* feat: dont scale with load (#4354)

* feat: dont scale with load

* chore: increase default size

* fix: resolve testnet prod sync conflicts (#4356)

* Testnet prod (#4353)

* ci: commitlint

* ci: db engine

* ci: fix

---------

Co-authored-by: Rahul Sethuram <rahul.eth@icloud.com>

* feat: query if processed root message exists in db

* fix: increase unprocessed root message limit to 100

* ci: commitlint

* fix: expire data check (#4357)

* feat: should not handle transfer status here

* feat: check root message status on db

* Fix commitlint

* fix: commitlint

* fix: message status query

* test: add more unit tests for poller

* test: add unit tests for database

* ci: commitlint

* fix: 4362 save transferid in the messages table (#4364)

* feat: add transfer_id to migration

* feat: zapatos

* fix: convert functions

* fix: unit tests for database

* chore: update graph packages

* ci: set proverBatchSize per chain (#4375)

* chore: update (#4378)

* feat: 4326 scale sequencer http server (#4363)

* Implement new pub and sub tasks for http messages.

* Tune the http pub-sub setup

* Add server to seq TF configs

* Add seq server to build and test config

* Refactor helpers for seq server

* Update seq mq config to add http queue

* fix: Update config handling

* feat: Update unit tests

* fix : correct config

* fix : remove todo

* refactor : Validate http post as per schema

* tests : Update unit tests

* tests : update exclusions

* fix : remove unused imports

* fix: Use fastify body schema validation

* fix: update default ports

* fix: update sequencer url in smoke tests

* fix: sequencer exec data not found in the cache (#4383)

* fix: remove unecessary prefetch config setup

---------

Co-authored-by: Rahul Sethuram <rahul@connext.network>
Co-authored-by: Liu <57480598+liu-zhipeng@users.noreply.github.com>
Co-authored-by: Rahul Sethuram <rahul.eth@icloud.com>
Co-authored-by: Sanchay Mittal <sanchaymittal@gmail.com>
Co-authored-by: Prathmesh Khandelwal <201952225@iiitvadodara.ac.in>
Co-authored-by: Prathmesh Khandelwal <prathmeshkhandelwal83@gmail.com>
Co-authored-by: wanglonghong <wanglonghong4467@gmail.com>

* ci: fix tests

* ci: fix smoke test config

* ci: testnet prod (#4388)

* feat: separate router and sequencer admin keys (#4316)

* feat: add nonce to stableswap staging events

* feat: add nonce to v0 stableswap events

* fix: event id

* feat: add nonce field to types

* feat: add nonce to stableswap db migration

* fix: database adapter for stableswap nonce

* chore: add commitlint local setup

* ci: update ci workflow for commitlint

* feat: update subgraph & poller logic with nonce

* feat: rebuild graph-client

* fix: query with bigInt params

* fix: carto poller unit tests

* fix: remove unused checkpoint for asset updates

* fix(test): unit tests for poller

* chore: add code owners (#4318)

* chore: add code owners

* (chore) testing gpg sign

* (chore) test signed commit

* (chore) testing signed commit

* ci: fix syntax

* ci: try different install

* ci: fix commitlint

* ci: validate commit

* feat: graph-client build

* Don't commitlint testnet-prod and prod

* Hot Fix: Update Linea goerli RPC

* Fix: Disable commitlint in testnet-prod

* feat: getSupportedAssets and tests added (#4324)

* feat: getSupportedAssets and tests added

* chore: use a mockable method

* fix(lint): auto fix order problems

* test(fix):  expect

* refactor: renaming

---------

Co-authored-by: Prathmesh Khandelwal <prathmeshkhandelwal83@gmail.com>
Co-authored-by: wanglonghong <wanglonghong4467@gmail.com>

* Fix aggregate root no exist (#4335)

* fix: use received aggregate root

* fix: lint

* feat: should ack and reject (#4336)

* chore: change comparison (#4330)

* Improve logging and refactor (#4337)

* feat: expose nonce api and refactors

* fix(utils):  mock

* test(fix): make optional

* Paginate reading pending txs from the redis cache (#4342)

* feat: implement pagination in the cache

* fix: random sort and keep the first timestamp

* fix: no need to retry within a execution window

* fix: commitlint

* chore: remove console logs

* ci: fix batch size

* feat: refactor sequencer subscriber (#4352)

* feat: dequeued

* feat: try without child process

* chore: remove and refactor

* chore: add dequeued check

* chore: remove conf

* fix: lint

* feat: dont scale with load (#4354)

* feat: dont scale with load

* chore: increase default size

* fix: resolve testnet prod sync conflicts (#4356)

* Testnet prod (#4353)

* ci: commitlint

* ci: db engine

* ci: fix

---------

Co-authored-by: Rahul Sethuram <rahul.eth@icloud.com>

* feat: query if processed root message exists in db

* fix: increase unprocessed root message limit to 100

* ci: commitlint

* fix: expire data check (#4357)

* feat: should not handle transfer status here

* feat: check root message status on db

* Fix commitlint

* fix: commitlint

* fix: message status query

* test: add more unit tests for poller

* test: add unit tests for database

* ci: commitlint

* fix: 4362 save transferid in the messages table (#4364)

* feat: add transfer_id to migration

* feat: zapatos

* fix: convert functions

* fix: unit tests for database

* chore: update graph packages

* ci: set proverBatchSize per chain (#4375)

* chore: update (#4378)

* feat: 4326 scale sequencer http server (#4363)

* Implement new pub and sub tasks for http messages.

* Tune the http pub-sub setup

* Add server to seq TF configs

* Add seq server to build and test config

* Refactor helpers for seq server

* Update seq mq config to add http queue

* fix: Update config handling

* feat: Update unit tests

* fix : correct config

* fix : remove todo

* refactor : Validate http post as per schema

* tests : Update unit tests

* tests : update exclusions

* fix : remove unused imports

* fix: Use fastify body schema validation

* fix: update default ports

* fix: update sequencer url in smoke tests

* fix: sequencer exec data not found in the cache (#4383)

* fix: remove unecessary prefetch config setup

* ci: fix tests

* ci: fix smoke test config

---------

Co-authored-by: Liu <57480598+liu-zhipeng@users.noreply.github.com>
Co-authored-by: Sanchay Mittal <sanchaymittal@gmail.com>
Co-authored-by: preethamr <preethamr@users.noreply.github.com>
Co-authored-by: Prathmesh Khandelwal <201952225@iiitvadodara.ac.in>
Co-authored-by: Prathmesh Khandelwal <prathmeshkhandelwal83@gmail.com>
Co-authored-by: wanglonghong <wanglonghong4467@gmail.com>

* chore: bump chain abstraction

* fix: update tf config for sequncer cname

* fix: sequencer http queue config update

* fix: add auto scaling to seq publisher

* fix: typo and seq health port config change

* feat: testnet prod sync (#4399)

* feat: prod

* feat: pass full images

* feat: enable alarms in testnet staging

* feat: testnet prod alarms

* fix: typos

* chore: update docker build command for mac

* chore: update docker settings for mac

* fix: use the correct server package

* ci: remove deprecated commands (#4385)

* ci: fix job

---------

Co-authored-by: carlomazzaferro <carlo.mazzaferro@gmail.com>
Co-authored-by: just-a-node <eye1717@gmail.com>
Co-authored-by: Rahul Sethuram <rahul@connext.network>
Co-authored-by: Rahul Sethuram <rahul.eth@icloud.com>

---------

Co-authored-by: Liu <57480598+liu-zhipeng@users.noreply.github.com>
Co-authored-by: Sanchay Mittal <sanchaymittal@gmail.com>
Co-authored-by: preethamr <preethamr@users.noreply.github.com>
Co-authored-by: Prathmesh Khandelwal <201952225@iiitvadodara.ac.in>
Co-authored-by: Prathmesh Khandelwal <prathmeshkhandelwal83@gmail.com>
Co-authored-by: wanglonghong <wanglonghong4467@gmail.com>
Co-authored-by: just-a-node <eye1717@gmail.com>
Co-authored-by: carlomazzaferro <carlo.mazzaferro@gmail.com>
  • Loading branch information
9 people authored Jun 6, 2023
1 parent a3caf2d commit 998879a
Show file tree
Hide file tree
Showing 73 changed files with 1,417 additions and 508 deletions.
100 changes: 82 additions & 18 deletions .github/workflows/build-test-deploy.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}~
yarn dlx commitlint --edit $1
3 changes: 2 additions & 1 deletion build-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ yarn
yarn build:all
echo "Build done."

echo "Docker: building sequencer-publisher and sequencer-subscriber images..."
echo "Docker: building sequencer-server, sequencer-publisher and sequencer-subscriber images..."
docker build --tag sequencer-server:latest --file ./docker/sequencer/server/Dockerfile .
docker build --tag sequencer-publisher:latest --file ./docker/sequencer/publisher/Dockerfile .
docker build --tag sequencer-subscriber:latest --file ./docker/sequencer/subscriber/Dockerfile .

Expand Down
28 changes: 23 additions & 5 deletions docker-compose.services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ services:
container_name: router-publisher
depends_on:
- message-queue
- sequencer-publisher
- signer-router
image: ${ROUTER_PUBLISHER_IMAGE}
restart: always
Expand All @@ -26,7 +25,7 @@ services:
container_name: router-subscriber
depends_on:
- message-queue
- sequencer-publisher
- sequencer-server
- signer-router
image: ${ROUTER_SUBSCRIBER_IMAGE}
restart: always
Expand All @@ -47,7 +46,7 @@ services:
container_name: router-executor
depends_on:
- message-queue
- sequencer-publisher
- sequencer-server
- signer-router
image: ${ROUTER_EXECUTOR_IMAGE}
restart: always
Expand Down Expand Up @@ -81,14 +80,33 @@ services:
ports:
- "6379:6379"

sequencer-server:
container_name: sequencer-server
depends_on:
- message-queue
image: ${SEQUENCER_SERVER_IMAGE}
restart: always
ports:
- "8882:8081"
logging:
driver: json-file
options:
max-size: 10m
volumes:
- ${PWD}/docker/sequencer/:/home/node/agents/sequencer/
- ${PWD}/docker/sequencer/config.local.json:/home/node/packages/agents/sequencer/config.json
environment:
GRAPH_1337_ENDPOINT: "http://graph-node-1337:8000/subgraphs/name/connext/nxtp"
GRAPH_1338_ENDPOINT: "http://graph-node-1338:8000/subgraphs/name/connext/nxtp"

sequencer-publisher:
container_name: sequencer-publisher
depends_on:
- message-queue
image: ${SEQUENCER_PUBLISHER_IMAGE}
restart: always
ports:
- "8882:8081"
- "8883:8081"
logging:
driver: json-file
options:
Expand All @@ -107,7 +125,7 @@ services:
image: ${SEQUENCER_SUBSCRIBER_IMAGE}
restart: always
ports:
- "8883:8081"
- "8884:8081"
logging:
driver: json-file
options:
Expand Down
21 changes: 13 additions & 8 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ Config.json located in the root of each project's docker ie (repo-root)/docker/<

- router (pretty much just runs the router as configured).

- integration
- integration

Run everything from the root directory.

Building:
(from the repo root directory):
ex.
```[sudo] bash docker/router/build-router.sh```
Build:

Running:
ex.
```<ENV variables> [sudo] docker run -d --name router nxtp-router```
```
docker build -f docker/sdk-server/Dockerfile -t sdk-server .
```

> NOTE: If you are using an M1/M2 mac, you must provide the flag "`--platform linux/amd64`"! Also if you are using Docker Desktop, make sure you turn ON the "Use Virtualization framework" option in Settings > General and turn OFF the "Use Rosetta for x86/amd64 emulation on Apple Silicon" option in Settings > Features in development.
Run:

```
docker run -it sdk-server
```
8 changes: 6 additions & 2 deletions docker/bin/wait-for-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e
SERVICE="$SERVICE$1"
ROUTER_PUBLISHER="router-publisher"
ROUTER_SUBSCRIBER="router-subscriber"
SEQUENCER_SERVER="sequencer-server"
SEQUENCER_PUBLISHER="sequencer-publisher"
SEQUENCER_SUBSCRIBER="sequencer-subscriber"

Expand All @@ -15,12 +16,15 @@ then
elif [[ "${SERVICE}" == "${ROUTER_SUBSCRIBER}" ]]
then
PORT=8881
elif [[ "${SERVICE}" == "${SEQUENCER_PUBLISHER}" ]]
elif [[ "${SERVICE}" == "${SEQUENCER_SERVER}" ]]
then
PORT=8882
elif [[ "${SERVICE}" == "${SEQUENCER_SUBSCRIBER}" ]]
elif [[ "${SERVICE}" == "${SEQUENCER_PUBLISHER}" ]]
then
PORT=8883
elif [[ "${SERVICE}" == "${SEQUENCER_SUBSCRIBER}" ]]
then
PORT=8884
else
echo "Wrong service name"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion docker/router/config.local.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"logLevel": "debug",
"sequencerUrl": "http://sequencer-publisher:8081",
"sequencerUrl": "http://sequencer-server:8081",
"cartographerUrl": "http://cartographer-api:3000",
"redis": {
"host": "router-cache",
Expand Down
6 changes: 4 additions & 2 deletions docker/sdk-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:18-alpine as node

# ----------------------------------------
# Builds Docker container for nxtp-watcher package.
# Builds Docker container for sdk-server package.

# ----------------------------------------

Expand All @@ -23,6 +23,7 @@ ARG TEMP_DEPS_DIR
COPY .yarn /tmp/build/.yarn/
COPY .yarnrc.yml /tmp/build/
COPY package.json /tmp/build/
COPY packages/examples/sdk-server/package.json /tmp/build/packages/examples/sdk-server/
COPY packages/agents/sdk/package.json /tmp/build/packages/agents/sdk/
COPY packages/adapters/cache/package.json /tmp/build/packages/adapters/cache/
COPY packages/adapters/subgraph/package.json /tmp/build/packages/adapters/subgraph/
Expand All @@ -38,6 +39,7 @@ RUN yarn install

# ----- Copy source and all other files that affect lint, test, build -----
COPY config config/
COPY packages/examples/sdk-server /tmp/build/packages/examples/sdk-server
COPY packages/agents/sdk /tmp/build/packages/agents/sdk
COPY packages/adapters/cache /tmp/build/packages/adapters/cache
COPY packages/adapters/subgraph /tmp/build/packages/adapters/subgraph
Expand Down Expand Up @@ -68,7 +70,7 @@ COPY --from=build --chown=node:node /tmp/build /home/node
# This user is created in the base image with uid and gid = 1000.
USER node

WORKDIR /home/node/packages/agents/sdk
WORKDIR /home/node/packages/examples/sdk-server

EXPOSE 8080

Expand Down
17 changes: 0 additions & 17 deletions docker/sdk-server/conifg.local.json

This file was deleted.

15 changes: 13 additions & 2 deletions docker/sequencer/config.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,22 @@
],
"queues": [
{ "name": "1337", "limit": 5, "queueLimit": 10000, "subscribe": true, "prefetch": 250 },
{ "name": "1338", "limit": 5, "queueLimit": 10000, "subscribe": true, "prefetch": 250 }
{ "name": "1338", "limit": 5, "queueLimit": 10000, "subscribe": true, "prefetch": 250 },
{
"name": "http",
"limit": 1,
"queueLimit": 100000,
"subscribe": true
}
],
"bindings": [
{ "exchange": "sequencerX", "target": "1337", "keys": ["1337"] },
{ "exchange": "sequencerX", "target": "1338", "keys": ["1338"] }
{ "exchange": "sequencerX", "target": "1338", "keys": ["1338"] },
{
"exchange": "sequencerX",
"target": "http",
"keys": ["http"]
}
],
"executerTimeout": 300000,
"publisher": "sequencerX"
Expand Down
84 changes: 84 additions & 0 deletions docker/sequencer/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
FROM node:18-alpine as node

# ----------------------------------------
# Builds Docker container for nxtp-router package.
# @dev configuraion located ./config.json (relative to this file)


# ----------------------------------------

FROM node as build
RUN apk update
RUN apk add git

ENV HOME=/tmp/build \
PATH=/tmp/build/node_modules/.bin:./node_modules/.bin:${PATH}

WORKDIR /tmp/build

ARG TEMP_DEPS_DIR

# ----- Copy only the files that affect yarn install -----
# Allows docker to use cache and skip install if dependencies are unchanged.
# Assumes that ./packages/*/package.json files have been copied to TEMP_DEPS_DIR
# with that same directory structure. build.sh does this.
COPY .yarn /tmp/build/.yarn/
COPY .yarnrc.yml /tmp/build/
COPY package.json /tmp/build/
COPY packages/agents/sequencer/package.json /tmp/build/packages/agents/sequencer/
COPY packages/agents/relayer/package.json /tmp/build/packages/agents/relayer/
COPY packages/adapters/cache/package.json /tmp/build/packages/adapters/cache/
COPY packages/adapters/subgraph/package.json /tmp/build/packages/adapters/subgraph/
COPY packages/adapters/web3signer/package.json /tmp/build/packages/adapters/web3signer/
COPY packages/adapters/txservice/package.json /tmp/build/packages/adapters/txservice/
COPY packages/adapters/relayer/package.json /tmp/build/packages/adapters/relayer/
COPY packages/adapters/database/package.json /tmp/build/packages/adapters/database/
COPY packages/deployments/contracts/package.json /tmp/build/packages/deployments/contracts/
COPY packages/utils/package.json /tmp/build/packages/utils/
COPY yarn.lock /tmp/build/

# ----- Install dependencies -----
# Install dependencies exactly as in the yarn.lock file - no updates.
RUN yarn install

# ----- Copy source and all other files that affect lint, test, build -----
COPY config config/
COPY packages/agents/sequencer /tmp/build/packages/agents/sequencer
COPY packages/agents/relayer /tmp/build/packages/agents/relayer
COPY packages/adapters/cache /tmp/build/packages/adapters/cache
COPY packages/adapters/subgraph /tmp/build/packages/adapters/subgraph
COPY packages/adapters/web3signer /tmp/build/packages/adapters/web3signer
COPY packages/adapters/txservice /tmp/build/packages/adapters/txservice
COPY packages/adapters/relayer /tmp/build/packages/adapters/relayer
COPY packages/adapters/database /tmp/build/packages/adapters/database
COPY packages/deployments/contracts /tmp/build/packages/deployments/contracts/
COPY packages/utils /tmp/build/packages/utils
COPY .eslintignore /tmp/build/
COPY .eslintrc.js /tmp/build/

# ----- Lint, test and build -----
RUN yarn build

# ----------------------------------------
# Copy files to the deployment image.
# ----------------------------------------

FROM node as runtime

ENV NODE_ENV=production \
PORT=8081

ARG COMMIT_HASH
ENV COMMIT_HASH ${COMMIT_HASH:-unknown}

# ----- Copy files required at runtime by the app -----
COPY --from=build --chown=node:node /tmp/build /home/node

# This user is created in the base image with uid and gid = 1000.
USER node

WORKDIR /home/node/packages/agents/sequencer

EXPOSE 8081

CMD ["node", "--trace-warnings", "dist/server.js"]
Loading

0 comments on commit 998879a

Please sign in to comment.