Skip to content

Instantly share code, notes, and snippets.

@wileyj
wileyj / stacks-mining.md
Last active Feb 23, 2022
stacks-mining
View stacks-mining.md

Stacks Blockchain Miner

https://docs.stacks.co/start-mining/mainnet

Prerequisites

VM setup

The VM will not need a lot of resources to run a miner - the most resources will be consumed during blockchain sync.
A single CPU system with at least 4GB of memory should be more than sufficient - as well as roughly 1TB of total disk space

@wileyj
wileyj / info.py
Last active Feb 2, 2022
stacks-node info parser
View info.py
#!/usr/bin/env python3
import aiohttp
import asyncio
import time
from time import sleep
import math
from prometheus_client.parser import text_string_to_metric_families
urls = [
'http://localhost:20443/v2/neighbors',
@wileyj
wileyj / gist:4959035d85ed5e358788e267745d1d4e
Last active Jan 26, 2022
stacks-node init-style script
View gist:4959035d85ed5e358788e267745d1d4e
#!/bin/sh
NETWORK=$1
OP=$2
BINARY=stacks-node
BASEDIR=$HOME/stacks-blockchain
usage () {
echo ""
echo "$0 (mocknet|testnet|mainnet) (start|stop|restart)"
@wileyj
wileyj / verify.py
Created Dec 3, 2020
Verify MD5hash from GCS
View verify.py
import base64
import hashlib
source = [
"/path/to/chainstate.txt", # < -- edit this path
"/path/to//chainstate.txt.sha256" # < -- edit this path
]
for file in source:
hash_md5 = hashlib.md5()
with open(file, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
View Blockstack
Verifying my Blockstack ID is secured with the address 13EWrxFrtcKgFas5kvm3kQhX86KLjhFpCM https://explorer.blockstack.org/address/13EWrxFrtcKgFas5kvm3kQhX86KLjhFpCM
@wileyj
wileyj / ldd-alinux.py
Last active Dec 19, 2017
ldd.py for alinux. some very minor differences between ldd.py and this one (paths mostly)
View ldd-alinux.py
#!/usr/bin/env python
import sys
import os
import argparse
import re
import errno
import stat
import pwd
import grp
# no longer needed since we hardcoded the mount cmd for now
@wileyj
wileyj / ldd.py
Last active Dec 14, 2017
needs some error checking etc. as-is
View ldd.py
#!/usr/bin/env python
import sys
import os
import argparse
import re
import errno
import stat
import pwd
import grp
# no longer needed since we hardcoded the mount cmd for now
@wileyj
wileyj / sshd_config
Last active Dec 14, 2017
sshd_config
View sshd_config
Port 22
Protocol 2
PidFile /var/run/sshd.pid
LogLevel INFO
SyslogFacility AUTH
PermitEmptyPasswords no
PubKeyAuthentication yes
DSAAuthentication yes
IgnoreRhosts yes
View gist:801b9c17ac52050a0bfd
### Keybase proof
I hereby claim:
* I am wileyj on github.
* I am wileyj (https://keybase.io/wileyj) on keybase.
* I have a public key whose fingerprint is AE7B 37FD B634 A08F 8904 AC1A 2EF1 0D71 9C76 8737
To claim this, I am signing this object: