Skip to content

Commit

Permalink
Add sanchonetLocal.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
paolino committed Mar 28, 2024
1 parent 1ddbb9e commit ceaf2a6
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/preprodLocalWallet.sh
@@ -0,0 +1,23 @@
#! /usr/bin/env bash
# shellcheck shell=bash

set -euo pipefail

NETWORK=preprod

WALLET_PORT=${WALLET_PORT:=8090}
DATA_DIR=${DATA_DIR:="/node/preprod"}/${NETWORK}
WALLET_DB=${DATA_DIR}/cardano-wallet.db
CARDANO_NODE_SOCKET_PATH=${DATA_DIR}/node.socket
CONFIGS=${CONFIGS:="configs/cardano/${NETWORK}"}

trap ctrl_c INT

cabal run -O0 cardano-wallet-api:exe:cardano-wallet -- serve \
--port ${WALLET_PORT} \
--database ${WALLET_DB} \
--node-socket ${CARDANO_NODE_SOCKET_PATH} \
--testnet ${CONFIGS}/byron-genesis.json \
--listen-address 0.0.0.0 \
--trace-wallet-engine DEBUG \
--trace-ntp-client DEBUG
47 changes: 47 additions & 0 deletions scripts/sanchonetLocal.sh
@@ -0,0 +1,47 @@
#! /usr/bin/env -S nix shell '.#cardano-node' --command bash
# shellcheck shell=bash

set -euo pipefail

NETWORK=sanchonet

WALLET_PORT=${WALLET_PORT:=8090}
DATA_DIR=${DATA_DIR:="ignore-me"}/${NETWORK}
WALLET_DB=${DATA_DIR}/cardano-wallet.db
NODE_DB=${DATA_DIR}/node.db
CARDANO_NODE_SOCKET_PATH=${DATA_DIR}/node.socket
CONFIGS=${CONFIGS:="configs/cardano/${NETWORK}"}

trap ctrl_c INT

cabal run -O0 cardano-wallet:exe:cardano-wallet -- serve \
--port ${WALLET_PORT} \
--database ${WALLET_DB} \
--node-socket ${CARDANO_NODE_SOCKET_PATH} \
--testnet ${CONFIGS}/byron-genesis.json \
--listen-address 0.0.0.0 &


WALLET_ID=$!

cardano-node run \
--topology ${CONFIGS}/topology.json \
--database-path ${NODE_DB}\
--socket-path ${CARDANO_NODE_SOCKET_PATH} \
--config ${CONFIGS}/config.json &

NODE_ID=$!
function ctrl
_c() {
kill "${NODE_ID}"
kill "${WALLET_ID}"
kill "${APP_ID}"
echo "DATA_DIR: ${DATA_DIR}"
echo "WALLET_DB: ${WALLET_DB}"
echo "NODE_DB: ${NODE_DB}"
echo "CARDANO_NODE_SOCKET_PATH: ${CARDANO_NODE_SOCKET_PATH}"
echo "CONFIGS: ${CONFIGS}"
echo "WALLET_PORT: ${WALLET_PORT}"
}

while :; do sleep 2073600; done
21 changes: 21 additions & 0 deletions scripts/sanchonetLocalWallet.sh
@@ -0,0 +1,21 @@
#! /usr/bin/env bash
# shellcheck shell=bash

set -euo pipefail

NETWORK=sanchonet

WALLET_PORT=${WALLET_PORT:=8090}
DATA_DIR=${DATA_DIR:="ignore-me"}/${NETWORK}
WALLET_DB=${DATA_DIR}/cardano-wallet.db
CARDANO_NODE_SOCKET_PATH=${DATA_DIR}/node.socket
CONFIGS=${CONFIGS:="configs/cardano/${NETWORK}"}

trap ctrl_c INT

cabal run -O0 cardano-wallet-api:exe:cardano-wallet -- serve \
--port ${WALLET_PORT} \
--database ${WALLET_DB} \
--node-socket ${CARDANO_NODE_SOCKET_PATH} \
--testnet ${CONFIGS}/byron-genesis.json \
--listen-address 0.0.0.0

0 comments on commit ceaf2a6

Please sign in to comment.