Skip to content

Instantly share code, notes, and snippets.

View Reecepbcups's full-sized avatar

Reece Williams Reecepbcups

View GitHub Profile

Keybase proof

I hereby claim:

  • I am reecepbcups on github.
  • I am pbcups (https://keybase.io/pbcups) on keybase.
  • I have a public key ASAmF8lq8wRA-qoDhiY_g6guL775M5FisYu0WBGg4Uk_4Qo

To claim this, I am signing this object:

pagination:
next_key: null
total: "0"
validators:
- commission:
commission_rates:
max_change_rate: "0.010000000000000000"
max_rate: "0.500000000000000000"
rate: "0.050000000000000000"
update_time: "2022-03-24T05:00:00Z"
# Upload a CW20 with an account with no funds as the admin.
# Then see if transaction fees through the CW20 go to the said account
KEY="juno1"
KEY_ADDR="juno1hj5fveer5cjtn4wd6wstzugjfdxzl0xps73ftl" # test_node.sh
CHAINID="juno-t1"
MONIKER="localjuno"
KEYALGO="secp256k1"
KEYRING="test" # export JUNOD_KEYRING="TEST"
LOGLjunoL="info"
TRACE="" # "--trace"
import json
import os
from requests import get
current_dir = os.path.dirname(os.path.realpath(__file__))
unconfirmed_txs_file = os.path.join(current_dir, "unconfirmed_txs.json")
def get_txs():
@Reecepbcups
Reecepbcups / uni-v12-relaunch.md
Last active January 25, 2023 03:22
Juno v12-alpha2 relaunch

update: rollback does not work, disregard.

These steps are re-launching Uni-5 in a different manner than typically for us to gain more direction. This will launch on the same version as before, v12.0.0-alpha

Steps:

  1. Stop the junod binary.
@Reecepbcups
Reecepbcups / tendermint_python_subscribe.py
Last active May 17, 2023 06:10
Subscribes to a Tendermint RPC in python for new Blocks
# pip install rel
import rel
# pip install websocket-client
import websocket
# https://docs.tendermint.com/v0.34/rpc/
RPC_URL = "15.204.143.232:26657"
RPC_URL = f"ws://{RPC_URL}/websocket"
# For 443 / https connections, use wss
@Reecepbcups
Reecepbcups / hex_addr_to_valcons.ts
Created February 15, 2023 14:45
Convert a HexAddress to the nodes signing address (valcons)
// ex: "GetBlockByHeightRequest" grpc call returns the validatorAddress as hex
// npm i '@cosmjs/encoding
import {fromHex, toBech32} from '@cosmjs/encoding'
// where junovalcons is the prefix for the chain. It MUST be valcons, you can not convert to valoper or normal address from here
const prefix = "junovalcons"
let addr = toBech32(prefix, fromHex("80F24BFDA3E6A8C1BAC0517E7665AC9145D609F7"))
@Reecepbcups
Reecepbcups / open.py
Last active March 11, 2023 07:10
Open files / folders from your programming mono folder locally with easy and simple search
#!/usr/bin/env python3
"""
Reece Williams | March 2023
Opens folders in your programming mono local repo in your editor or explorer.
Just thrown together, so edge cases are not covered. But it works
chmod +x open.py
mv open.py open
# source .bashrc or .profile or /.zshrc -> the folder this file is saved in
@Reecepbcups
Reecepbcups / get_community_pool_value.py
Last active March 16, 2023 19:34
Gets the value of the community pool in FIAT
# https://docs.junonetwork.io/developer-guides/miscellaneous/get-token-prices
#
# pip install pycoingecko
# python3 main.py
#
# https://pypi.org/project/pycoingecko/
from pycoingecko import CoinGeckoAPI
from requests import get
@Reecepbcups
Reecepbcups / contracts_interactions-1_7919651.json
Created April 22, 2023 05:21
Juno CosmWasm Msg executes since genesis
{
"start_block": 1,
"end_block": 7919651,
"contracts": {
"juno1y9rf7ql6ffwkv02hsgd4yruz23pn4w97p75e2slsnkm0mnamhzysvqnxaq": {
"amount": 1030624,
"label": "BLOCK"
},
"juno1mkw83sv6c7sjdvsaplrzc8yaes9l42p4mhy0ssuxjnyzl87c9eps7ce3m9": {
"amount": 529296,