Skip to content

Commit d5d88bb

Browse files
committed
feat: create healthcheck and dependency in docker and make blockfrost-ryo default run
feat: disable blockfrost-js rate limiting
1 parent 0bc50e0 commit d5d88bb

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

.github/workflows/continuous-integration-blockfrost-e2e.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ env:
3030

3131
# Blockfrost enablement
3232
BLOCKFROST_CUSTOM_BACKEND_URL: 'http://blockfrost-ryo:3000'
33+
USE_TYPEORM_ASSET_PROVIDER: 'false'
3334
ASSET_PROVIDER: 'blockfrost'
3435
UTXO_PROVIDER: 'blockfrost'
3536
CHAIN_HISTORY_PROVIDER: 'blockfrost'
@@ -73,7 +74,7 @@ jobs:
7374
- name: 🌐 Setup local test network
7475
working-directory: packages/e2e
7576
run: |
76-
yarn local-network:blockfrost:up -d
77+
yarn local-network:up -d
7778
env:
7879
CARDANO_NODE_CHAINDB_LOG_LEVEL: 'Warning'
7980
CARDANO_NODE_LOG_LEVEL: 'Warning'

compose/common.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ x-provider-server-environment: &provider-server-environment
7878
NETWORK_INFO_PROVIDER: ${NETWORK_INFO_PROVIDER:-dbsync}
7979
TX_SUBMIT_PROVIDER: ${TX_SUBMIT_PROVIDER:-submit-node}
8080
STAKE_POOL_PROVIDER: ${STAKE_POOL_PROVIDER:-dbsync}
81+
USE_TYPEORM_ASSET_PROVIDER: ${USE_TYPEORM_ASSET_PROVIDER:-true}
8182
NETWORK: ${NETWORK:-mainnet}
82-
BLOCKFROST_API_KEY: ${BLOCKFROST_API_KEY}
83-
BLOCKFROST_CUSTOM_BACKEND_URL: ${BLOCKFROST_CUSTOM_BACKEND_URL}
83+
BLOCKFROST_API_KEY: ${BLOCKFROST_API_KEY:-}
84+
BLOCKFROST_CUSTOM_BACKEND_URL: ${BLOCKFROST_CUSTOM_BACKEND_URL:-}
8485

8586
x-sdk-environment: &sdk-environment
8687
LOGGER_MIN_SEVERITY: ${LOGGER_MIN_SEVERITY:-info}
@@ -133,6 +134,8 @@ services:
133134
condition: service_started
134135
ports:
135136
- "3015:3000"
137+
healthcheck:
138+
test: [ 'CMD-SHELL', 'curl -s --fail http://localhost:3000/health' ]
136139

137140
cardano-db-sync:
138141
<<:
@@ -352,6 +355,9 @@ services:
352355
- *provider-server-environment
353356
ports:
354357
- ${API_PORT:-4000}:3000
358+
depends_on:
359+
blockfrost-ryo:
360+
condition: service_healthy
355361

356362
stake-pool-provider-server:
357363
<<:
@@ -380,12 +386,13 @@ services:
380386
depends_on:
381387
asset-projector:
382388
condition: service_healthy
389+
blockfrost-ryo:
390+
condition: service_healthy
383391
environment:
384392
<<:
385393
- *sdk-environment
386394
- *provider-server-environment
387395
SERVICE_NAMES: asset
388-
USE_TYPEORM_ASSET_PROVIDER: true
389396
ports:
390397
- ${HANDLE_API_PORT:-4014}:3000
391398

packages/cardano-services/src/util/BlockfrostProvider/BlockfrostClientFactory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export const getBlockfrostApi = () => {
2929
// network is not mandatory, we keep it for safety.
3030
blockfrostApi = new BlockFrostAPI({
3131
network: process.env.NETWORK as AvailableNetworks,
32-
projectId: process.env.BLOCKFROST_API_KEY
32+
projectId: process.env.BLOCKFROST_API_KEY,
33+
rateLimiter: false
3334
});
3435

3536
return blockfrostApi;

packages/e2e/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ services:
1515
NODE_ENV: local-network
1616
volumes:
1717
- ./local-network/config/network/blockfrost-ryo:/app/config
18-
profiles: [blockfrost-ryo]
1918

2019
local-testnet:
2120
<<: *logging

packages/e2e/local-network/templates/blockfrost-ryo/local-network.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ dbSync:
1212
network: "custom"
1313
genesisDataFolder: '/app/config'
1414
tokenRegistryUrl: "https://tokens.cardano.org"
15+
tokenRegistryEnabled: false

packages/e2e/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@
4646
"test:web-extension:watch": "run-s test:web-extension:build test:web-extension:watch:bg",
4747
"test:web-extension:watch:bg": "run-p test:web-extension:watch:build test:web-extension:watch:run",
4848
"test:ws": "jest -c jest.config.js --forceExit --selectProjects ws-server --runInBand --verbose",
49-
"local-network:common": "DISABLE_DB_CACHE=${DISABLE_DB_CACHE:-true} SUBMIT_API_ARGS='--testnet-magic 888' USE_BLOCKFROST=false __FIX_UMASK__=$(chmod -R a+r ../../compose/placeholder-secrets) docker compose --env-file ../cardano-services/environments/.env.local -p local-network-e2e -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/$(uname -m).yml $FILES --profile ${DOCKER_COMPOSE_PROFILE:-none} up",
49+
"local-network:common": "DISABLE_DB_CACHE=${DISABLE_DB_CACHE:-true} SUBMIT_API_ARGS='--testnet-magic 888' USE_BLOCKFROST=false __FIX_UMASK__=$(chmod -R a+r ../../compose/placeholder-secrets) docker compose --env-file ../cardano-services/environments/.env.local -p local-network-e2e -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/$(uname -m).yml $FILES up",
5050
"local-network:up": "FILES='' yarn local-network:common",
51-
"local-network:blockfrost:up": "FILES='' DOCKER_COMPOSE_PROFILE='blockfrost-ryo' yarn local-network:common",
5251
"local-network:single:up": "FILES='' yarn local-network:common cardano-node file-server local-testnet ogmios postgres",
5352
"local-network:profile:up": "FILES='-f ../../compose/pg-agent.yml' yarn local-network:common",
5453
"local-network:down": "docker compose -p local-network-e2e -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/pg-agent.yml down -v --remove-orphans",

0 commit comments

Comments
 (0)