Skip to content

Commit 240a5da

Browse files
authored
Merge pull request #22 from hyperledger/no-blockfrost-in-ci
feat: use cardano-node directly in CI
2 parents d42cee0 + c5ee8fe commit 240a5da

File tree

6 files changed

+91
-64
lines changed

6 files changed

+91
-64
lines changed

.github/workflows/demo.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ jobs:
1414
- name: Add wallet secret
1515
run: mkdir ./infra/wallet ; echo '${{ secrets.DEMO_WALLET }}' > ./infra/wallet/addr_test1vqhkukz0285zvk0xrwk9jlq0075tx6furuzcjvzpnhtgelsuhhqc4.skey
1616
- name: Start docker-compose
17-
run: docker compose -f ./infra/docker-compose.yaml -p preview up -d --build
18-
env:
19-
BLOCKFROST_KEY: ${{ secrets.BLOCKFROST_KEY }}
17+
run: docker compose -f ./infra/docker-compose.yaml -f ./infra/docker-compose.node.yaml -p preview up -d --build
2018
- name: Add just
2119
uses: extractions/setup-just@v2
2220
- name: Set up Rust
@@ -27,7 +25,7 @@ jobs:
2725
run: rustup target add wasm32-unknown-unknown
2826
- name: Logs
2927
run: |
30-
docker compose -f ./infra/docker-compose.yaml -p preview logs
28+
docker compose -f ./infra/docker-compose.yaml -f ./infra/docker-compose.node.yaml -p preview logs
3129
docker ps -a
3230
- name: Run demo
3331
env:

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ Requires at least Docker Compose version 2.22.0, uses Compose Watch: <https://do
2424
The easier way to get started is to use Docker compose to build your entire cluster.
2525

2626
```
27-
# To compose a cluster
27+
# To compose a cluster using Blockfrost as a backing store
2828
BLOCKFROST_KEY=previewXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX docker compose -f infra/docker-compose.yaml up --build -d
2929
30+
# To create a cluster with a local cardano node (takes longer to spin up)
31+
docker compose -f infra/docker-compose.node.yaml up --build -d
32+
3033
# Watch the build
3134
docker compose watch
3235
```

infra/docker-compose.common.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
services:
2+
firefly-core:
3+
image: ghcr.io/gytis-ivaskevicius/firefly-core:latest
4+
volumes:
5+
- ./firefly-core.yaml:/etc/firefly/firefly.core.yml:ro
6+
ports:
7+
- 5000:5000
8+
- 5101:5101
9+
depends_on:
10+
firefly-cardanoconnect:
11+
condition: service_started
12+
firefly-cardanosigner:
13+
condition: service_started
14+
postgres:
15+
condition: service_healthy
16+
healthcheck:
17+
test:
18+
- CMD
19+
- curl
20+
- --fail
21+
- http://localhost:5000/api/v1/status
22+
interval: 15s
23+
retries: 30
24+
25+
postgres:
26+
image: postgres
27+
environment:
28+
PGDATA: /var/lib/postgresql/data/pgdata
29+
POSTGRES_PASSWORD: f1refly
30+
volumes:
31+
- firefly-db:/var/lib/postgresql/data
32+
ports:
33+
- 5104:5432
34+
healthcheck:
35+
test:
36+
- CMD-SHELL
37+
- pg_isready -U postgres
38+
interval: 5s
39+
timeout: 3s
40+
retries: 12
41+
42+
firefly-cardanosigner:
43+
image: ghcr.io/hyperledger/firefly-cardanosigner:main
44+
build:
45+
context: ..
46+
target: firefly-cardanosigner
47+
develop:
48+
watch:
49+
- action: rebuild
50+
path: ../firefly-cardanosigner
51+
command: ./firefly-cardanosigner --config-file /app/config.yaml
52+
ports:
53+
- 8555:8555
54+
volumes:
55+
- ./wallet:/wallet
56+
- ./signer.yaml:/app/config.yaml
57+
58+
volumes:
59+
firefly-db:

infra/docker-compose.node.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
include:
2+
- docker-compose.common.yaml
13
services:
24
init-node:
3-
image: ghcr.io/input-output-hk/mithril-client:2450.0-c6c7eba
5+
image: ghcr.io/input-output-hk/mithril-client:2506.0-2627f17
46
entrypoint: /app/bin/entrypoint.sh
57
user: "${UID}:${GID}"
68
environment:
@@ -26,5 +28,25 @@ services:
2628
init-node:
2729
condition: service_completed_successfully
2830

31+
firefly-cardanoconnect:
32+
image: ghcr.io/hyperledger/firefly-cardanoconnect:main
33+
build:
34+
context: ..
35+
target: firefly-cardanoconnect
36+
develop:
37+
watch:
38+
- action: rebuild
39+
path: ../firefly-cardanoconnect
40+
command: ./firefly-cardanoconnect --config-file ./config.yaml
41+
environment:
42+
- FIREFLY_CONNECTOR_BLOCKCHAIN_SOCKET=/ipc/node.socket
43+
ports:
44+
- 5018:5018
45+
volumes:
46+
- connect-contracts:/contracts
47+
- connect-db:/db
48+
- ./connect.yaml:/app/config.yaml
49+
- ./ipc:/ipc
50+
2951
volumes:
3052
node-db:

infra/docker-compose.yaml

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,6 @@
1+
include:
2+
- docker-compose.common.yaml
13
services:
2-
firefly-core:
3-
image: ghcr.io/gytis-ivaskevicius/firefly-core:latest
4-
volumes:
5-
- ./firefly-core.yaml:/etc/firefly/firefly.core.yml:ro
6-
ports:
7-
- 5000:5000
8-
- 5101:5101
9-
depends_on:
10-
firefly-cardanoconnect:
11-
condition: service_started
12-
firefly-cardanosigner:
13-
condition: service_started
14-
postgres:
15-
condition: service_healthy
16-
healthcheck:
17-
test:
18-
- CMD
19-
- curl
20-
- --fail
21-
- http://localhost:5000/api/v1/status
22-
interval: 15s
23-
retries: 30
24-
25-
postgres:
26-
image: postgres
27-
environment:
28-
PGDATA: /var/lib/postgresql/data/pgdata
29-
POSTGRES_PASSWORD: f1refly
30-
volumes:
31-
- firefly-db:/var/lib/postgresql/data
32-
ports:
33-
- 5104:5432
34-
healthcheck:
35-
test:
36-
- CMD-SHELL
37-
- pg_isready -U postgres
38-
interval: 5s
39-
timeout: 3s
40-
retries: 12
41-
424
firefly-cardanoconnect:
435
image: ghcr.io/hyperledger/firefly-cardanoconnect:main
446
build:
@@ -58,23 +20,6 @@ services:
5820
- connect-db:/db
5921
- ./connect.yaml:/app/config.yaml
6022

61-
firefly-cardanosigner:
62-
image: ghcr.io/hyperledger/firefly-cardanosigner:main
63-
build:
64-
context: ..
65-
target: firefly-cardanosigner
66-
develop:
67-
watch:
68-
- action: rebuild
69-
path: ../firefly-cardanosigner
70-
command: ./firefly-cardanosigner --config-file /app/config.yaml
71-
ports:
72-
- 8555:8555
73-
volumes:
74-
- ./wallet:/wallet
75-
- ./signer.yaml:/app/config.yaml
76-
7723
volumes:
7824
connect-contracts:
7925
connect-db:
80-
firefly-db:

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
deploy-contract:
2-
cargo run -p firefly-cardano-deploy-contract -- --contract-path ./wasm/simple-tx --firefly-url http://localhost:5000
2+
cargo run -p firefly-cardano-deploy-contract -- --contract-path ./wasm/simple-tx
33
demo: deploy-contract
44
cargo run -p firefly-cardano-demo -- --addr-from $ADDR_FROM --addr-to $ADDR_TO --amount 1000000
55
generate-key:

0 commit comments

Comments
 (0)