Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docker): add firefly-core #8

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@

packages = with pkgs; [
alejandra
lld
];

commands = [
44 changes: 42 additions & 2 deletions infra/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
services:
firefly-core:
image: ghcr.io/gytis-ivaskevicius/firefly-core:latest
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we okay with this? this was the easiest way to get image working in this repo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gytis-ivaskevicius will I be able to push updates to that image if necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

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
postgres:
condition: service_healthy
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 +54,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 +77,4 @@ services:
volumes:
connect-contracts:
connect-db:
firefly-db:
48 changes: 48 additions & 0 deletions infra/firefly-core.yaml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to inject this value from the ADDR_FROM environment variable?

Copy link
Contributor Author

@gytis-ivaskevicius gytis-ivaskevicius Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. I was going through firefly helm chart and did not see any firefly config file, so probably it is configured via env variables. Is this a requirement or can we leave it is for time being?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's see if it causes issues in practice before spending too much time on it

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
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
@@ -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