diff --git a/.hmy/wallet.ini b/.hmy/wallet.ini index bb9bd54b6..69aa5102a 100644 --- a/.hmy/wallet.ini +++ b/.hmy/wallet.ini @@ -1,23 +1,23 @@ -[default] +[main] bootnode = /ip4/100.26.90.187/tcp/9874/p2p/Qmdfjtk6hPoyrH1zVD9PEH4zfWLo38dP2mDvvKXfh3tnEv bootnode = /ip4/54.213.43.194/tcp/9874/p2p/QmZJJx6AdaoEkGLrYG4JeLCKeCKDjnFz2wfHNHxAqFSGA9 bootnode = /ip4/13.113.101.219/tcp/12019/p2p/QmQayinFSgMMw5cSpDUiD9pQ2WeP6WNmGxpZ6ou3mdVFJX bootnode = /ip4/99.81.170.167/tcp/12019/p2p/QmRVbTpEYup8dSaURZfF6ByrMTSKa4UyUzJhSjahFzRqNj shards = 4 -[default.shard0.rpc] +[main.shard0.rpc] rpc = l0.t.hmny.io:14555 rpc = s0.t.hmny.io:14555 -[default.shard1.rpc] +[main.shard1.rpc] rpc = l1.t.hmny.io:14555 rpc = s1.t.hmny.io:14555 -[default.shard2.rpc] +[main.shard2.rpc] rpc = l2.t.hmny.io:14555 rpc = s2.t.hmny.io:14555 -[default.shard3.rpc] +[main.shard3.rpc] rpc = l3.t.hmny.io:14555 rpc = s3.t.hmny.io:14555 @@ -55,17 +55,17 @@ bootnode = /ip4/52.40.84.2/tcp/9867/p2p/QmZJJx6AdaoEkGLrYG4JeLCKeCKDjnFz2wfHNHxA shards = 4 [pangaea.shard0.rpc] -rpc = l0.pga.hmny.io:14555 -rpc = s0.pga.hmny.io:14555 +rpc = l0.p.hmny.io:14555 +rpc = s0.p.hmny.io:14555 [pangaea.shard1.rpc] -rpc = l1.pga.hmny.io:14555 -rpc = s1.pga.hmny.io:14555 +rpc = l1.p.hmny.io:14555 +rpc = s1.p.hmny.io:14555 [pangaea.shard2.rpc] -rpc = l2.pga.hmny.io:14555 -rpc = s2.pga.hmny.io:14555 +rpc = l2.p.hmny.io:14555 +rpc = s2.p.hmny.io:14555 [pangaea.shard3.rpc] -rpc = l3.pga.hmny.io:14555 -rpc = s3.pga.hmny.io:14555 +rpc = l3.p.hmny.io:14555 +rpc = s3.p.hmny.io:14555 diff --git a/cmd/client/wallet/generated_wallet.ini.go b/cmd/client/wallet/generated_wallet.ini.go index 9e09a3a24..f4b95570d 100644 --- a/cmd/client/wallet/generated_wallet.ini.go +++ b/cmd/client/wallet/generated_wallet.ini.go @@ -1,26 +1,26 @@ package main const ( - defaultWalletIni = `[default] + defaultWalletIni = `[main] bootnode = /ip4/100.26.90.187/tcp/9874/p2p/Qmdfjtk6hPoyrH1zVD9PEH4zfWLo38dP2mDvvKXfh3tnEv bootnode = /ip4/54.213.43.194/tcp/9874/p2p/QmZJJx6AdaoEkGLrYG4JeLCKeCKDjnFz2wfHNHxAqFSGA9 bootnode = /ip4/13.113.101.219/tcp/12019/p2p/QmQayinFSgMMw5cSpDUiD9pQ2WeP6WNmGxpZ6ou3mdVFJX bootnode = /ip4/99.81.170.167/tcp/12019/p2p/QmRVbTpEYup8dSaURZfF6ByrMTSKa4UyUzJhSjahFzRqNj shards = 4 -[default.shard0.rpc] +[main.shard0.rpc] rpc = l0.t.hmny.io:14555 rpc = s0.t.hmny.io:14555 -[default.shard1.rpc] +[main.shard1.rpc] rpc = l1.t.hmny.io:14555 rpc = s1.t.hmny.io:14555 -[default.shard2.rpc] +[main.shard2.rpc] rpc = l2.t.hmny.io:14555 rpc = s2.t.hmny.io:14555 -[default.shard3.rpc] +[main.shard3.rpc] rpc = l3.t.hmny.io:14555 rpc = s3.t.hmny.io:14555 @@ -58,19 +58,19 @@ bootnode = /ip4/52.40.84.2/tcp/9867/p2p/QmZJJx6AdaoEkGLrYG4JeLCKeCKDjnFz2wfHNHxA shards = 4 [pangaea.shard0.rpc] -rpc = l0.pga.hmny.io:14555 -rpc = s0.pga.hmny.io:14555 +rpc = l0.p.hmny.io:14555 +rpc = s0.p.hmny.io:14555 [pangaea.shard1.rpc] -rpc = l1.pga.hmny.io:14555 -rpc = s1.pga.hmny.io:14555 +rpc = l1.p.hmny.io:14555 +rpc = s1.p.hmny.io:14555 [pangaea.shard2.rpc] -rpc = l2.pga.hmny.io:14555 -rpc = s2.pga.hmny.io:14555 +rpc = l2.p.hmny.io:14555 +rpc = s2.p.hmny.io:14555 [pangaea.shard3.rpc] -rpc = l3.pga.hmny.io:14555 -rpc = s3.pga.hmny.io:14555 +rpc = l3.p.hmny.io:14555 +rpc = s3.p.hmny.io:14555 ` ) diff --git a/cmd/client/wallet/main.go b/cmd/client/wallet/main.go index 1fc7534d7..41b94f47a 100644 --- a/cmd/client/wallet/main.go +++ b/cmd/client/wallet/main.go @@ -59,7 +59,7 @@ type AccountState struct { const ( rpcRetry = 3 defaultConfigFile = ".hmy/wallet.ini" - defaultProfile = "default" + defaultProfile = "main" keystoreDir = ".hmy/keystore" ) @@ -144,7 +144,7 @@ func main() { if len(os.Args) < 2 { fmt.Println("Usage:") fmt.Println(" wallet -p profile ") - fmt.Println(" -p profile - Specify the profile of the wallet, either testnet/devnet or others configured. Default is: testnet") + fmt.Println(" -p profile - Specify the profile of the wallet, either main, local, beta, or pangaea. Default is main.") fmt.Println(" The profile is in file:", defaultConfigFile) fmt.Println() fmt.Println("Actions:") diff --git a/cmd/client/wallet_stress_test/generated_wallet.ini.go b/cmd/client/wallet_stress_test/generated_wallet.ini.go index 9e09a3a24..f4b95570d 100644 --- a/cmd/client/wallet_stress_test/generated_wallet.ini.go +++ b/cmd/client/wallet_stress_test/generated_wallet.ini.go @@ -1,26 +1,26 @@ package main const ( - defaultWalletIni = `[default] + defaultWalletIni = `[main] bootnode = /ip4/100.26.90.187/tcp/9874/p2p/Qmdfjtk6hPoyrH1zVD9PEH4zfWLo38dP2mDvvKXfh3tnEv bootnode = /ip4/54.213.43.194/tcp/9874/p2p/QmZJJx6AdaoEkGLrYG4JeLCKeCKDjnFz2wfHNHxAqFSGA9 bootnode = /ip4/13.113.101.219/tcp/12019/p2p/QmQayinFSgMMw5cSpDUiD9pQ2WeP6WNmGxpZ6ou3mdVFJX bootnode = /ip4/99.81.170.167/tcp/12019/p2p/QmRVbTpEYup8dSaURZfF6ByrMTSKa4UyUzJhSjahFzRqNj shards = 4 -[default.shard0.rpc] +[main.shard0.rpc] rpc = l0.t.hmny.io:14555 rpc = s0.t.hmny.io:14555 -[default.shard1.rpc] +[main.shard1.rpc] rpc = l1.t.hmny.io:14555 rpc = s1.t.hmny.io:14555 -[default.shard2.rpc] +[main.shard2.rpc] rpc = l2.t.hmny.io:14555 rpc = s2.t.hmny.io:14555 -[default.shard3.rpc] +[main.shard3.rpc] rpc = l3.t.hmny.io:14555 rpc = s3.t.hmny.io:14555 @@ -58,19 +58,19 @@ bootnode = /ip4/52.40.84.2/tcp/9867/p2p/QmZJJx6AdaoEkGLrYG4JeLCKeCKDjnFz2wfHNHxA shards = 4 [pangaea.shard0.rpc] -rpc = l0.pga.hmny.io:14555 -rpc = s0.pga.hmny.io:14555 +rpc = l0.p.hmny.io:14555 +rpc = s0.p.hmny.io:14555 [pangaea.shard1.rpc] -rpc = l1.pga.hmny.io:14555 -rpc = s1.pga.hmny.io:14555 +rpc = l1.p.hmny.io:14555 +rpc = s1.p.hmny.io:14555 [pangaea.shard2.rpc] -rpc = l2.pga.hmny.io:14555 -rpc = s2.pga.hmny.io:14555 +rpc = l2.p.hmny.io:14555 +rpc = s2.p.hmny.io:14555 [pangaea.shard3.rpc] -rpc = l3.pga.hmny.io:14555 -rpc = s3.pga.hmny.io:14555 +rpc = l3.p.hmny.io:14555 +rpc = s3.p.hmny.io:14555 ` ) diff --git a/internal/configs/sharding/pangaea.go b/internal/configs/sharding/pangaea.go index 709b1a6df..3a40771dc 100644 --- a/internal/configs/sharding/pangaea.go +++ b/internal/configs/sharding/pangaea.go @@ -29,7 +29,7 @@ func (ps pangaeaSchedule) InstanceForEpoch(epoch *big.Int) Instance { } func (ps pangaeaSchedule) BlocksPerEpoch() uint64 { - return 10800 // 1 day with 8 seconds/block + return 2700 // 6 hours with 8 seconds/block } func (ps pangaeaSchedule) CalcEpochNumber(blockNum uint64) *big.Int { diff --git a/scripts/node.sh b/scripts/node.sh index f47caf629..534db9a93 100755 --- a/scripts/node.sh +++ b/scripts/node.sh @@ -173,7 +173,7 @@ beta) ) REL=testnet network_type=testnet - dns_zone= + dns_zone=b.hmny.io ;; pangaea) bootnodes=( @@ -182,7 +182,7 @@ pangaea) ) REL=master network_type=pangaea - dns_zone=pga.hmny.io + dns_zone=p.hmny.io ;; *) err 64 "${network}: invalid network" diff --git a/scripts/wallet.sh b/scripts/wallet.sh index 83987498f..934888c82 100755 --- a/scripts/wallet.sh +++ b/scripts/wallet.sh @@ -2,30 +2,15 @@ BUCKET=pub.harmony.one OS=$(uname -s) -REL=mainnet - -case "$OS" in - Darwin) - FOLDER=release/darwin-x86_64/${REL}/ - BIN=( wallet libbls384_256.dylib libcrypto.1.0.0.dylib libgmp.10.dylib libgmpxx.4.dylib libmcl.dylib ) - ;; - Linux) - FOLDER=release/linux-x86_64/${REL}/ - BIN=( wallet libbls384_256.so libcrypto.so.10 libgmp.so.10 libgmpxx.so.4 libmcl.so ) - ;; - *) - echo "${OS} not supported." - exit 2 - ;; -esac +# formatted with 4 spaces indentation for consistency with wallet binary usage () { cat << EOT Usage: $0 [option] command Options: - -d download all the binaries/config files (do it when updated) - -p profile use the profile for the given network (default [main], beta, pangaea) + -d download all the binaries/config files (must come after network flag) + -p profile use the profile for the given network (main, local, beta, pangaea; default: main) -t equivalent to -p pangaea (deprecated) -h print this help @@ -44,7 +29,10 @@ Commands: --to - The receiver account's address --amount - The amount of token to transfer --shardID - The shard Id for the transfer + --toShardID - The destination shard Id for the transfer" --inputData - Base64-encoded input data to embed in the transaction + --pass - Passphrase of sender's private key + --waitThenBal - Wait after the transfer with colored balances output 8. export - Export account key to a new file --account - Specify the account to export. Empty will export every key. 9. exportPriKey - Export account private key @@ -64,27 +52,60 @@ Commands: EOT } +set_download () { + case "${network}" in + main) + REL=mainnet + ;; + beta) + REL=testnet + ;; + pangaea) + REL=master + ;; + *) + err 64 "${network}: invalid network" + ;; + esac + + case "$OS" in + Darwin) + FOLDER=release/darwin-x86_64/${REL}/ + BIN=( wallet libbls384_256.dylib libcrypto.1.0.0.dylib libgmp.10.dylib libgmpxx.4.dylib libmcl.dylib ) + ;; + Linux) + FOLDER=release/linux-x86_64/${REL}/ + BIN=( wallet libbls384_256.so libcrypto.so.10 libgmp.so.10 libgmpxx.so.4 libmcl.so ) + ;; + *) + echo "${OS} not supported." + exit 2 + ;; + esac +} + do_download () { # clean up old files - for bin in "${BIN[@]}"; do - rm -f ${bin} - done + for bin in "${BIN[@]}"; do + rm -f ${bin} + done # download all the binaries - for bin in "${BIN[@]}"; do - curl http://${BUCKET}.s3.amazonaws.com/${FOLDER}${bin} -o ${bin} - done + for bin in "${BIN[@]}"; do + curl http://${BUCKET}.s3.amazonaws.com/${FOLDER}${bin} -o ${bin} + done - mkdir -p .hmy/keystore - chmod +x wallet + mkdir -p .hmy/keystore + chmod +x wallet } unset network -network=default +network=main while getopts "dp:th" opt; do case ${opt} in d) + set_download do_download exit 0 ;;