Unix-style command-line params for the 'deposit_contract' binary

This commit is contained in:
Zahary Karadjov 2019-10-29 02:20:47 +02:00
parent 6ceb75c6b3
commit 734ab64da8
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
3 changed files with 11 additions and 8 deletions

View File

@ -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

View File

@ -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()

View File

@ -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