Skip to content

Instantly share code, notes, and snippets.

View pinheadmz's full-sized avatar
🕺

Matthew Zipkin pinheadmz

🕺
  • port 8333
View GitHub Profile
'use strict';
const {NodeClient, WalletClient} = require('hs-client');
const {Network} = require('hsd');
const network = Network.get('regtest');
const nodeOptions = {
network: network.type,
port: network.rpcPort
};
# git fetch origin
# MUST run inside hsd directory
# run old version
git checkout v2.1.3
time=`date +%s`
export HSD_NETWORK=regtest
hsd --prefix=~/.hsd/migrate-test-$time --daemon
sleep 3

What is the coin supply of HNS at this moment?

$ hsd-cli info | jq .chain.state
{
  "tx": 1498491,
  "coin": 987885,
  "value": 307706949499305,
  "burned": 8282032802881
}
/*
* Packet sniffer plgin for bcoin
* USAGE:
* bcoin --log-console=false --plugins <path/to/packetsniffer.js>
*/
'use strict';
const EventEmitter = require('events');

Upgrade nodejs to v12.x.x

$ sudo npm install -g n
$ sudo n lts

Install hsd

'use strict';
const fs = require('fs');
const os = require('os');
const Path = require('path');
const hdns = require('hdns');
const {encoding} = require('hdns/node_modules/bcrypto');
const {pem} = encoding;
const host = process.argv[2];
Date, total blocks on that day, average since genesis
Mon Feb 03 2020, 341, 341
Tue Feb 04 2020, 190, 265
Wed Feb 05 2020, 208, 246
Thu Feb 06 2020, 188, 231
Fri Feb 07 2020, 196, 224
Sat Feb 08 2020, 146, 211
Sun Feb 09 2020, 155, 203
Mon Feb 10 2020, 143, 195
'use strict';
const {NodeClient, WalletClient} = require('hs-client');
const {Network} = require('hsd');
const network = Network.get('regtest');
const nodeOptions = {
network: network.type,
port: network.rpcPort
};
14659 Map {
  'COINBASE' => Map { 'count' => 14660, 'value' => 29507996138125 },
  'FAUCET' => Map { 'count' => 1358, 'value' => 237238786158270 },
  'AIRDROP' => Map { 'count' => 4581, 'value' => 19454422312234 },
  'NONE' => Map { 'count' => 689810, 'value' => 12785527557117394 },
  'OPEN' => Map { 'count' => 62585, 'value' => 0 },
  'BID' => Map { 'count' => 155990, 'value' => 29178908574495 },
  'CLAIM' => Map { 'count' => 841, 'value' => 3959349211335 },
 'REVEAL' =&gt; Map { 'count' =&gt; 147462, 'value' =&gt; 18889235602905 },
ack(){
echo ACK `git rev-parse head`
echo \<details\>\<summary\>Show Signature\<\/summary\>
echo -e '\n```'
echo ACK `git rev-parse head` | gpg -s -q -a --clearsign
echo -e '```\n'
echo "pinheadmz's public key is [on keybase](https://keybase.io/pinheadmz/pgp_keys.asc?fingerprint=e61773cd6e01040e2f1bd78ce7e2984b6289c93a)"
echo \<\/details\>
}