Skip to content

Commit

Permalink
feat: dockerize blockfrost-ryo
Browse files Browse the repository at this point in the history
  • Loading branch information
ginnun committed Sep 12, 2024
1 parent 7539b97 commit 6b2de2e
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 1 deletion.
9 changes: 9 additions & 0 deletions compose/blockfrost-ryo/local-network/blockfrost.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
server:
listenAddress: 0.0.0.0
port: 3000
prometheusMetrics: false
debug: true
network: "custom"
tokenRegistryUrl: "https://metadata.cardano-testnet.iohkdev.io"
mithril:
enabled: false
12 changes: 12 additions & 0 deletions compose/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ x-sdk-environment: &sdk-environment
WEB_SOCKET_API_URL: ws://ws-server:3000/ws

services:
blockfrost-ryo:
build:
context: "https://github.com/ginnun/blockfrost-backend-ryo.git#feat/custom-network-support"
dockerfile: Dockerfile
environment:
BLOCKFROST_CONFIG_SERVER_LISTEN_ADDRESS: 0.0.0.0
depends_on:
cardano-db-sync:
condition: service_started
ports:
- "3015:3000"

cardano-db-sync:
<<:
- *logging
Expand Down
10 changes: 10 additions & 0 deletions packages/e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ x-logging: &logging
max-file: '10'

services:

blockfrost-ryo:
depends_on:
local-testnet:
condition: service_healthy
environment:
NODE_ENV: local-network
volumes:
- ./local-network/config/network/blockfrost-ryo:/app/config

local-testnet:
<<: *logging
build:
Expand Down
4 changes: 3 additions & 1 deletion packages/e2e/local-network/scripts/make-babbage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ for NODE in ${SP_NODES}; do
echo "${ROOT}/${NODE}.sh"
done

echo "Update start time in genesis files"
echo "Update start time in genesis files with ${timeUnix}"
sed_i -E "s/\"startTime\": [0-9]+/\"startTime\": ${timeUnix}/" ${ROOT}/genesis/byron/genesis.json
sed_i -E "s/\"systemStart\": \".*\"/\"systemStart\": \"${timeISO}\"/" ${ROOT}/genesis/shelley/genesis.json

Expand Down Expand Up @@ -359,6 +359,8 @@ cp "${ROOT}"/genesis/shelley/genesis.conway.json ./config/network/genesis/conway

mkdir -p "${ROOT}/run"

echo "${timeUnix}" > "${ROOT}/run/system_start"

echo "#!/usr/bin/env bash" >"${ROOT}/run/all.sh"
echo "" >>"${ROOT}/run/all.sh"
echo "" >>"${ROOT}/run/all.sh"
Expand Down
13 changes: 13 additions & 0 deletions packages/e2e/local-network/scripts/prepare_blockfrost_ryo.sh
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
1 change: 1 addition & 0 deletions packages/e2e/local-network/scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ trap 'kill 0' INT

echo "Run"
./scripts/make-babbage.sh
./scripts/prepare_blockfrost_ryo.sh
./network-files/run/all.sh &

if [ -d /sdk-ipc ] ; then cp -a config/network /sdk-ipc/config ; fi
Expand Down
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 packages/e2e/local-network/templates/blockfrost-ryo/genesis.json
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
}
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"

0 comments on commit 6b2de2e

Please sign in to comment.