Skip to content

Instantly share code, notes, and snippets.

View stephen-tse's full-sized avatar

Stephen Tse stephen-tse

View GitHub Profile
./hmy --node=https://api.s0.os.hmny.io blockchain validator all | grep one1 | tr -d '",' > all
for x in `cat all`; do ./hmy --node=https://api.s0.os.hmny.io blockchain validator information $x | python -c 'import sys, json; print json.dumps(json.load(sys.stdin))'; done > info
< info python -c $'import sys, json\nfor x in sys.stdin:\n x = json.loads(x)["result"]["validator"]; y = x["availability"]; print "\t".join([x["name"], x["epos-eligibility-status"], str(y["num-blocks-signed"]), str(y["num-blocks-to-sign"]), x["website"], x["details"], x["address"]])' > info.tsv
shard=s0.pga.hmny.io
chain=pangaea
./wallet.sh new # validator
account: one1y2d8my6gfmx8uerttln7ve44k0xepumd4h2ewt
URL: keystore:///home/ec2-user/.hmy/keystore/UTC--2019-12-06T03-57-47.639169586Z--229a7d93484ecc7e646b5fe7e666b5b3cd90f36d
./wallet.sh new # delegator
account: one1lzprzwqsnlp2wajf6smw0mrdjn9qpk8lttjkzx
URL: keystore:///home/ec2-user/.hmy/keystore/UTC--2019-12-06T04-16-35.771556754Z--f8823138109fc2a77649d436e7ec6d94ca00d8ff
# curl -sLO https://harmony.one/wallet.sh && chmod +x wallet.sh && ./wallet.sh -d
# curl -sLO https://harmony.one/node.sh
curl -s https://raw.githubusercontent.com/harmony-one/harmony/master/internal/genesis/genesis.go | grep Address: | cut -d'"' -f2 > accounts1
curl -s https://raw.githubusercontent.com/harmony-one/harmony/master/internal/genesis/foundational.go | cut -d'"' -f2 > accounts2
for x in `cat accounts1 accounts2`; do ./wallet.sh balances -address=$x; done | grep -v ': 0.0000, nonce' | grep -v ': 100.0000,' | grep -B1 Balance | grep -v -- -- | paste - - -d, | awk -F'[ :,]' '{print $3, $12, $15}' # account, shard, balance
(* RapidChain: Scaling Blockchain via Full Sharding *)
(* OmniLedger: A Secure, Scale-Out, Decentralized Ledger via Sharding https://eprint.iacr.org/2017/406.pdf *)
(* ida, kademlia, cross-verify, reshard, bootstrap *)
(* opt: batch, pipeline, sparsify *)
type state (* utxo state: transaction id, row *)
type signature (* public-key signature *)