Merge pull request #1553 from xChickens/pr_pga_and_wallet

Fix Pangaea DNS zone and update wallet.sh
pull/1554/head pangaea-20190909.1
Christopher Liu 5 years ago committed by GitHub
commit a34c816ebc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      .hmy/wallet.ini
  2. 26
      cmd/client/wallet/generated_wallet.ini.go
  3. 4
      cmd/client/wallet/main.go
  4. 26
      cmd/client/wallet_stress_test/generated_wallet.ini.go
  5. 2
      internal/configs/sharding/pangaea.go
  6. 4
      scripts/node.sh
  7. 75
      scripts/wallet.sh

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

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

@ -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 <action> <params>")
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:")

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

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

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

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

Loading…
Cancel
Save