From b6d7713214e5fb7497b143d22d1cfd3bee05b256 Mon Sep 17 00:00:00 2001 From: Gytis Ivaskevicius Date: Mon, 20 Jan 2025 15:27:26 +0200 Subject: [PATCH] chore(docker): add firefly-core --- flake.nix | 1 + infra/docker-compose.yaml | 42 ++++++++++++++++++++++++++++++++-- infra/firefly-core.yaml | 48 +++++++++++++++++++++++++++++++++++++++ justfile | 2 +- 4 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 infra/firefly-core.yaml diff --git a/flake.nix b/flake.nix index a3460c5..dc9b92b 100644 --- a/flake.nix +++ b/flake.nix @@ -34,6 +34,7 @@ packages = with pkgs; [ alejandra + lld ]; commands = [ diff --git a/infra/docker-compose.yaml b/infra/docker-compose.yaml index 390b2d4..b904d43 100644 --- a/infra/docker-compose.yaml +++ b/infra/docker-compose.yaml @@ -1,4 +1,42 @@ services: + firefly-core: + image: ghcr.io/blockfrost/firefly-cardano + volumes: + - ./firefly-core.yaml:/etc/firefly/firefly.core.yml:ro + ports: + - 5000:5000 + - 5101:5101 + depends_on: + firefly-cardanoconnect: + condition: service_started + firefly-cardanosigner: + condition: service_started + healthcheck: + test: + - CMD + - curl + - --fail + - http://localhost:5000/api/v1/status + interval: 15s + retries: 30 + + postgres: + image: postgres + environment: + PGDATA: /var/lib/postgresql/data/pgdata + POSTGRES_PASSWORD: f1refly + volumes: + - firefly-db:/var/lib/postgresql/data + ports: + - 5104:5432 + healthcheck: + test: + - CMD-SHELL + - pg_isready -U postgres + interval: 5s + timeout: 3s + retries: 12 + firefly-cardanoconnect: image: ghcr.io/blockfrost/firefly-cardanoconnect:main build: @@ -14,9 +52,8 @@ services: ports: - 5018:5018 volumes: - - ./ipc:/ipc - connect-contracts:/contracts - - connect-db:/db + - ./db:/db - ./connect.yaml:/app/config.yaml firefly-cardanosigner: @@ -38,3 +75,4 @@ services: volumes: connect-contracts: connect-db: + firefly-db: diff --git a/infra/firefly-core.yaml b/infra/firefly-core.yaml new file mode 100644 index 0000000..c7daf3d --- /dev/null +++ b/infra/firefly-core.yaml @@ -0,0 +1,48 @@ +admin: + address: 0.0.0.0 + enabled: true + port: 5101 + publicURL: http://127.0.0.1:5101 +debug: + port: 6060 +event: + dbevents: + bufferSize: 10000 +http: + address: 0.0.0.0 + port: 5000 + publicURL: http://127.0.0.1:5000 +log: + level: debug +metrics: {} +namespaces: + default: default + predefined: + - defaultKey: addr_test1vqhkukz0285zvk0xrwk9jlq0075tx6furuzcjvzpnhtgelsuhhqc4 + description: Default predefined namespace + name: default + plugins: + - database0 + - blockchain0 +plugins: + blockchain: + - cardano: + cardanoconnect: + topic: "0" + url: http://firefly-cardanoconnect:5018 + name: blockchain0 + type: cardano + database: + - name: database0 + postgres: + migrations: + auto: true + url: postgres://postgres:f1refly@postgres:5432?sslmode=disable + type: postgres +spi: + address: 0.0.0.0 + enabled: true + port: 5101 + publicURL: http://127.0.0.1:5101 +ui: + path: ./frontend diff --git a/justfile b/justfile index 1273c88..c9700f9 100644 --- a/justfile +++ b/justfile @@ -1,5 +1,5 @@ deploy-contract: - cargo run -p firefly-cardano-deploy-contract -- --contract-path ./wasm/simple-tx + cargo run -p firefly-cardano-deploy-contract -- --contract-path ./wasm/simple-tx --firefly-url http://localhost:5000 demo: deploy-contract cargo run -p firefly-cardano-demo -- --addr-from $ADDR_FROM --addr-to $ADDR_TO --amount 1000000