更新 story.sh

This commit is contained in:
smeb_y 2024-08-29 03:03:12 +00:00
parent 7f73152c30
commit 0fa76d7092

View File

@ -158,23 +158,27 @@ function export_validator_key() {
/usr/local/bin/story validator export /usr/local/bin/story validator export
} }
# 创建新的验证器
# 创建新的验证器 # 创建新的验证器
function create_validator() { function create_validator() {
read -p "请输入质押金额(以 wei 为单位): " AMOUNT_TO_STAKE_IN_WEI read -p "请输入质押金额(以 IP 为单位): " AMOUNT_TO_STAKE_IN_IP
AMOUNT_TO_STAKE_IN_WEI=$((AMOUNT_TO_STAKE_IN_IP * 1000000000000000000))
/usr/local/bin/story validator create --stake ${AMOUNT_TO_STAKE_IN_WEI} /usr/local/bin/story validator create --stake ${AMOUNT_TO_STAKE_IN_WEI}
} }
# 质押到现有验证器 # 质押到现有验证器
function stake_to_validator() { function stake_to_validator() {
read -p "请输入验证器公钥Base64格式: " VALIDATOR_PUB_KEY_IN_BASE64 read -p "请输入验证器公钥Base64格式: " VALIDATOR_PUB_KEY_IN_BASE64
read -p "请输入质押金额(以 wei 为单位): " AMOUNT_TO_STAKE_IN_WEI read -p "请输入质押金额(以 IP 为单位): " AMOUNT_TO_STAKE_IN_IP
AMOUNT_TO_STAKE_IN_WEI=$((AMOUNT_TO_STAKE_IN_IP * 1000000000000000000))
/usr/local/bin/story validator stake --validator-pubkey ${VALIDATOR_PUB_KEY_IN_BASE64} --stake ${AMOUNT_TO_STAKE_IN_WEI} /usr/local/bin/story validator stake --validator-pubkey ${VALIDATOR_PUB_KEY_IN_BASE64} --stake ${AMOUNT_TO_STAKE_IN_WEI}
} }
# 取消质押 # 取消质押
function unstake_from_validator() { function unstake_from_validator() {
read -p "请输入验证器公钥Base64格式: " VALIDATOR_PUB_KEY_IN_BASE64 read -p "请输入验证器公钥Base64格式: " VALIDATOR_PUB_KEY_IN_BASE64
read -p "请输入取消质押金额(以 wei 为单位): " AMOUNT_TO_UNSTAKE_IN_WEI read -p "请输入取消质押金额(以 IP 为单位): " AMOUNT_TO_UNSTAKE_IN_IP
AMOUNT_TO_UNSTAKE_IN_WEI=$((AMOUNT_TO_UNSTAKE_IN_IP * 1000000000000000000))
/usr/local/bin/story validator unstake --validator-pubkey ${VALIDATOR_PUB_KEY_IN_BASE64} --unstake ${AMOUNT_TO_UNSTAKE_IN_WEI} /usr/local/bin/story validator unstake --validator-pubkey ${VALIDATOR_PUB_KEY_IN_BASE64} --unstake ${AMOUNT_TO_UNSTAKE_IN_WEI}
} }
@ -182,7 +186,8 @@ function unstake_from_validator() {
function stake_on_behalf() { function stake_on_behalf() {
read -p "请输入委托者公钥Base64格式: " DELEGATOR_PUB_KEY_IN_BASE64 read -p "请输入委托者公钥Base64格式: " DELEGATOR_PUB_KEY_IN_BASE64
read -p "请输入验证器公钥Base64格式: " VALIDATOR_PUB_KEY_IN_BASE64 read -p "请输入验证器公钥Base64格式: " VALIDATOR_PUB_KEY_IN_BASE64
read -p "请输入质押金额(以 wei 为单位): " AMOUNT_TO_STAKE_IN_WEI read -p "请输入质押金额(以 IP 为单位): " AMOUNT_TO_STAKE_IN_IP
AMOUNT_TO_STAKE_IN_WEI=$((AMOUNT_TO_STAKE_IN_IP * 1000000000000000000))
/usr/local/bin/story validator stake-on-behalf --delegator-pubkey ${DELEGATOR_PUB_KEY_IN_BASE64} --validator-pubkey ${VALIDATOR_PUB_KEY_IN_BASE64} --stake ${AMOUNT_TO_STAKE_IN_WEI} /usr/local/bin/story validator stake-on-behalf --delegator-pubkey ${DELEGATOR_PUB_KEY_IN_BASE64} --validator-pubkey ${VALIDATOR_PUB_KEY_IN_BASE64} --stake ${AMOUNT_TO_STAKE_IN_WEI}
} }
@ -190,7 +195,8 @@ function stake_on_behalf() {
function unstake_on_behalf() { function unstake_on_behalf() {
read -p "请输入委托者公钥Base64格式: " DELEGATOR_PUB_KEY_IN_BASE64 read -p "请输入委托者公钥Base64格式: " DELEGATOR_PUB_KEY_IN_BASE64
read -p "请输入验证器公钥Base64格式: " VALIDATOR_PUB_KEY_IN_BASE64 read -p "请输入验证器公钥Base64格式: " VALIDATOR_PUB_KEY_IN_BASE64
read -p "请输入取消质押金额(以 wei 为单位): " AMOUNT_TO_UNSTAKE_IN_WEI read -p "请输入取消质押金额(以 IP 为单位): " AMOUNT_TO_UNSTAKE_IN_IP
AMOUNT_TO_UNSTAKE_IN_WEI=$((AMOUNT_TO_UNSTAKE_IN_IP * 1000000000000000000))
/usr/local/bin/story validator unstake-on-behalf --delegator-pubkey ${DELEGATOR_PUB_KEY_IN_BASE64} --validator-pubkey ${VALIDATOR_PUB_KEY_IN_BASE64} --unstake ${AMOUNT_TO_UNSTAKE_IN_WEI} /usr/local/bin/story validator unstake-on-behalf --delegator-pubkey ${DELEGATOR_PUB_KEY_IN_BASE64} --validator-pubkey ${VALIDATOR_PUB_KEY_IN_BASE64} --unstake ${AMOUNT_TO_UNSTAKE_IN_WEI}
} }
@ -240,4 +246,4 @@ function main_menu() {
# 显示主菜单 # 显示主菜单
check_env_file # 在主菜单之前检查 .env 文件 check_env_file # 在主菜单之前检查 .env 文件
main_menu main_menu