Skip to content

Instantly share code, notes, and snippets.

View LeoHChen's full-sized avatar
💭
busy building blockchain

Leo Chen LeoHChen

💭
busy building blockchain
View GitHub Profile
@LeoHChen
LeoHChen / gist:a669d4e405443e91d0890e87bc0f3884
Created February 9, 2019 01:37
tets log on libp2p pubsub
Exit status: 130 [17:11] leochen @ MBP15: ~/work/go/src/github.com/harmony-one/harmony [2pd]: Modified, Untracked
$ bin/harmony -libp2p_pd -is_beacon
INFO [02-08|17:12:02.245] Allocated cache and file handles database=./db/harmony_127.0.0.1_9000 cache=16 handles=16
DEBUG[02-08|17:12:02.252] HostV2 is up! port=9000 id=QmXSqoNm1jnwhkFgA46Li39juZBq8U21xjPKn8Y4i4idKH addr=/ip4/0.0.0.0/tcp/9000
INFO [02-08|17:12:02.252] NewHost port=9000 ip=127.0.0.1 self=127.0.0.1:9000 PeerID="<peer.ID Qm*i4idKH>"
INFO [02-08|17:12:02.252] HARMONY multiaddress=/ip4/127.0.0.1/tcp/9000/p2p/QmXSqoNm1jnwhkFgA46Li39juZBq8U21xjPKn8Y4i4idKH
ERROR[02-08|17:12:02.252] AddPeer PeerID is EMPTY
DEBUG[02-08|17:12:02.325] Trie cache stats after commit misses=0 unloads=0
INFO [02-08|17:12:02.325] Persisted trie from memory database nodes=131 size=20.62kB time=511.246µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
I
@LeoHChen
LeoHChen / wallet.log
Created April 16, 2019 08:17
local wallet test log on multi-shard clients
$ ./bin/wallet -p local balances
Using local profile for wallet
Account 0:
Address: 0x60462b31851670D6d7F51bd56C3ac45CC894F9FA
Balance in Shard 0: 0.0000, nonce: 0
Balance in Shard 1: 0.0000, nonce: 0
Balance in Shard 2: 0.0000, nonce: 0
Balance in Shard 3: 0.0000, nonce: 0
Account 1:
Address: 0xC4B8c5c851BED87f50Fb841ef9BaB08773360Bb0
@LeoHChen
LeoHChen / keybase.md
Created December 2, 2019 23:28
keybase.md

Keybase proof

I hereby claim:

  • I am LeoHChen on github.
  • I am tqhh (https://keybase.io/tqhh) on keybase.
  • I have a public key whose fingerprint is EFD8 09C2 9867 3FAE 4096 D677 96B4 8BDA C8A4 C669

To claim this, I am signing this object:

@LeoHChen
LeoHChen / upgrade-one-node.sh
Created April 30, 2020 03:58
upgrade a node in OSTN
# login to devop machine
cd /home/ec2-user/go/src/github.com/harmony-one/harmony
# make sure you have the right branch, right code, you need to test on OSTN
make linux_static
# check the version of your build
bin/harmony --version
@LeoHChen
LeoHChen / rclone-dryrun
Created May 11, 2020 19:35
rclone db snapshot on dryrun network
## rclone setup/installation, rclone.conf
https://nodes.harmony.one/foundational-node-playbook/fast-state-syncing/fast-state-syncing-using-rclone
Noted for all non-beacon shard, the node need to sync both shard0 and their own shard's db.
## shard0
rclone sync mainnet:pub.harmony.one/mainnet.min/snapshot.20200501/harmony_db_0 harmony_db_0
## shard1
rclone sync mainnet:pub.harmony.one/mainnet.min/snapshot.20200504/harmony_db_1 harmony_db_1
@LeoHChen
LeoHChen / update-harmony
Last active May 15, 2020 15:53
update harmony binary and script for open staking
# All exchange partners have to update the harmony node software and script for the open staking
# The following instructions assume you already have a running node on harmony mainnet
# and running the node.sh in console/tmux.
# stop your node.sh
# upgrade node.sh
curl -LO https://harmony.one/node.sh
chmod +x node.sh
@LeoHChen
LeoHChen / update-dryrun
Created May 15, 2020 23:47
update dryrun network for testing
# login to devop machine
ssh ec2-user@devop.hmny.io
# build the static binary
cd /home/ec2-user/go/src/github.com/harmony-one/harmony
./scripts/go_executable_build.sh -s
# set environment variable
. ~/bin/dry.profile
@LeoHChen
LeoHChen / development_guidance.md
Last active May 27, 2020 21:06
post OS launch development guidance

This is a short document about the development/release process post the open staking launch on harmony mainnet.

GOAL

  • The goal of this guidance is to provide a clear guidance to developers on how/where to submit PRs.
  • A fixed release schedule also provides the community a well-planned release and set the right expectation.

BRANCH

We have two kinds of branches in our main repo: development branch, and release branch. Each developer will be using their own fork for feature development as well, which is not covered here.

@LeoHChen
LeoHChen / upgrade-int-exp.md
Last active June 24, 2020 19:40
Upgrade Internal Explorer Nodes

login to devop.hmny.io

goto experiment-deploy

cd ~/go/src/github.com/harmony-one/experiment-deploy/ansible

# update to latest version
git pull --rebase
[03:06] leochen @ MBP15: ~/work/go/src/github.com/harmony-one/HRC/examples/multi-sender [master]: Untracked
$ truffle migrate --network testnet --reset
Compiling your contracts...
===========================
> Compiling ./contracts/Migrations.sol
> Compiling ./contracts/MultiSender.sol
> Compiling zeppelin-solidity/contracts/math/SafeMath.sol
> Compiling zeppelin-solidity/contracts/ownership/Ownable.sol