Closed luisnaranjo733 closed 1 year ago
Came up with some bash regex to parse this from the STDOUT spew Not pretty but a decent workaround for now
# Generate genesis files, tessera keys, ethereum keys, and node keys
function generate_genesis() {
echo "Generating genesis files..."
npx quorum-genesis-tool \
--outputPath ./output \
--consensus qbft \
--chainID 1337 \
--blockperiod 5 \
--requestTimeout 10 \
--epochLength 30000 \
--difficulty 1 \
--gasLimit 0xFFFF \
--coinbase 0x0000000000000000000000000000000000000000 \
--maxCodeSize 64 \
--txnSizeLimit 64 \
--validators 0 \
--members 4 \
--bootnodes 0 \
--accountPassword "" \
--tesseraEnabled true \
--tesseraPassword "" \
--quickstartDevAccounts false
}
GENERATE_GENESIS_OUTPUT=$(generate_genesis)
if [[ $GENERATE_GENESIS_OUTPUT =~ (./output/[-[:digit:]]+)$ ]]; then
GENESIS_DIR=${BASH_REMATCH[1]}
echo "Genesis files generated at $GENESIS_DIR"
else
echo "Failed to find the nested output dir from the genesis tool"
exit 1
fi
Hi @luisnaranjo733, thank you for opening this issue. I have added your suggestion and released it as is in 0.2.9
Just reviewed the changes - this is exactly what I was hoping for
Thank you!
Currently when you run the genesis tool, it allows you to override the output path with user input, but it nests the output inside a subfolder which is named with an arbitrary timestamp (see this line of code)
This seems by design, but it would be great if there was another boolean flag that users could set to bypass this behavior such as
--noOutputTimestamp
By setting this flag, users could tell the genesis tool to skip that nested timestamp folder logic and instead output the files directly into the folder the user has already specified
The reason for this change is that the current default behavior makes it hard to consume the output automatically by a script, because that script would need to parse the STDOUT spew to find the subdir time stamp name