-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from geniusyield/update-docker-compose-to-use-…
…seed-phrase Update docker compose to use payment signing key
- Loading branch information
Showing
6 changed files
with
39 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
MAESTRO_API_KEY=aBcDefghijoXj3v0LB3txySofSPrP3Vf2 | ||
COLLATERAL_UTXO=d235edd34566a425668a4751233dfc2c1cs23b11287340b202c35093433491df#0 | ||
SEED_PHRASE=["road", "road", "road", "road", "road", "anger", "anger", "anger", "anger", "anger", "antenna", "antenna", "antenna", "antenna", "token", "token", "token", "cart", "cart", "cart", "cart", "cart", "cart", "cart"] | ||
STAKE_ADDRESS=stake1uhpdg7r5hjw5u2c59vtdgn3hmcjttlf8hdr5lx7ca5ut6rscues4h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,4 @@ cabal.project.local~ | |
var/ | ||
.envrc | ||
secrets/ | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,23 +66,29 @@ After cloning the repository only a few environment variables must be set. As s | |
# Clone the repository: | ||
git clone [email protected]:geniusyield/market-maker.git | ||
cd market-maker | ||
# TODO: update the following values with your own configuration. | ||
export MAESTRO_API_KEY=aBcDefghijoXj3v0LB3txySofSPrP3Vf2 | ||
export PAYMENT_SIGNING_KEY='{ "type": "PaymentSigningKeyShelley_ed25519", "description": "Payment Signing Key", "cborHex": "4210268dsb870d08s83a4cf6a4408240248ea551a35bb22bf443586c233ae56bc340" }' | ||
export COLLATERAL_UTXO=d235edd34566a425668a4751233dfc2c1cs23b11287340b202c35093433491df#0 | ||
cp ./.env.template ./.env | ||
|
||
# Update the .env files with your own values (including seed phrase and other configuration values): | ||
nano .env | ||
|
||
# Update the docker images: | ||
docker compose pull | ||
# Start the MM bot with your config: | ||
docker compose up | ||
docker compose up -d | ||
# Check the logs: | ||
docker compose logs mm | ||
``` | ||
|
||
As in the example above; the following environment variables must be specified before calling `docker compose up`: | ||
The variables must be specified in the `.env` file before calling `docker compose up -d`: | ||
- `MAESTRO_API_KEY`: The MAINNET API key to be used for accessing the Maestro services. | ||
- `PAYMENT_SIGNING_KEY`: The payment signing key to be used. Please see the [signing key generator](https://github.com/geniusyield/signing-key-generator) for details. | ||
- `COLLATERAL_UTXO`: A suitable UTxO with 5 ADA to be used as collateral UTxO. | ||
- `SEED_PHASE`: The seed phrase to be used. | ||
- `COLLATERAL_UTXO`: A suitable UTxO with 5 ADA to be used as collateral UTxO. (e.g.: `d235edd34566a425668a4751233dfc2c1cs23b11287340b202c35093433491df#0) | ||
- `STAKE_ADDRESS`: The stake address to be used. (e.g.: `stake1uhpdg7r5hjw5u2c59vtdgn3hmcjttlf8hdr5lx7ca5ut6rscues4h) | ||
|
||
For example values plase see the `.env.template` file. | ||
|
||
The configuration values used for these environment variables in the example above are just placeholders. These must be replaced by your own | ||
configuration values. A MAINNET Maestro API key is needed, a payment signing key must be generated and a collateral UTxO must be provided after | ||
configuration values. A MAINNET Maestro API key, a seed phrase and aa collateral UTxO must be provided after | ||
sending funds to the address given by the payment signing key and the (optional) stake address. | ||
|
||
In order to determine this address, you could use `cardano-cli address build`, but you can also just run the market maker - the address will be printed as the first log of "Info" severity: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
#!/bin/bash | ||
echo "Initializing market maker..." | ||
echo $PROVIDER_CONFIG >> ~/config.json | ||
echo $MARKET_MAKER_CONFIG >> ~/market-maker-config.json | ||
echo $PAYMENT_SIGNING_KEY >> ~/payment-signing-key.skey | ||
|
||
if [[ -n "$PAYMENT_SIGNING_KEY" ]]; then | ||
echo " -> Storing payment signing key..." | ||
echo $PAYMENT_SIGNING_KEY >> ~/payment-signing-key.skey | ||
fi | ||
|
||
if [[ "${MODE:=MM}" == "CANCEL" ]]; then | ||
echo "Canceling all the orders..." | ||
set -x | ||
cabal run geniusyield-market-maker-exe -- Cancel ~/config.json ~/market-maker-config.json | ||
else | ||
echo "Starting market maker..." | ||
set -x | ||
cabal run geniusyield-market-maker-exe -- Run ~/config.json ~/market-maker-config.json | ||
fi |