Skip to content

Instantly share code, notes, and snippets.

View blockpane's full-sized avatar
🚀

Todd G blockpane

🚀
View GitHub Profile
@blockpane
blockpane / linkauth.md
Last active February 2, 2021 22:52
linkauth

Linkauth cheatsheet

given two keys:

account granting permissions:

Account Name:   produceracct
@blockpane
blockpane / address.go
Last active February 25, 2021 06:27
Get Ethereum address from transaction
package main
import (
"context"
"fmt"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
)
@blockpane
blockpane / snap.sh
Last active December 4, 2021 20:43
FIO Snapshots Script
#!/bin/bash
#CONTAINER=fixme
#ZPOOL=fixme
#CHAIN_NAME=fixme
#OUT_DIR=fixme
#URL=fixme
#API=fixme
# Uses ZFS snapshots to minimize node downtime when creating history node archives:
@blockpane
blockpane / cloud-init.yml
Created June 22, 2021 21:25
AWS CloudWatch Logs - Install via Cloud Init
#cloud-config
# vim: syntax=yaml
#
write_files:
# cloudwatch logs, send log streams, but not metrics:
- content: |
{
"agent": {
@blockpane
blockpane / nofile.md
Last active August 24, 2021 17:55
Bump up nofile limits for osmosisd

Check current limits:

cat /proc/$(pidof osmosisd)/limits

Update systemd

Edit /etc/systemd/system/osmosisd.service (or whatever you named it.) And in the [Service] section, set the following:

@blockpane
blockpane / kava.md
Last active August 17, 2021 07:41
Kava install log

Kava install notes on Ubuntu:

Install golang

sudo apt install snapd build-essential
sudo snap install go --classic

setup a user to run under, and build daemons:

@blockpane
blockpane / main.go
Last active August 24, 2021 03:36
Tendermint subscribe example
package main
import (
"context"
"encoding/json"
"fmt"
rpchttp "github.com/tendermint/tendermint/rpc/client/http"
"github.com/tendermint/tendermint/types"
"time"
)
@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"
)
@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 / 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