Skip to content

Instantly share code, notes, and snippets.

@JackyWYX
JackyWYX / gist:b3c878bec750372170de8b86ac48a581
Last active July 18, 2020 21:51
Remove node.sh integration tests - load bls keys

Overview

This PR replace the bls loading logic in node.sh with logic in harmony binary. These tests are to ensure that the BLS loading is still functioning for the following scenario:

  1. New binary with old node.sh
  • bls keys in bls dir (w/o persist passphrase)
  • single bls key (with passphrase from file or prompt)
  1. New binary with new node.sh
  • bls keys in bls dir (w/o persist passphrase)
@JackyWYX
JackyWYX / test.md
Last active July 29, 2020 04:59
Test case for #3261

This is the test log for harmony-one/harmony#3261

description

This test log aims to test the ip/port flag settings will result in correct ip/port configuration when the node runs.

Use code in https://github.com/JackyWYX/harmony/tree/cmd_ip_port_test to test the start command. Changes in this test branch compared to branch being tested:

  1. Dry run startHTTP and startWS.
  2. Print message before start p2p, http, ws, and dns service.
@JackyWYX
JackyWYX / Another test.md
Last active July 31, 2020 23:51
Test log for PR: #3274
@JackyWYX
JackyWYX / Hidden flags.md
Last active August 12, 2020 04:28
Harmony Node Binary CLI

Legacy and hidden flags

This document gives a full list of legacy and hidden flags at harmony CLI interface. There are briefly two types of legacy flags:

  1. Flag is only for developer usage, thus is hidden from user to have a simple interface.
  2. Flag is a legacy from previous versions and exist for backward compatibility.

1. Hidden flags

1.1 IP and Port

@JackyWYX
JackyWYX / Play with new CLI.md
Last active August 13, 2020 04:34
Acquire test cli commands

Download node.sh and binary for CLI test

Use an old node.sh

./node.sh -d -U main_v2

Move downloaded file and binarys to current folder:

@JackyWYX
JackyWYX / gist:adba7bf16bccce479045600660d8454b
Created March 12, 2021 06:11
Commit sig and bitmap data
## Commit signature and bitmap
Following is the data I obtained as binary for block number 1 in binary:
Signature bytes from next header:
```
011100001101110110000001111101000001101110110001000001110101100010000010100000101101101111100001001100101000110010100111010100000100000001110001111001000010011010010010011010001000110100011010000101000100101010100111000001001110010100110000101011111000011100101010010111101100010100101010011010001011100010001111100000101101111110010011110100010101110101011000000000101111011100001001011000010001011110111011111000111111011001000101001000110100111110101011101011010110101001010110010000001011010011111110110111100100001110111011001101110111101100100111101110000111000111011110100011000010000101000001101010000011001101001110100110001111000001001110010111011001101110111011101101010001001000110001011110000110001110100001101110101100101100100001011010010011010000000010
```
@JackyWYX
JackyWYX / harmony.log
Created April 9, 2021 19:14
Leader transaction failed log
```
> tail -n 1000 latest/zerolog-harmony.log | grep "worker.go"
{"level":"error","error":"totalRedelegatable: 0, balance: 1180421619000000000000; trying to stake 1180421679000000000000: insufficient balance to stake","stkTxn":{},"caller":"/mnt/jenkins/workspace/harmony-release/harmony/node/worker/worker.go:201","time":"2021-04-09T01:08:21.149715872Z","message":"Staking transaction failed commitment"}
{"level":"error","error":"totalRedelegatable: 0, balance: 1180421619000000000000; trying to stake 1180421679000000000000: insufficient balance to stake","stakingTxID":"0x6f2e066336c343bdfef83316bc2a12231c33c802b89e7e92e924a9be75f92e31","stakingTx":{},"caller":"/mnt/jenkins/workspace/harmony-release/harmony/node/worker/worker.go:169","time":"2021-04-09T01:08:21.149739914Z","message":"Failed committing staking transaction"}
{"level":"error","error":"totalRedelegatable: 0, balance: 3992323449148802484840; trying to stake 3992323509100000000000: insufficient balance to stake","stkTxn":{},"caller":"/mnt/jenkins/works
▶ curl -d '{
    "jsonrpc":"2.0",
    "method":"hmy_getAllDelegationInformation",
    "params":[
      0
    ],
    "id":1
}' -H 'Content-Type:application/json' -X POST 'localhost:9500'
@JackyWYX
JackyWYX / Mainnet.md
Last active June 11, 2021 01:58
A complete prometheus metrics for ddos protection
> curl localhost:9900/metrics
# HELP hmy_consensus_blskeys list of bls pubkey
# TYPE hmy_consensus_blskeys gauge
hmy_consensus_blskeys{index="0",pubkey="000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"} 0
# HELP hmy_consensus_finality the latency of the finality
# TYPE hmy_consensus_finality histogram
hmy_consensus_finality_bucket{le="800"} 0
hmy_consensus_finality_bucket{le="1000"} 0
hmy_consensus_finality_bucket{le="1250"} 0
@JackyWYX
JackyWYX / migration.log
Created June 19, 2021 08:26
A complete grepped log during explorer DB migration
{"level":"info","module":"explorer DB migration to 1.0.0","progress":"7642 / 19680","caller":"/home/yx/go/src/github.com/harmony-one/harmony/api/service/explorer/migration.go:102","time":"2021-06-19T07:22:37.435122529Z","message":"migration in progress"}
{"level":"info","module":"explorer DB migration to 1.0.0","progress":"7642 / 19680","caller":"/home/yx/go/src/github.com/harmony-one/harmony/api/service/explorer/migration.go:102","time":"2021-06-19T07:22:39.434900505Z","message":"migration in progress"}
{"level":"info","module":"explorer DB migration to 1.0.0","progress":"7642 / 19680","caller":"/home/yx/go/src/github.com/harmony-one/harmony/api/service/explorer/migration.go:102","time":"2021-06-19T07:22:41.434917233Z","message":"migration in progress"}
{"level":"info","module":"explorer DB migration to 1.0.0","progress":"7642 / 19680","caller":"/home/yx/go/src/github.com/harmony-one/harmony/api/service/explorer/migration.go:102","time":"2021-06-19T07:22:43.435007447Z","message":"migration in progress"}
{"le