Skip to content

Instantly share code, notes, and snippets.

@wileyj
wileyj / stackerdb.sh
Last active November 9, 2023 22:07
Stackerdb script
#!/usr/bin/env bash
set -eo pipefail
set -Eo functrace
shopt -s expand_aliases
##
## Meant to be run manually or via cron
## ex cron:
## 00 * * * * /usr/local/bin/stackerdb >> /tmp/stackerdb-log
##
@wileyj
wileyj / seed.sh
Last active November 6, 2023 21:17
Script to setup and run a node as a Stacks bootstrap instance
#!/usr/bin/env bash
set -eo pipefail
set -Eo functrace
shopt -s expand_aliases
##
## Meant to be run manually or via cron
## ex cron:
## 00 * * * * /usr/local/bin/seed >> /tmp/seed-log
##
@wileyj
wileyj / rosetta.Dockerfile
Created April 14, 2023 17:08
rosetta.Dockerfile
ARG STACKS_API_VERSION=v7.1.5
ARG STACKS_NODE_VERSION=2.1.0.0.3
ARG STACKS_API_REPO=hirosystems/stacks-blockchain-api
ARG STACKS_NODE_REPO=stacks-network/stacks-blockchain
ARG PG_VERSION=14
ARG STACKS_NETWORK=mainnet
ARG STACKS_LOG_DIR=/var/log/stacks-node
ARG STACKS_SVC_DIR=/etc/service
ARG STACKS_BLOCKCHAIN_DIR=/stacks-blockchain
ARG STACKS_BLOCKCHAIN_API_DIR=/stacks-blockchain-api
@wileyj
wileyj / gist:da37cf1b2bf0303236712ba71ec07c81
Created February 8, 2023 16:50
Dockerfile.bitcoin.alpine
FROM alpine as build
ARG BTC_VERSION="23.0"
ARG BDB_PREFIX="/src/bitcoin/db4"
ENV BTC_VERSION=${BTC_VERSION}
ENV BDB_PREFIX=${BDB_PREFIX}
WORKDIR /src
RUN apk --no-cache add --update \
@wileyj
wileyj / Dockerfile.btc
Created December 13, 2022 01:58
Bitcoin Dockerfile
FROM debian:bullseye-slim as build
ARG BTC_VERSION="23.0"
ENV BDB_PREFIX="/src/bitcoin/db4"
ENV BTC_VERSION="${BTC_VERSION}"
WORKDIR /src
RUN mkdir /out \
&& apt-get update && apt-get install -y \
@wileyj
wileyj / Dockerfile.stacks
Created December 13, 2022 01:57
Stacks Dockerfile
FROM rust:slim-bullseye as build
ARG STACKS_VERSION="2.05.0.6.0"
ENV STACKS_VERSION="${STACKS_VERSION}"
WORKDIR /src
RUN apt-get update && apt-get install -y git
RUN mkdir /out
@wileyj
wileyj / stacks-mining.md
Last active February 23, 2022 19:34
stacks-mining

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 February 2, 2022 19:29
stacks-node info parser
#!/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 January 26, 2022 04:09
stacks-node init-style script
#!/bin/sh
NETWORK=$1
OP=$2
BINARY=stacks-node
BASEDIR=$HOME/stacks-blockchain
usage () {
echo ""
echo "$0 (mocknet|testnet|mainnet) (start|stop|restart)"