-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: dockerize blockfrost-ryo and enable blockfrost providers in e2e…
… CI tests
- Loading branch information
Showing
17 changed files
with
231 additions
and
20 deletions.
There are no files selected for viewing
111 changes: 111 additions & 0 deletions
111
.github/workflows/continuous-integration-e2e-blockfrost.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: Continuous Integration - E2E (Blockfrost Providers) | ||
|
||
env: | ||
TL_DEPTH: ${{ github.event.pull_request.head.repo.fork && '0' || fromJson(vars.TL_DEPTH) }} | ||
TL_LEVEL: ${{ github.event.pull_request.head.repo.fork && 'info' || vars.TL_LEVEL }} | ||
# ----------------------------------------------------------------------------------------- | ||
KEY_MANAGEMENT_PROVIDER: 'inMemory' | ||
KEY_MANAGEMENT_PARAMS: '{"bip32Ed25519": "Sodium", "accountIndex": 0, "chainId":{"networkId": 0, "networkMagic": 888}, "passphrase":"some_passphrase","mnemonic":"vacant violin soft weird deliver render brief always monitor general maid smart jelly core drastic erode echo there clump dizzy card filter option defense"}' | ||
TEST_CLIENT_ASSET_PROVIDER: 'http' | ||
TEST_CLIENT_ASSET_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4014/"}' | ||
TEST_CLIENT_CHAIN_HISTORY_PROVIDER: 'http' | ||
TEST_CLIENT_CHAIN_HISTORY_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' | ||
DB_SYNC_CONNECTION_STRING: 'postgresql://postgres:doNoUseThisSecret!@localhost:5435/cexplorer' | ||
TEST_CLIENT_HANDLE_PROVIDER: 'http' | ||
TEST_CLIENT_HANDLE_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4011/"}' | ||
STAKE_POOL_CONNECTION_STRING: 'postgresql://postgres:doNoUseThisSecret!@localhost:5435/stake_pool' | ||
STAKE_POOL_TEST_CONNECTION_STRING: 'postgresql://postgres:doNoUseThisSecret!@localhost:5435/stake_pool_test' | ||
TEST_CLIENT_NETWORK_INFO_PROVIDER: 'ws' | ||
TEST_CLIENT_NETWORK_INFO_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' | ||
OGMIOS_URL: 'ws://localhost:1340/' | ||
TEST_CLIENT_REWARDS_PROVIDER: 'http' | ||
TEST_CLIENT_REWARDS_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' | ||
TEST_CLIENT_TX_SUBMIT_PROVIDER: 'http' | ||
TEST_CLIENT_TX_SUBMIT_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' | ||
TEST_CLIENT_UTXO_PROVIDER: 'http' | ||
TEST_CLIENT_UTXO_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' | ||
TEST_CLIENT_STAKE_POOL_PROVIDER: 'http' | ||
TEST_CLIENT_STAKE_POOL_PROVIDER_PARAMS: '{"baseUrl":"http://localhost:4000/"}' | ||
WS_PROVIDER_URL: 'http://localhost:4100/ws' | ||
# enable Blockfrost backed providers, the rest will use defaults | ||
ASSET_PROVIDER: 'blockfrost' | ||
UTXO_PROVIDER: 'blockfrost' | ||
CHAIN_HISTORY_PROVIDER: 'blockfrost' | ||
REWARDS_PROVIDER: 'blockfrost' | ||
NETWORK_INFO_PROVIDER: 'blockfrost' | ||
TX_SUBMIT_PROVIDER: 'blockfrost' | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: ['master'] | ||
tags: ['*.*.*'] | ||
|
||
jobs: | ||
build_and_test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: 📥 Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🧰 Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.12.0 | ||
|
||
- name: 🔨 Build | ||
run: | | ||
yarn install --immutable --inline-builds --mode=skip-build | ||
yarn workspace @cardano-sdk/cardano-services-client build:cjs | ||
yarn workspace @cardano-sdk/cardano-services build:cjs | ||
yarn workspace @cardano-sdk/e2e build:cjs | ||
yarn workspace @cardano-sdk/util-dev build:cjs | ||
docker build --no-cache . | ||
env: | ||
NODE_OPTIONS: '--max_old_space_size=8192' | ||
|
||
- name: 🌐 Setup local test network | ||
working-directory: packages/e2e | ||
run: | | ||
yarn local-network:blockfrost:up -d | ||
env: | ||
CARDANO_NODE_CHAINDB_LOG_LEVEL: 'Warning' | ||
CARDANO_NODE_LOG_LEVEL: 'Warning' | ||
OGMIOS_PORT: '1340' | ||
OGMIOS_URL: 'ws://ogmios:1340' | ||
POSTGRES_PORT: '5435' | ||
|
||
- name: Wait for network init | ||
run: | | ||
yarn workspace @cardano-sdk/e2e wait-for-network-init | ||
- name: 🔬 Test - e2e - wallet at epoch 0 | ||
run: | | ||
yarn workspace @cardano-sdk/e2e test:wallet:epoch0 | ||
yarn workspace @cardano-sdk/e2e test:projection | ||
yarn workspace @cardano-sdk/e2e test:ws | ||
- name: Wait for epoch 3 | ||
run: | | ||
yarn workspace @cardano-sdk/e2e wait-for-network-epoch-3 | ||
- name: 🔬 Test - e2e - wallet at epoch 3 | ||
run: | | ||
yarn workspace @cardano-sdk/e2e test:wallet:epoch3 | ||
yarn workspace @cardano-sdk/e2e test:pg-boss | ||
yarn workspace @cardano-sdk/e2e test:providers | ||
env: | ||
STAKE_POOL_PROVIDER_URL: 'http://localhost:4000/' | ||
|
||
- name: 🔬 Test - e2e - wallet - typeorm stake pool provider | ||
run: | | ||
yarn workspace @cardano-sdk/e2e test:providers -t StakePoolProvider | ||
env: | ||
STAKE_POOL_PROVIDER_URL: 'http://localhost:4010/' | ||
|
||
- name: Dump docker logs | ||
if: ${{ cancelled() || failure() }} | ||
uses: jwalton/gh-docker-logs@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
packages/cardano-services/blockfrost/ryo/local-blockfrost-ryo.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
server: | ||
listenAddress: "0.0.0.0" | ||
port: 3000 | ||
debug: false | ||
dbSync: | ||
host: "postgres" | ||
port: 5432 | ||
database: "cexplorer" | ||
user: "postgres" | ||
password: "doNoUseThisSecret!" | ||
maxConnections: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/e2e/local-network/scripts/prepare_blockfrost_ryo.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
timeUnix=$(cat network-files/run/system_start) | ||
|
||
echo "Update start time in blockfrost genesis file with ${timeUnix}" | ||
|
||
mkdir -p ./config/network/blockfrost-ryo/ | ||
|
||
cp ./templates/blockfrost-ryo/genesis.json ./config/network/blockfrost-ryo/genesis.json | ||
cp ./templates/blockfrost-ryo/byron_genesis.json ./config/network/blockfrost-ryo/byron_genesis.json | ||
cp ./templates/blockfrost-ryo/local-network.yaml ./config/network/blockfrost-ryo/local-network.yaml | ||
|
||
sed -i -E "s/\"system_start\": [0-9]+/\"system_start\": ${timeUnix}/" ./config/network/blockfrost-ryo/genesis.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/e2e/local-network/templates/blockfrost-ryo/byron_genesis.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"epoch_length": 100, | ||
"slot_length": 1, | ||
"safe_zone": 864, | ||
"end_epoch": 0 | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/e2e/local-network/templates/blockfrost-ryo/genesis.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"active_slots_coefficient": 0.05, | ||
"update_quorum": 5, | ||
"max_lovelace_supply": "45000000000000000", | ||
"network_magic": 888, | ||
"epoch_length": 1000, | ||
"system_start": 1000000, | ||
"slots_per_kes_period": 129600, | ||
"slot_length": 0.2, | ||
"max_kes_evolutions": 62, | ||
"security_param": 10 | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/e2e/local-network/templates/blockfrost-ryo/local-network.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
server: | ||
listenAddress: "0.0.0.0" | ||
port: 3000 | ||
debug: true | ||
dbSync: | ||
host: "postgres" | ||
port: 5432 | ||
database: "cexplorer" | ||
user: "postgres" | ||
password: "doNoUseThisSecret!" | ||
maxConnections: 5 | ||
network: "custom" | ||
genesisDataFolder: '/app/config' | ||
tokenRegistryUrl: "https://metadata.cardano-testnet.iohkdev.io" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters