-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set TreatMissingData explict to BREACHING * Add contract abi * Add docker file * Add docker-compose file * Cleanup * Mount volumn as /config * Revert copy contracts * Add a main entrypoint * Fix breaching
- Loading branch information
Showing
11 changed files
with
73 additions
and
27 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,3 @@ | ||
.vscode | ||
packages/operations/config | ||
packages/operations/.env |
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,11 @@ | ||
version: "3" | ||
services: | ||
minitor-service: | ||
image: snowbridge-monitor | ||
build: | ||
context: . | ||
dockerfile: monitor.Dockerfile | ||
command: cron | ||
container_name: snowbridge-monitor-1 | ||
volumes: | ||
- ./packages/operations/config:/config |
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,13 @@ | ||
FROM node:20 | ||
RUN corepack enable | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
RUN pnpm install && pnpm build | ||
RUN rm -rf /app/packages/contracts && rm -rf /app/packages/test && rm -rf /app/packages/test-helpers | ||
|
||
WORKDIR /app/packages/operations | ||
VOLUME /config | ||
ENV DOTENV_CONFIG_PATH=/config/.env | ||
ENTRYPOINT ["node", "./dist/src/main.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 |
---|---|---|
@@ -1,7 +1,18 @@ | ||
# Network config | ||
NODE_ENV=rococo_sepolia | ||
REACT_APP_INFURA_KEY= | ||
|
||
# AWS Config | ||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_REGION=eu-central-1 | ||
BRIDGE_STALE_SNS_TOPIC=arn:aws:sns:eu-central-1:232374692033:PD | ||
ACCOUNT_BALANCE_SNS_TOPIC=arn:aws:sns:eu-central-1:232374692033:PD-WALLET | ||
|
||
# INFURA Key config | ||
REACT_APP_INFURA_KEY= | ||
|
||
# GRAPHQL config | ||
GRAPHQL_API_URL=https://data.snowbridge.network/graphql | ||
|
||
# Scan interval(in minutes) | ||
SCAN_INTERVAL=30 |
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,3 +1,4 @@ | ||
node_modules | ||
dist | ||
.env | ||
config |
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 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import "dotenv/config" | ||
import cron from "node-cron" | ||
import { monitor } from "./monitor" | ||
import { initializeAlarms } from "./alarm" | ||
|
||
if (process.argv.length != 3) { | ||
console.error("Expected one argument with Enum from `start|cron|init`") | ||
process.exit(1) | ||
} | ||
|
||
if (process.argv[2] == "start") { | ||
monitor() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error("Error:", error) | ||
process.exit(1) | ||
}) | ||
} else if (process.argv[2] == "cron") { | ||
let interval = parseInt(process.env["SCAN_INTERVAL"] || "") || 30 | ||
cron.schedule(`*/${interval} * * * *`, monitor) | ||
} else if (process.argv[2] == "init") { | ||
initializeAlarms() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error("Error:", error) | ||
process.exit(1) | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.