Skip to content

Commit

Permalink
adding profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
rabi-siddique committed Dec 17, 2024
1 parent 505ff0d commit 5ce73f8
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/actions/getActiveVaults/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down
39 changes: 16 additions & 23 deletions .github/workflows/liquidation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}}')
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
34 changes: 28 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 5ce73f8

Please sign in to comment.