Skip to content

Commit

Permalink
Merge pull request #39 from geniusyield/23-sor-docker-compose
Browse files Browse the repository at this point in the history
SOR | Docker compose#23
  • Loading branch information
4TT1L4 authored Oct 18, 2023
2 parents 230c979 + 8cec301 commit 1fd9fed
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "cardano-configurations"]
path = cardano-configurations
url = https://github.com/input-output-hk/cardano-configurations.git
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ docker run -it \
ghcr.io/geniusyield/smart-order-router:latest
```

And the following commands can be used to start a Kupo backed instance:
And the following commands can be used to start a Kupo backed instance, if you want to use an existing Kupo instance:

``` bash
# SMART ORDER ROUTER INSTANCE USING KUPO
# ======================================
# SMART ORDER ROUTER INSTANCE USING KUPO (existing Kupo instance)
# ===============================================================
# Replace these values with your configuration:
PAYMENT_SIGNING_KEY_CBOR_HEX=5820d682e237a04d43ad011fdecd141acd485f6d3d634466692d58f6d75250f39134
COLLATERAL_UTXO_REF=7cc7b044d26981d3fc73ae72994f289d99ba113ceefb5b83f4d7643bfb12682a#1
Expand All @@ -187,12 +187,20 @@ docker run -it \
-e BOTC_SKEY="{\"cborHex\": \"$PAYMENT_SIGNING_KEY_CBOR_HEX\", \"type\": \"PaymentSigningKeyShelley_ed25519\", \"description\": \"Payment Signing Key\"}" \
-e BOTC_COLLATERAL="$COLLATERAL_UTXO_REF" \
-e BOTC_CONFIG="{\"coreProvider\": { \"socketPath\": \"/cardano/node/socket\", \"kupoUrl\": \"$KUPO_URL\" }, \"networkId\": \"$CARDANO_NETWORK\", \"logging\": [{ \"type\": { \"tag\": \"stderr\" }, \"severity\": \"Info\", \"verbosity\": \"V2\" }], \"utxoCacheEnable\": false }" \
-v $CARDANO_NODE_SOCKET_PATH:/cardano/node/socket
-v $CARDANO_NODE_SOCKET_PATH:/cardano/node/socket \
ghcr.io/geniusyield/smart-order-router:latest
```

> [!NOTE]
> :construction: Coming Soon: docker-compose :construction:
or alternatively you could use docker-compose to start a Cardano node, a Kupo instance and a Smart Order Router instance using the created Kupo instance:

``` bash
# SMART ORDER ROUTER INSTANCE USING KUPO (docker-compose)
# =======================================================
# Replace these values with your configuration:
PAYMENT_SIGNING_KEY_CBOR_HEX=5820d682e237a04d43ad011fdecd141acd485f6d3d634466692d58f6d75250f39134 \
COLLATERAL_UTXO_REF=7cc7b044d26981d3fc73ae72994f289d99ba113ceefb5b83f4d7643bfb12682a#1 \
docker compose up
```

### Local build

Expand Down
1 change: 1 addition & 0 deletions cardano-configurations
Submodule cardano-configurations added at 818b25
49 changes: 49 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: '3.8'
services:
sor:
image: ghcr.io/geniusyield/smart-order-router:latest
container_name: sor
environment:
BOTC_SKEY: |
{"cborHex": "$PAYMENT_SIGNING_KEY_CBOR_HEX", "type": "PaymentSigningKeyShelley_ed25519", "description": "Payment Signing Key"}
BOTC_COLLATERAL: "$COLLATERAL_UTXO_REF"
BOTC_CONFIG: |
{"coreProvider": { "socketPath": "/ipc/node.socket", "kupoUrl": "kupo:1442" }, "networkId": "testnet-preprod", "logging": [{ "type": { "tag": "stderr" }, "severity": "Info", "verbosity": "V2" }]}
restart: always
volumes: [node-ipc:/ipc]
depends_on:
kupo: { condition: service_healthy }
node: { condition: service_healthy }
kupo:
image: cardanosolutions/kupo
container_name: kupo
volumes: [node-ipc:/ipc, ./cardano-configurations/network/preprod:/network/preprod]
ports: ['1442:1442']
depends_on: { node: { condition: service_healthy } }
command: [
--node-socket, /ipc/node.socket,
--since, origin,
--match, "*",
--host, "0.0.0.0",
--node-config, /network/preprod/cardano-node/config.json,
--in-memory,
--prune-utxo,
]
healthcheck:
test: ["CMD", "/bin/kupo", "health-check"]
interval: 30s
timeout: 10s
retries: 100
node:
image: inputoutput/cardano-node
container_name: node
environment: [NETWORK=preprod]
volumes: [node-db:/data/db, node-ipc:/ipc]
healthcheck:
test: ["CMD", "test", "-S", "/ipc/node.socket"]
interval: 30s
timeout: 10s
retries: 100
volumes:
node-db: null
node-ipc: null

0 comments on commit 1fd9fed

Please sign in to comment.