This repository has been archived by the owner on Dec 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script for running local node and dump job (#532)
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 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,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Run a Cardano local node, and the script dump job | ||
# | ||
# Example usage: | ||
# AWS_ACCESS_KEY_ID=<...> \ | ||
# AWS_SECRET_ACCESS_KEY=<...> \ | ||
# AWS_DEFAULT_REGION=<...> \ | ||
# AWS_ENDPOINT_URL=https://s3.devx.iog.io \ | ||
# NODE_DIR=../cardano-node-files \ | ||
# NODE_BIN_DIR=../cardano-node-bin \ | ||
# S3_DUMP_DIR=s3://plutus/mainnet-script-dump/ \ | ||
# LOCAL_DUMP_DIR=../mainnet-script-dump \ | ||
# ./scripts/create-dump.sh | ||
|
||
set -eEuo pipefail | ||
|
||
trap '(kill $pid_node || true); (kill $pid_dump || true); exit' INT TERM QUIT ERR EXIT | ||
|
||
mkdir -p "$NODE_DIR" | ||
mkdir -p "$NODE_BIN_DIR" | ||
mkdir -p "$LOCAL_DUMP_DIR" | ||
|
||
set -x | ||
|
||
# Start running local node | ||
./scripts/cardano-node.sh > /dev/null 2>&1 & | ||
|
||
pid_node=$! | ||
|
||
# If the local node is run for the first time, the config file needs to be downloaded, | ||
# so here we wait until the config file is available. | ||
while ! [ -f "$NODE_DIR"/mainnet-config.json ] | ||
do | ||
sleep 30 | ||
done | ||
|
||
cabal update | ||
# Start the dump job | ||
cabal v2-run plutus-script-evaluation-test:dump-script-events -- --socket-path "$NODE_DIR"/db/node.socket --config "$NODE_DIR"/mainnet-config.json --mainnet --blocks-per-file 10000 --events-per-file 50000 --dir "$LOCAL_DUMP_DIR" & | ||
pid_dump=$! | ||
|
||
echo $pid_node | ||
echo $pid_dump | ||
wait $pid_dump | ||
wait $pid_node |