-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add a sushiswap stack with contract deployments * Add watcher services * Add a service for the info app * Add instructions to run smoke tests * Use sushi-info-watcher in demo mode * Turn off block prefetching * Fix sushiswap demo instructions * Use release version and add healthcheck in Lotus stack * Wait for Lotus node to start before sushiswap watchers --------- Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
- Loading branch information
1 parent
bccf711
commit 4c72ace
Showing
24 changed files
with
673 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
version: '3.2' | ||
|
||
services: | ||
sushiswap-watcher-db: | ||
restart: unless-stopped | ||
image: postgres:14-alpine | ||
environment: | ||
- POSTGRES_USER=vdbm | ||
- POSTGRES_MULTIPLE_DATABASES=erc20-watcher,sushi-watcher,sushi-info-watcher,erc20-watcher-job-queue,sushi-watcher-job-queue,sushi-info-watcher-job-queue | ||
- POSTGRES_EXTENSION=erc20-watcher-job-queue:pgcrypto,sushi-watcher-job-queue:pgcrypto,sushi-info-watcher-job-queue:pgcrypto | ||
- POSTGRES_PASSWORD=password | ||
command: ["postgres", "-c", "shared_preload_libraries=pg_stat_statements", "-c", "pg_stat_statements.track=all", "-c", "work_mem=2GB"] | ||
volumes: | ||
- ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh | ||
- ../config/postgresql/create-pg-stat-statements.sql:/docker-entrypoint-initdb.d/create-pg-stat-statements.sql | ||
- sushiswap_watcher_db_data:/var/lib/postgresql/data | ||
ports: | ||
- "0.0.0.0:15435:5432" | ||
healthcheck: | ||
test: ["CMD", "nc", "-v", "localhost", "5432"] | ||
interval: 20s | ||
timeout: 5s | ||
retries: 15 | ||
start_period: 10s | ||
shm_size: '8GB' | ||
|
||
erc20-watcher-server: | ||
restart: unless-stopped | ||
depends_on: | ||
sushiswap-watcher-db: | ||
condition: service_healthy | ||
image: cerc/watcher-sushiswap:local | ||
working_dir: /app/packages/erc20-watcher | ||
environment: | ||
- DEBUG=vulcanize:* | ||
command: ["node", "--enable-source-maps", "dist/server.js"] | ||
volumes: | ||
- ../config/watcher-sushiswap/erc20-watcher.toml:/app/packages/erc20-watcher/environments/local.toml | ||
ports: | ||
- "0.0.0.0:3005:3001" | ||
healthcheck: | ||
test: ["CMD", "nc", "-v", "localhost", "3001"] | ||
interval: 20s | ||
timeout: 5s | ||
retries: 15 | ||
start_period: 5s | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
|
||
sushi-watcher-job-runner: | ||
restart: unless-stopped | ||
depends_on: | ||
sushiswap-watcher-db: | ||
condition: service_healthy | ||
lotus-node-1: | ||
condition: service_healthy | ||
image: cerc/watcher-sushiswap:local | ||
working_dir: /app/packages/uni-watcher | ||
environment: | ||
- DEBUG=vulcanize:* | ||
command: ["node", "--enable-source-maps", "dist/job-runner.js"] | ||
volumes: | ||
- ../config/watcher-sushiswap/sushi-watcher.toml:/app/packages/uni-watcher/environments/local.toml | ||
- ../config/watcher-sushiswap/sushi-watcher-test.toml:/app/packages/uni-watcher/environments/test.toml | ||
ports: | ||
- "0.0.0.0:9004:9000" | ||
healthcheck: | ||
test: ["CMD", "nc", "-v", "localhost", "9000"] | ||
interval: 20s | ||
timeout: 5s | ||
retries: 15 | ||
start_period: 5s | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
|
||
sushi-watcher-server: | ||
restart: unless-stopped | ||
depends_on: | ||
sushiswap-watcher-db: | ||
condition: service_healthy | ||
sushi-watcher-job-runner: | ||
condition: service_healthy | ||
image: cerc/watcher-sushiswap:local | ||
env_file: | ||
- ../config/watcher-sushiswap/lotus-params.env | ||
environment: | ||
- DEBUG=vulcanize:* | ||
working_dir: /app/packages/uni-watcher | ||
command: ["node", "--enable-source-maps", "dist/server.js"] | ||
volumes: | ||
- ../config/watcher-sushiswap/sushi-watcher.toml:/app/packages/uni-watcher/environments/local.toml | ||
- ../config/watcher-sushiswap/sushi-watcher-test.toml:/app/packages/uni-watcher/environments/test.toml | ||
ports: | ||
- "0.0.0.0:3003:3003" | ||
- "0.0.0.0:9005:9001" | ||
healthcheck: | ||
test: ["CMD", "nc", "-v", "localhost", "3003"] | ||
interval: 20s | ||
timeout: 5s | ||
retries: 15 | ||
start_period: 5s | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
|
||
sushi-info-watcher-job-runner: | ||
restart: unless-stopped | ||
depends_on: | ||
sushiswap-watcher-db: | ||
condition: service_healthy | ||
erc20-watcher-server: | ||
condition: service_healthy | ||
lotus-node-1: | ||
condition: service_healthy | ||
sushi-watcher-server: | ||
condition: service_healthy | ||
image: cerc/watcher-sushiswap:local | ||
working_dir: /app/packages/uni-info-watcher | ||
environment: | ||
- DEBUG=vulcanize:* | ||
command: ["node", "--enable-source-maps", "dist/job-runner.js"] | ||
volumes: | ||
- ../config/watcher-sushiswap/sushi-info-watcher.toml:/app/packages/uni-info-watcher/environments/local.toml | ||
- ../config/watcher-sushiswap/sushi-info-watcher-test.toml:/app/packages/uni-info-watcher/environments/test.toml | ||
ports: | ||
- "0.0.0.0:9006:9002" | ||
healthcheck: | ||
test: ["CMD", "nc", "-v", "localhost", "9002"] | ||
interval: 20s | ||
timeout: 5s | ||
retries: 15 | ||
start_period: 5s | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
|
||
sushi-info-watcher-server: | ||
restart: unless-stopped | ||
depends_on: | ||
sushiswap-watcher-db: | ||
condition: service_healthy | ||
erc20-watcher-server: | ||
condition: service_healthy | ||
sushi-watcher-server: | ||
condition: service_healthy | ||
sushi-info-watcher-job-runner: | ||
condition: service_healthy | ||
image: cerc/watcher-sushiswap:local | ||
env_file: | ||
- ../config/watcher-sushiswap/lotus-params.env | ||
working_dir: /app/packages/uni-info-watcher | ||
command: ["node", "--enable-source-maps", "dist/server.js"] | ||
volumes: | ||
- ../config/watcher-sushiswap/sushi-info-watcher.toml:/app/packages/uni-info-watcher/environments/local.toml | ||
- ../config/watcher-sushiswap/sushi-info-watcher-test.toml:/app/packages/uni-info-watcher/environments/test.toml | ||
ports: | ||
- "0.0.0.0:3004:3004" | ||
- "0.0.0.0:9007:9003" | ||
healthcheck: | ||
test: ["CMD", "nc", "-v", "localhost", "3004"] | ||
interval: 20s | ||
timeout: 5s | ||
retries: 15 | ||
start_period: 5s | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
|
||
sushiswap-v3-info: | ||
depends_on: | ||
sushi-info-watcher-server: | ||
condition: service_healthy | ||
image: cerc/uniswap-v3-info:local | ||
ports: | ||
- "0.0.0.0:3006:3000" | ||
|
||
# Deploys the core (UniswapV3Factory) contract | ||
sushiswap-v3-core: | ||
image: cerc/sushiswap-v3-core:local | ||
env_file: | ||
- ../config/watcher-sushiswap/lotus-params.env | ||
|
||
# Deploys the periphery (NFPM, token, etc.) contracts | ||
sushiswap-v3-periphery: | ||
image: cerc/sushiswap-v3-periphery:local | ||
env_file: | ||
- ../config/watcher-sushiswap/lotus-params.env | ||
|
||
volumes: | ||
sushiswap_watcher_db_data: |
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,39 @@ | ||
[server] | ||
host = "0.0.0.0" | ||
port = 3001 | ||
mode = "eth_call" | ||
kind = "lazy" | ||
|
||
[metrics] | ||
host = "127.0.0.1" | ||
port = 9000 | ||
[metrics.gql] | ||
port = 9001 | ||
|
||
[database] | ||
type = "postgres" | ||
host = "sushiswap-watcher-db" | ||
port = 5432 | ||
database = "erc20-watcher" | ||
username = "vdbm" | ||
password = "password" | ||
synchronize = true | ||
logging = false | ||
maxQueryExecutionTime = 100 | ||
|
||
[upstream] | ||
[upstream.ethServer] | ||
rpcProviderEndpoint = "http://lotus-node-1:1234/rpc/v1" | ||
rpcClient = true | ||
|
||
[upstream.cache] | ||
name = "requests" | ||
enabled = false | ||
deleteOnStart = false | ||
|
||
[jobQueue] | ||
dbConnectionString = "postgres://vdbm:password@sushiswap-watcher-db:5432/erc20-watcher-job-queue" | ||
maxCompletionLagInSecs = 300 | ||
jobDelayInMilliSecs = 100 | ||
eventsInBatch = 50 | ||
blockDelayInMilliSecs = 2000 |
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 @@ | ||
# Lotus node config | ||
ETH_RPC_ENDPOINT="http://lotus-node-1:1234/rpc/v1" | ||
CHAIN_ID=31415926 | ||
|
||
# From app/data/config/fixturenet-lotus/fund-account.sh | ||
ACCOUNT_PRIVATE_KEY="0xc05fd3613bcd62a4f25e5eba1f464d0b76d74c3f771a7c2f13e26ad6439444b3" |
45 changes: 45 additions & 0 deletions
45
app/data/config/watcher-sushiswap/sushi-info-watcher-test.toml
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,45 @@ | ||
[server] | ||
host = "0.0.0.0" | ||
port = 3004 | ||
# Use mode demo when running watcher locally. | ||
# Mode demo whitelists all tokens so that entity values get updated. | ||
mode = "demo" | ||
|
||
[database] | ||
type = "postgres" | ||
host = "sushiswap-watcher-db" | ||
port = 5432 | ||
database = "sushi-info-watcher" | ||
username = "vdbm" | ||
password = "password" | ||
synchronize = true | ||
logging = false | ||
maxQueryExecutionTime = 100 | ||
|
||
[upstream] | ||
[upstream.ethServer] | ||
rpcProviderEndpoint = "http://lotus-node-1:1234/rpc/v1" | ||
rpcClient = true | ||
|
||
[upstream.cache] | ||
name = "requests" | ||
enabled = false | ||
deleteOnStart = false | ||
|
||
[upstream.uniWatcher] | ||
gqlEndpoint = "http://sushi-watcher-server:3003/graphql" | ||
gqlSubscriptionEndpoint = "ws://sushi-watcher-server:3003/graphql" | ||
|
||
[upstream.tokenWatcher] | ||
gqlEndpoint = "http://erc20-watcher-server:3001/graphql" | ||
gqlSubscriptionEndpoint = "ws://erc20-watcher-server:3001/graphql" | ||
|
||
[jobQueue] | ||
dbConnectionString = "postgres://vdbm:password@sushiswap-watcher-db:5432/sushi-info-watcher-job-queue" | ||
maxCompletionLagInSecs = 300 | ||
jobDelayInMilliSecs = 1000 | ||
eventsInBatch = 50 | ||
subgraphEventsOrder = true | ||
blockDelayInMilliSecs = 2000 | ||
prefetchBlocksInMem = false | ||
prefetchBlockCount = 10 |
Oops, something went wrong.