From 734ab64da808ba36f225606a9894a75acba2827f Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Tue, 29 Oct 2019 02:20:47 +0200 Subject: [PATCH] Unix-style command-line params for the 'deposit_contract' binary --- beacon_chain/beacon_node.nim | 1 - beacon_chain/deposit_contract.nim | 14 +++++++++----- scripts/reset_testnet.sh | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/beacon_chain/beacon_node.nim b/beacon_chain/beacon_node.nim index 137cf50d3..87e2c81c0 100644 --- a/beacon_chain/beacon_node.nim +++ b/beacon_chain/beacon_node.nim @@ -18,7 +18,6 @@ import const dataDirValidators = "validators" genesisFile = "genesis.json" - testnetsBaseUrl = "https://raw.githubusercontent.com/status-im/nim-eth2-testnet-data/master/www" hasPrompt = not defined(withoutPrompt) # https://github.com/ethereum/eth2.0-metrics/blob/master/metrics.md#interop-metrics diff --git a/beacon_chain/deposit_contract.nim b/beacon_chain/deposit_contract.nim index 9095d2652..0d1d3d163 100644 --- a/beacon_chain/deposit_contract.nim +++ b/beacon_chain/deposit_contract.nim @@ -14,10 +14,13 @@ type CliConfig = object depositWeb3Url* {. - desc: "URL of the Web3 server to observe Eth1"}: string + desc: "URL of the Web3 server to observe Eth1" + longform: "web3-url" }: string + privateKey* {. desc: "Private key of the controlling account", - defaultValue: ""}: string + defaultValue: "" + longform: "private-key" }: string case cmd* {.command.}: StartUpCommand of deploy: @@ -26,11 +29,12 @@ type of drain: contractAddress* {. desc: "Address of the contract to drain", - defaultValue: ""}: string + defaultValue: "" + longform: "deposit-contract" }: string of sendEth: - toAddress: string - valueEth: string + toAddress {.longform: "to".}: string + valueEth {.longform: "eth".}: string contract(Deposit): proc drain() diff --git a/scripts/reset_testnet.sh b/scripts/reset_testnet.sh index 15fea5a6a..880c14a0f 100755 --- a/scripts/reset_testnet.sh +++ b/scripts/reset_testnet.sh @@ -50,8 +50,8 @@ DOCKER_BEACON_NODE="docker run -v $NETWORK_DIR_ABS:/network_dir -v $DATA_DIR_ABS make deposit_contract if [ "$ETH1_PRIVATE_KEY" != "" ]; then - DEPOSIT_CONTRACT_ADDRESS=$(./build/deposit_contract deploy $WEB3_URL_ARG --privateKey=$ETH1_PRIVATE_KEY) - DEPOSIT_CONTRACT_ADDRESS_ARG="--deposit_contract=$DEPOSIT_CONTRACT_ADDRESS" + DEPOSIT_CONTRACT_ADDRESS=$(./build/deposit_contract deploy $WEB3_URL_ARG --private-key=$ETH1_PRIVATE_KEY) + DEPOSIT_CONTRACT_ADDRESS_ARG="--deposit-contract=$DEPOSIT_CONTRACT_ADDRESS" fi cd docker