diff --git a/.env b/.env index 8ca8c87..7b02f1a 100644 --- a/.env +++ b/.env @@ -1,13 +1,47 @@ -### DOCKER USAGE +### PROD USAGE VL_DB_DATABASE=database VL_DB_USER=user VL_DB_PASSWORD=password -VL_DB_HOST=host.docker.internal -VL_DB_PORT=5432 -VL_CHAIN_HOST=http://host.docker.internal:8545 -VL_CHAIN_HOST_L2=http://host.docker.internal:8546 -VL_CONFIG_NAME=docker_config -VL_LOGGING_LEVEL=3 +VL_DB_HOST=localhost +VL_DB_PORT=5433 +VL_CHAIN_HOST=https://eth-mainnet.g.alchemy.com/v2/ +VL_CHAIN_HOST_L2=https://arb-mainnet.g.alchemy.com/v2/ +VL_CONFIG_NAME=multi + +### STAGING USAGE +# VL_DB_DATABASE=database +# VL_DB_USER=user +# VL_DB_PASSWORD=password +# VL_DB_HOST=localhost +# VL_DB_PORT=5433 +# VL_CHAIN_HOST=https://eth-mainnet.g.alchemy.com/v2/ +# VL_CHAIN_HOST_L2=https://arb-mainnet.g.alchemy.com/v2/ +# VL_CONFIG_NAME=multi + +### GOERLI USAGE +# VL_DB_DATABASE=database +# VL_DB_USER=user +# VL_DB_PASSWORD=password +# VL_DB_HOST=localhost +# VL_DB_PORT=5433 +# VL_CHAIN_HOST=https://eth-goerli.alchemyapi.io/v2/ +# VL_CHAIN_HOST_L2=https://arb-goerli.g.alchemy.com/v2/ +# VL_CONFIG_NAME=multi_goerli +# VL_LOGGING_LEVEL=3 +# STARTING_BLOCK_GOERLI=5273000 + +### DOCKER USAGE +# VL_DB_DATABASE=database +# VL_DB_USER=user +# VL_DB_PASSWORD=password +# VL_DB_HOST=host.docker.internal +# VL_DB_PORT=5432 +# VL_CHAIN_HOST=http://host.docker.internal:8545 +# VL_CHAIN_HOST_L2=http://host.docker.internal:8546 +# VL_CONFIG_NAME=docker_config +# VL_LOGGING_LEVEL=3 +# STARTING_BLOCK_GOERLI=7810463 +# STARTING_BLOCK_ARB_TESTNET=793614 ### LOCAL USAGE @@ -20,6 +54,7 @@ VL_LOGGING_LEVEL=3 # VL_CHAIN_HOST_L2=http://localhost:8546 # VL_CONFIG_NAME=docker_config # VL_LOGGING_LEVEL=3 +# STARTING_BLOCK_GOERLI=7810463 +# STARTING_BLOCK_ARB_TESTNET=793614 + -STARTING_BLOCK_GOERLI=7810463 -STARTING_BLOCK_ARB_TESTNET=793614 \ No newline at end of file diff --git a/config.js b/config.js index c48d9f8..74c5641 100644 --- a/config.js +++ b/config.js @@ -69,7 +69,7 @@ const goerli = { host: CHAIN_HOST_L1, retries: 15, }, - startingBlock: STARTING_BLOCK_GOERLI, + startingBlock: 5273000, extractors: [ ...makeRawLogExtractors([ BATCH_VOTING_CONTRACT_GOERLI_ADDRESS, @@ -204,10 +204,9 @@ const arbitrumTestnet = { host: CHAIN_HOST_L2, retries: 15, }, - startingBlock: STARTING_BLOCK_ARB_TESTNET, + startingBlock: 154800, extractors: [...makeRawLogExtractors([ARB_TESTNET_POLLING_ADDRESS])], transformers: [arbitrumPollingTransformer(ARB_TESTNET_POLLING_ADDRESS)], - // TODO: I think don't need to run the migrations a second time, remove this: migrations: { mkr: './migrations', }, @@ -261,7 +260,7 @@ const dockerConfig = [ } }, }, - arbitrumTestnet, + { ...arbitrumTestnet, startingBlock: STARTING_BLOCK_ARB_TESTNET }, ]; let config; diff --git a/docker-compose.yml b/docker-compose.yml index 41ef71e..17a2545 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,4 +11,4 @@ services: - POSTGRES_PORT=5432 - POSTGRES_DB=database ports: - - '5432:5432' + - '5433:5432' diff --git a/package.json b/package.json index 705667b..316aac6 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "start-etl": "node -r ./loadenv.js ./node_modules/@makerdao-dux/spock-etl/dist/bin/etl ./config.js", "start-sync": "yarn migrate", "migrate": "node -r ./loadenv.js ./node_modules/@makerdao-dux/spock-etl/dist/bin/migrate ./config.js", - "start-api": "node -r ./loadenv.js ./node_modules/@makerdao-dux/spock-graphql-api/dist/index.js ./config.js &", - "start-all": "yarn migrate && yarn start-api && yarn start-etl", + "start-api": "node -r ./loadenv.js ./node_modules/@makerdao-dux/spock-graphql-api/dist/index.js ./config.js", + "start-all": "yarn migrate && yarn start-api & yarn start-etl", "test": "jest", "test:ci": "./tests/run-tests.sh", "repl": "node --experimental-repl-await -r ./loadenv.js ./repl"