Skip to content

Instantly share code, notes, and snippets.

@imylomylo
imylomylo / git.commit.count.md
Created July 10, 2019 17:47
git total commits in a branch
git log --pretty=format:'' | wc -l
27812
@imylomylo
imylomylo / season-3-q-and-a.md
Created June 22, 2019 07:51
Notary Questions Season 3

Question


2019-06-22 05:11:33 ERROR: ContextualCheckBlockHeader: forked chain 1405100 older than last notarized (height 1410530) vs
2019-06-22 05:11:33 AcceptBlockHeader ContextualCheckBlockHeader failed
2019-06-22 05:11:33 AcceptBlock AcceptBlockHeader error
2019-06-22 05:11:33 ERROR: ProcessNewBlock: AcceptBlock FAILED

2019-06-22 06:14:32 DisconnectTip: deleted 2 block notarisations in block: 030cf9bf00ce5510edc13f8c038f8aa8c9370a805e75957b62fff9aa340723d2
@imylomylo
imylomylo / install-vrsc.sh
Created June 21, 2019 13:58
install vrsc with fresh clone
```
./komodod -ac_name=VRSC -ac_algo=verushash -ac_cc=1 -ac_supply=0 -ac_eras=3 -ac_reward=0,38400000000,2400000000 -ac_halving=1,43200,1051920 -ac_decay=100000000,0,0 -ac_end=10080,226080,0 -ac_timelockgte=19200000000 -ac_timeunlockfrom=129600 -ac_timeunlockto=1180800 -ac_veruspos=50 -connect=185.25.48.236 -connect=185.64.105.111 -connect=149.202.84.141 -connect=158.69.118.173 &
```
@imylomylo
imylomylo / install-emc.sh
Created June 21, 2019 13:52
script to build emc2 taken from notary channel
```
#!/bin/bash
# EMC2 build script for Ubuntu & Debian 9 v.3 (c) Decker (and webworker)
berkeleydb () {
EMC2_ROOT=$(pwd)
EMC2_PREFIX="${EMC2_ROOT}/db4"
mkdir -p $EMC2_PREFIX
wget -N 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c
@imylomylo
imylomylo / kvm.ubuntu1604.host.md
Last active June 8, 2019 07:40
KVM ubuntu16.04 host

Run this install

Change the GUESTNET and GUESTIP LIST

  • ./install.sh
  • reboot
#!/bin/bash

apt-get update
apt-get install -y git
@imylomylo
imylomylo / chips.hashrate.md
Created May 30, 2019 08:12
CHIPS hashrate in TH command
$ CHIPSHASH=$(chips-cli getmininginfo | jq '.networkhashps' | awk -F "." '{print $1}') && echo $(( CHIPSHASH / 1000000000 )) | sed -re ' :restart ; s/([0-9])([0-9]{3})($|[^0-9])/\1,\2\3/ ; t restart '
8,785
@imylomylo
imylomylo / validateaddress.js.md
Created May 28, 2019 08:34
Javascript Validate Address
	validateaddress: function(event){
	  console.log("validateaddress")
	  util.validateaddress(rpc,this.address.address).then(resp=>{
	    console.log("validate address response")
	    this.address.isvalid = resp.isvalid
	    this.address.scriptPubKey = resp.scriptPubKey
	    this.address.segid = resp.segid
	    this.address.ismine = resp.ismine
 this.address.iswatchonly = resp.iswatchonly
sudo mysql -uroot
create user sampledbuser@localhost identified by 'samplepassword';
alter user 'sampledbuser'@'localhost' identified with mysql_native_password by 'samplepassword'
@imylomylo
imylomylo / rpc.tokens.tokenorders.md
Last active May 14, 2019 14:07
Token Orders RPC Response

tokencreate

TOKENNAME="TOKENA"
TOKENSUPPY=0.001
TOKENDESCRIPTION="short description token a"
curl -s --user $rpcuser:$rpcpassword --data-binary "{\"jsonrpc\": \"1.0\", \"id\": \"curltest\", \"method\": \"tokencreate\", \"params\": [\"$TOKENNAME\", \"$TOKENSUPPLY\", \"$TOKENDESCRIPTION\"]}" -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/

Response is a blockchain transaction id. This txid is re-used as the tokenid.

@imylomylo
imylomylo / notary.ping.md
Created May 13, 2019 17:54
notary ping starter script
for i in $(curl -s --url "http://127.0.0.1:7776/" --data "{\"agent\":\"dpow\",\"method\":\"ipaddrs\"}" | jq -r '.[]') ; do ping -c 3 $i | grep time | awk '{print $4 $7}' | sed  's/:time=/,/' | grep -v packet; done                                                                                                               
195.154.79.11,288
195.154.79.11,287                                                                                               
195.154.79.11,287                                                                                              
148.251.9.12,298                                                                                                  
148.251.9.12,298                                                                                                                                                              
148.251.9.12,298