mirror of
https://git.ghostchain.io/proxmio/ghost-node.git
synced 2025-12-27 03:09:56 +00:00
inital commit, which is clearly not initial
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
42
scripts/bags-generator.sh
Executable file
42
scripts/bags-generator.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
runtime="casper"
|
||||
bags=200
|
||||
|
||||
while getopts r:b:t:e: flag
|
||||
do
|
||||
case "${flag}" in
|
||||
r) runtime=${OPTARG};;
|
||||
b) bags=${OPTARG};;
|
||||
t) total=${OPTARG};;
|
||||
e) existential=${OPTARG};;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -z "$total" ]]; then
|
||||
echo "### ERROR: -t flag (total supply) should be set."
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ -z "$existential" ]]; then
|
||||
echo "### ERROR: -e flag (existential deposit) should be set."
|
||||
exit
|
||||
fi
|
||||
|
||||
echo -e "### ${runtime} runtime will be used with ${bags} bags"
|
||||
echo -e "### while total issuance is ${total} and existential deposit ${existential}"
|
||||
read -p "### Do you want to regenerate 'bags_thresholds.rs' file? (Y/n)? " answer
|
||||
|
||||
if [ $answer != ${answer#[Yy]} ]; then
|
||||
cargo run --package ghost-voter-bags -- \
|
||||
--n-bags=${bags} \
|
||||
--runtime=${runtime} \
|
||||
--output=$PWD/runtime/${runtime}/src/bag_thresholds.rs \
|
||||
--total-issuance=${total} \
|
||||
--minimum-balance=${existential}
|
||||
echo "### Bags generated succefully"
|
||||
else
|
||||
exit
|
||||
fi
|
||||
Reference in New Issue
Block a user