-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MGX-1410] Ferry deposit service (#261)
* Ferry service - ethereum only * make aware of different chains (ethereum/arbitrum) * apply lints * fix minor bugs * fix unit tests * throw when not enought funds to cover tx fee * fix formatting * rework env variables * move deposits to separate file * extract L1Interface * export L2Interface * move L1 & L2 interfaces to separate files * clenup * add docker ignore * default configs for ferry * ferry deposit enabled in docker compose * rename test files * add delay parameter * align tests * align sequencer to contract changes * fixing automatic cancellation
- Loading branch information
1 parent
4607ac7
commit 73f6a6f
Showing
27 changed files
with
39,479 additions
and
46 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
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
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
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 @@ | ||
.git | ||
node_modules | ||
.env* | ||
.vscode | ||
.github | ||
**/Dockerfile | ||
**/build/ | ||
**/dist/ | ||
**/test-results/ | ||
ops | ||
skaffold.yml | ||
README.md | ||
docker-compose* | ||
.gitignore |
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,25 @@ | ||
FROM node:18.20.4 AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json package-lock.json /app/ | ||
RUN npm ci | ||
|
||
COPY . . | ||
RUN npm run build && npm prune --production | ||
|
||
FROM node:18.19-slim | ||
|
||
# Add Tini, according to: https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#handling-kernel-signals | ||
RUN apt-get update && apt-get install -y tini && rm -rf /var/lib/apt/lists/* | ||
ENTRYPOINT ["/usr/bin/tini", "--"] | ||
|
||
ENV NODE_ENV=production | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
COPY --from=build /app/build /app/build | ||
COPY --from=build /app/node_modules /app/node_modules | ||
|
||
CMD ["node", "build/src/index.js"] |
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,23 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"suspicious": { | ||
"noExplicitAny": "off" | ||
}, | ||
"style": { | ||
"noNonNullAssertion": "off" | ||
}, | ||
"correctness": { | ||
"noConstantCondition": "off" | ||
}, | ||
"complexity": { | ||
"noForEach": "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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
services: | ||
eth-ferry-deposit: | ||
restart: unless-stopped | ||
platform: linux/amd64 | ||
image: mangatasolutions/ferry-deposit:local-eth | ||
depends_on: | ||
eth-contracts-deployment: | ||
condition: service_completed_successfully | ||
node-alice: | ||
condition: service_started | ||
build: . | ||
environment: | ||
MANGATA_NODE_URL: ${ETH_FERRY_DEPOSIT_MANGATA_NODE_URL:-wss://collator-01-ws-rococo.mangata.online} | ||
ETH_CHAIN_URL: ${ETH_FERRY_DEPOSIT_CHAIN_URL:-wss://ethereum.publicnode.com} | ||
MANGATA_CONTRACT_ADDRESS: ${ETH_FERRY_MANGATA_CONTRACT_ADDRESS:-0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc} | ||
MNEMONIC: ${ETH_FERRY_DEPOSIT_MNEMONIC} | ||
L1_CHAIN: ${ETH_FERRY_DEPOSIT_L1_CHAIN} | ||
MIN_PROFIT: ${ETH_FERRY_DEPOSIT_MIN_PROFIT} | ||
TX_COST: ${ETH_FERRY_DEPOSIT_TX_COST} | ||
BLOCK_DELAY: ${ETH_FERRY_DEPOSIT_BLOCK_DELAY} |
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,9 @@ | ||
|
||
export MANGATA_NODE_URL=ws://127.0.0.1:9944 | ||
export ETH_CHAIN_URL=http://127.0.0.1:8545 | ||
export MANGATA_CONTRACT_ADDRESS=0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc | ||
export MNEMONIC=0x0b6e18cafb6ed99687ec547bd28139cafdd2bffe70e6b688025de6b445aa5c5b | ||
export L1_CHAIN="Ethereum" | ||
export MIN_PROFIT=1000000000000000000000 | ||
export TX_COST=1000000000000000000000 | ||
export BLOCK_DELAY=0 |
Oops, something went wrong.