Skip to content

Commit

Permalink
chore: update docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyar committed Sep 12, 2023
1 parent 7f4edaa commit 8c29760
Show file tree
Hide file tree
Showing 9 changed files with 2,546 additions and 2,316 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ jobs:
- name: Run Matchstick tests
run: yarn test

# integration-test:
# runs-on: ubuntu-20.04
# steps:
# - name: Checkout
# uses: actions/checkout@v2
integration-test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

# - name: Start containers
# run: docker-compose up -d --build
- name: Start containers
run: docker-compose up -d --build

# - name: Run integration tests
# run: docker exec -i subgraph-hardhat-node yarn workspace isolated-pools-subgraph run test:integration
- name: Run integration tests
run: docker exec -i venus-subgraphs-hardhat-1 yarn workspace isolated-pools-subgraph run test:integration

# - name: Stop containers
# if: always()
# run: docker-compose down -v
- name: Stop containers
if: always()
run: docker-compose down -v
3 changes: 2 additions & 1 deletion Dockerfile.hardhat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.14.2-alpine3.14
FROM node:current-alpine3.18

RUN apk add g++ make py3-pip git openssh;

Expand All @@ -11,6 +11,7 @@ COPY package.json /usr/app/package.json
COPY yarn.lock /usr/app/yarn.lock
COPY .yarn /usr/app/.yarn
COPY .yarnrc.yml /usr/app/.yarnrc.yml
COPY mocks /usr/app/mocks
COPY copy_contracts.sh /usr/app/copy_contracts.sh

WORKDIR /usr/app
Expand Down
17 changes: 10 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
version: '3'
services:
graph-node:
image: graphprotocol/graph-node:v0.29.0
image: graphprotocol/graph-node:v0.32.0
ports:
- 8000:8000
- 8001:8001
- 8020:8020
- 8030:8030
- 8040:8040
depends_on:
- hardhat
- ipfs
- postgres
hardhat:
condition: service_healthy
ipfs:
condition: service_started
postgres:
condition: service_started
environment:
postgres_host: postgres
postgres_user: graph-node
postgres_pass: let-me-in
postgres_db: graph-node
ipfs: ipfs:5001
ethereum: hardhat:archive,full:http://hardhat:8545
ethereum: hardhat:http://hardhat:8545
hardhat:
container_name: subgraph-hardhat-node
build:
context: .
dockerfile: Dockerfile.hardhat
Expand Down Expand Up @@ -58,4 +60,5 @@ services:
environment:
POSTGRES_USER: graph-node
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: graph-node
POSTGRES_DB: graph-node
POSTGRES_INITDB_ARGS: '--encoding=UTF-8 --lc-collate=C --lc-ctype=C'
2 changes: 1 addition & 1 deletion hardhat-healthcheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
async function healthCheck() {
const ethers = require('ethers');
const localProvider = new ethers.providers.JsonRpcProvider(`http://localhost:8545`)
const localProvider = new ethers.providers.JsonRpcProvider(`http://hardhat:8545`)
localBlockNum = await localProvider.getBlockNumber();
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@
"@typechain/hardhat": "^6.1.2",
"@types/mocha": "^9.1.1",
"@types/mustache": "^4.2.1",
"@types/node": "^20.6.0",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.40.1",
"@venusprotocol/governance-contracts": "^1.0.0",
"@venusprotocol/isolated-pools": "2.0.0",
"@venusprotocol/oracle": "^1.7.2",
"@venusprotocol/venus-protocol": "^0.6.0",
"@venusprotocol/venus-protocol": "0.6.0",
"assemblyscript": "0.19.23",
"chai": "^4.3.6",
"eslint": "^8.25.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/subgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const deploy = async ({
exec(`yarn workspace ${packageName} run build:local`, root);
exec(`yarn workspace ${packageName} run create:local`, root);
exec(
`npx graph deploy ${subgraphAccount}/${subgraphName} --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020/ --version-label ${Date.now().toString()}`,
`npx graph deploy ${subgraphAccount}/${subgraphName} --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020/ --version-label ${Date.now().toString()}`,
root,
);
await waitForSubgraphToBeSynced(syncDelay);
Expand Down
9 changes: 5 additions & 4 deletions subgraphs/isolated-pools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
"create:docker": "npx graph create venusprotocol/venus-isolated-pools --node http://graph-node:8020/",
"build:docker": "npx graph build --ipfs http://ipfs:5001",
"build:bsc": "npx graph build --ipfs https://api.thegraph.com/ipfs/ ",
"deploy:local": "LOCAL=true npx mustache config/local.json template.yaml > subgraph.yaml && npx graph deploy venusprotocol/venus-isolated-pools --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020/",
"deploy:docker": "npx mustache config/local.json template.yaml > subgraph.yaml && npx graph deploy venusprotocol/venus-isolated-pools --debug --ipfs http://ipfs:5001 --node http://graph-node:8020/",
"deploy:chapel": "npx mustache config/chapel.json template.yaml > subgraph.yaml && npx graph deploy venusprotocol/venus-isolated-pools-chapel --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy:bsc": "npx mustache config/bsc.json template.yaml > subgraph.yaml && npx graph deploy venusprotocol/venus-isolated-pools --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy:local": "LOCAL=true npx mustache config/local.json template.yaml > subgraph.yaml && npx graph deploy venusprotocol/venus-isolated-pools --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020/",
"deploy:docker": "npx mustache config/local.json template.yaml > subgraph.yaml && npx graph deploy venusprotocol/venus-isolated-pools --ipfs http://ipfs:5001 --node http://graph-node:8020/",
"deploy:chapel": "npx mustache config/chapel.json template.yaml > subgraph.yaml && npx graph deploy venusprotocol/venus-isolated-pools-chapel --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy:bsc": "npx mustache config/bsc.json template.yaml > subgraph.yaml && npx graph deploy venusprotocol/venus-isolated-pools --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy:sepolia": "yarn prepare:sepolia && npx graph deploy --studio venus-isolated-pools-sepolia",
"prepare:local": "npx mustache config/local.json template.yaml > subgraph.yaml && npx mustache config/local.json src/constants/config-template > src/constants/config.ts",
"prepare:docker": "yarn prepare:local",
"prepare:chapel": "npx mustache config/chapel.json template.yaml > subgraph.yaml && npx mustache config/chapel.json src/constants/config-template > src/constants/config.ts",
"prepare:bsc": "npx mustache config/bsc.json template.yaml > subgraph.yaml && npx mustache config/bsc.json src/constants/config-template > src/constants/config.ts",
"prepare:sepolia": "npx mustache config/sepolia.json template.yaml > subgraph.yaml && npx mustache config/sepolia.json src/constants/config-template > src/constants/config.ts",
Expand Down
8 changes: 4 additions & 4 deletions subgraphs/isolated-pools/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dataSources:
- name: VToken
file: ../../node_modules/@venusprotocol/isolated-pools/artifacts/contracts/VToken.sol/VToken.json
- name: PriceOracle
file: ../../node_modules/@venusprotocol/oracle/artifacts/contracts/PriceOracle.sol/PriceOracle.json
file: ../../node_modules/@venusprotocol/oracle/artifacts/contracts/ResilientOracle.sol/ResilientOracle.json
- name: BEP20
file: ../../packages/isolated-pools-abis/Bep20.json
- name: PoolLens
Expand Down Expand Up @@ -72,7 +72,7 @@ templates:
- name: PoolLens
file: ../../node_modules/@venusprotocol/isolated-pools/artifacts/contracts/Lens/PoolLens.sol/PoolLens.json
- name: PriceOracle
file: ../../node_modules/@venusprotocol/oracle/artifacts/contracts/PriceOracle.sol/PriceOracle.json
file: ../../node_modules/@venusprotocol/oracle/artifacts/contracts/ResilientOracle.sol/ResilientOracle.json
- name: RewardsDistributor
file: ../../node_modules/@venusprotocol/isolated-pools/artifacts/contracts/Rewards/RewardsDistributor.sol/RewardsDistributor.json
eventHandlers:
Expand All @@ -98,7 +98,7 @@ templates:
handler: handleNewMinLiquidatableCollateral
- event: NewSupplyCap(indexed address,uint256)
handler: handleNewSupplyCap
- event: NewRewardsDistributor(indexed address)
- event: NewRewardsDistributor(indexed address,indexed address)
handler: handleNewRewardsDistributor
- name: VToken
kind: ethereum/contract
Expand All @@ -118,7 +118,7 @@ templates:
- name: VToken
file: ../../node_modules/@venusprotocol/isolated-pools/artifacts/contracts/VToken.sol/VToken.json
- name: PriceOracle
file: ../../node_modules/@venusprotocol/oracle/artifacts/contracts/PriceOracle.sol/PriceOracle.json
file: ../../node_modules/@venusprotocol/oracle/artifacts/contracts/ResilientOracle.sol/ResilientOracle.json
- name: BEP20
file: ../../packages/isolated-pools-abis/Bep20.json
- name: Comptroller
Expand Down
Loading

0 comments on commit 8c29760

Please sign in to comment.