diff --git a/.github/actions/getActiveVaults/action.yml b/.github/actions/getActiveVaults/action.yml index 7d9d48f1..97d7d559 100644 --- a/.github/actions/getActiveVaults/action.yml +++ b/.github/actions/getActiveVaults/action.yml @@ -20,7 +20,7 @@ runs: - name: Fetch Active Vaults shell: bash run: | - sleep 360 + sleep 5 result=$(curl -s -X POST http://localhost:3000/ \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ diff --git a/.github/workflows/liquidation.yml b/.github/workflows/liquidation.yml index 89c84c71..8ca224be 100644 --- a/.github/workflows/liquidation.yml +++ b/.github/workflows/liquidation.yml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@v4 - name: Start A3P container - run: docker run -d -p 26657:26657 -p 1317:1317 -p 9090:9090 --name a3p ghcr.io/agoric/agoric-3-proposals:latest + run: docker compose --profile ci up -d a3p - run: corepack enable shell: bash @@ -25,11 +25,10 @@ jobs: - name: Start subql indexer env: - AGORIC_NET: local + AGORIC_NET: ci run: yarn dev - name: Print initial logs of all containers - if: failure() run: | echo "Fetching initial logs for all containers..." containers=$(docker ps --format '{{.ID}}') @@ -38,21 +37,9 @@ jobs: docker logs $container done - - name: Wait for 2 minutes - run: sleep 120 - - - name: Print logs after 2 minutes for all containers - run: | - echo "Fetching logs after 2 minutes for all containers..." - containers=$(docker ps --format '{{.ID}}') - for container in $containers; do - echo "Fetching logs after 2 minutes for container $container..." - docker logs $container - done - - name: Set ATOM Price to 12.34 run: | - docker exec a3p /usr/src/agoric-sdk/packages/agoric-cli/bin/agops oracle setPrice --keys gov1,gov2 --pair ATOM.USD --price 12.34 --keyring-backend=test + docker exec agd /usr/src/agoric-sdk/packages/agoric-cli/bin/agops oracle setPrice --keys gov1,gov2 --pair ATOM.USD --price 12.34 --keyring-backend=test - name: Get active vaults uses: ./.github/actions/getActiveVaults @@ -68,7 +55,7 @@ jobs: userKey: 'gov3' agoricNet: 'local' commandTimeout: '120' - containerName: 'a3p' + containerName: 'agd' - name: Create Vault with 103 Minted and 15 Collateral uses: ./.github/actions/createVault @@ -78,7 +65,7 @@ jobs: userKey: 'gov3' agoricNet: 'local' commandTimeout: '120' - containerName: 'a3p' + containerName: 'agd' - name: Create Vault with 105 Minted and 15 Collateral uses: ./.github/actions/createVault @@ -88,7 +75,13 @@ jobs: userKey: 'gov3' agoricNet: 'local' commandTimeout: '120' - containerName: 'a3p' + containerName: 'agd' + + - name: Get active vaults + uses: ./.github/actions/getActiveVaults + with: + apiUrl: 'http://localhost:3000/' + expectedVaults: 10 - name: Place bid for 90IST uses: ./.github/actions/placeBid @@ -99,7 +92,7 @@ jobs: commandType: 'by-price' agoricNet: 'local' commandTimeout: '120' - containerName: 'a3p' + containerName: 'agd' - name: Place bid for 80IST uses: ./.github/actions/placeBid @@ -110,7 +103,7 @@ jobs: commandType: 'by-discount' agoricNet: 'local' commandTimeout: '120' - containerName: 'a3p' + containerName: 'agd' - name: Place bid for 150IST uses: ./.github/actions/placeBid @@ -121,8 +114,8 @@ jobs: commandType: 'by-discount' agoricNet: 'local' commandTimeout: '120' - containerName: 'a3p' + containerName: 'agd' - name: Set ATOM Price to 9.99 run: | - docker exec a3p /usr/src/agoric-sdk/packages/agoric-cli/bin/agops oracle setPrice --keys gov1,gov2 --pair ATOM.USD --price 9.99 --keyring-backend=test + docker exec agd /usr/src/agoric-sdk/packages/agoric-cli/bin/agops oracle setPrice --keys gov1,gov2 --pair ATOM.USD --price 9.99 --keyring-backend=test diff --git a/docker-compose.yml b/docker-compose.yml index ddd67f4f..e2ecc711 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,11 +14,14 @@ services: interval: 5s timeout: 5s retries: 5 + profiles: + - default + - ci subquery-node: image: subquerynetwork/subql-node-cosmos:v4.2.1 depends_on: - 'postgres': + postgres: condition: service_healthy restart: always environment: @@ -30,27 +33,28 @@ services: volumes: - ./:/app command: - - ${SUB_COMMAND:-} # set SUB_COMMAND env variable to "test" to run tests + - ${SUB_COMMAND:-} - -f=/app - --db-schema=app - --workers=4 - --batch-size=30 - # - --log-level=debug - # - --unfinalized-blocks=true healthcheck: test: ['CMD', 'curl', '-f', 'http://subquery-node:3000/ready'] interval: 3s timeout: 5s retries: 10 + profiles: + - default + - ci graphql-engine: image: onfinality/subql-query:v2.13.0 ports: - 3000:3000 depends_on: - 'postgres': + postgres: condition: service_healthy - 'subquery-node': + subquery-node: condition: service_healthy restart: always environment: @@ -63,3 +67,21 @@ services: - --name=app - --playground - --indexer=http://subquery-node:3000 + profiles: + - default + - ci + + a3p: + image: ghcr.io/agoric/agoric-3-proposals:latest + container_name: agd + ports: + - 26657:26657 + - 1317:1317 + - 9090:9090 + restart: always + profiles: + - ci + +networks: + default: + driver: bridge diff --git a/package.json b/package.json index 4e279de5..fc659b91 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "subql build", "codegen": "subql codegen", "start:docker": "docker-compose pull && docker-compose up --remove-orphans", - "dev": "subql codegen && subql build && docker compose pull && docker compose up --remove-orphans --detach", + "dev": "subql codegen && subql build && docker compose pull && docker compose --profile default up --remove-orphans --detach", "prepack": "rm -rf dist && npm run build", "test": "subql build && subql-node-cosmos test", "prettier:check": "prettier --list-different . --print-width 120", diff --git a/project.ts b/project.ts index a26e2303..5ed79c5d 100644 --- a/project.ts +++ b/project.ts @@ -44,6 +44,12 @@ const networkConfig = { chaintypes: chainTypesU18, startBlock: 1, }, + ci: { + chainId: 'agoriclocal', + endpoint: ['http://a3p:26657'], + chaintypes: chainTypesU18, + startBlock: 1, + }, main: { chainId: 'agoric-3', endpoint: ['https://main-a.rpc.agoric.net:443'],