Skip to content

Instantly share code, notes, and snippets.

View blockpane's full-sized avatar
🚀

Todd G blockpane

🚀
View GitHub Profile
@blockpane
blockpane / authz.md
Created January 27, 2023 20:04
AuthZ Cheatsheet

Claims:

Setup:

simd tx distribution set-withdraw-addr <claim_address> -y --from validator
simd tx authz grant <claim_address> generic --msg-type=/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission --from validator
simd tx authz grant <claim_address> generic --msg-type=/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward --from validator
@blockpane
blockpane / command-log.txt
Created January 22, 2023 01:27
TDv2 on Akash
docker pull ghcr.io/blockpane/tenderduty:v2.1.1-hf1
docker run --rm -ti ghcr.io/blockpane/tenderduty:v2.1.1-hf1 -h
docker run --rm -ti -v $PWD:/var/lib/tenderduty ghcr.io/blockpane/tenderduty:v2.1.1-hf1 -encrypt
@blockpane
blockpane / bashrc.sh
Created August 18, 2022 00:03
tendermint cli autocompletions
# add this to your .bashrc (and edit the list of chains to your liking
# it will enable tab completion on the command line for each :)
while read autocomplete; do
hash $autocomplete 2>/dev/null && . <($autocomplete completion)
done << EOF
junod
kava
osmosisd
secretcli
@blockpane
blockpane / sync.md
Last active February 14, 2022 18:50

State Sync on Osmosis

State sync can greatly speed up the time it takes to bring a node online, and the smaller state size will make processing the epoch much faster. There is however a bug that affects osmosisd v5.0.0-v6.0.1 which causes the replay to fail after syncing

This walks through the steps to bring up a new node using state sync on osmosis v6.0.1, this will likely be outdated pretty quickly (Jan 2, 2022) once the bug is fixed.

Install Osmosis

@blockpane
blockpane / listening.sh
Created December 8, 2021 23:15
Tendermint Monit Checks
#!/bin/bash
# used by monit, place in: /etc/monit/scripts/no-peers.sh
# as simple as it gets. Additional upside is it's easy to see what ports are used in m/monit
/usr/bin/ss -lntp | grep "${1}"
@blockpane
blockpane / firewall.sh
Last active August 30, 2023 16:18
Example of how to setup iptables to correctly filter Docker services
#!/bin/bash
### This is an example script that sets up IP tables with Docker. Many admins are not aware that UFW
### and Docker do not play well together, and accidently expose RPC ports and vulnerable services to
### the network. This replaces UFW with Netfilter-persistent and adds rules to the DOCKER-USER chain
### which is the correct way to filter incoming traffic with docker. This specific example is for a
### Tendermint node running via docker, and wireguard / ssh running directly on the host.
# CHANGE THIS TO ACTUAL PUBLIC INTERFACE!!!!!!!!!!
@blockpane
blockpane / dashboard.json
Last active February 14, 2024 16:09
Grafana dashboard for tendermint validators
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@blockpane
blockpane / no-peers.sh
Created September 16, 2021 18:04
monit checks for osmosis
#!/bin/bash
PROMETHEUS=http://localhost:26660
NUM_PEERS=$(curl -s ${PROMETHEUS}/stats |grep 'p2p_peers{' |awk '{print $NF}')
# if we can't connect don't alarm, that is done in another check.
[ -z $NUM_PEERS ] && exit 0
if [ $NUM_PEERS -eq 0 ] ; then
echo NO PEERS ARE CONNECTED
@blockpane
blockpane / striped.md
Last active August 7, 2023 18:47
Striped block devices on Digitalocean

LVM Setup on DO for striped block devices:

This example is specifically for my Osmosis seed node, that I run in the cloud, all my other nodes are on hardware, and I use a very different setup on those.

These instructions should work on just about any cloud provider, by striping block devices it's possible to get much higher IOPS and throughput. On Omosis in particular this is important. It doesn't cost any more to use striped volumes, so for example 3 40GB volumes cost the same as a single 120GB, but give (almost) 3x the performance.

After provisioning new block devices (do not format automatically) in the DO console and attaching them, ssh into the droplet and as root follow the directions below. I try to shoot for < 50% usage, so right now with about 120GiB needed, three 90GB volumes will do nicely.

_Note that extending the volume group in the future will require adding exactly the same number and size of volumes. Alternatively you can just use the same procedure here to move the files into a new vol

@blockpane
blockpane / pd-mmonit.go
Last active September 16, 2021 18:20
simple pagerduty client for m/monit
package main
import (
"flag"
"github.com/PagerDuty/go-pagerduty"
"log"
"os"
"strings"
)