Skip to content

Instantly share code, notes, and snippets.

@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                                                                                                                                                
@imylomylo
imylomylo / rpc.tokens.md
Last active May 14, 2019 08:50
rpc tokens
curl -s --user $rpcuser:$rpcpassword --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "tokenaddress", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:$rpcport/ | jq -r '.result'
{
  "result": "success",
  "TokensCCAddress": "RAMvUfoyURBRxAdVeTMHxn3giJZCFWeha2",
  "TokensCCBalance": 0.0001,
  "TokensNormalAddress": "RCNgAngYAdrfzujYyPgfbjCGNVQZzCgTad",
  "TokensNormalBalance": 0,
  "myCCAddress(Tokens)": "RBjnhNaqtSGym1PqpaQL3jY3XHgpH9qTRK",
  "myCCbalance(Tokens)": 5,
@imylomylo
imylomylo / trace.faucetinfo.md
Last active June 7, 2019 09:03
trace faucet info

Mining Node

Faucet Info

####
T 127.0.0.1:58652 -> 127.0.0.1:25133 [AP] #4
POST / HTTP/1.1.
Host: 127.0.0.1:25133.
Authorization: Basic ZUhJd3ZuSEFOZENUczlGMUprd1J3THJyUWkublFMQXU6WThJMkRjc1R0RDVhLlZMcUFOVDRJUzViUW5Ndk1Wbm4=.
User-Agent: curl/7.58.0.