Skip to content

Instantly share code, notes, and snippets.

@rootulp
rootulp / ica-pfb-arabica.md
Created September 4, 2024 18:30
Attempt to submit a PFB via ICA on Arabica

Inter Chain Accounts

Notes from creating and testing ICA on testnets.

Prerequisites

  1. Start a Cosmos Hub Testnet node and sync it to the tip.
  2. Start a Arabica node and sync it to the tip.
  3. Install and configure Hermes to relay between these two chains.
    1. Configure Hermes keys with an account on both chains. Get both accounts funded via Discord wallets.
@rootulp
rootulp / voting-period.md
Last active August 29, 2024 20:05
Celestia network voting period

Voting Period

Network Voting Period (nanoseconds) Voting period (days)
arabica-11 604800000000000 7
mocha-4 86400000000000 1
celestia 604800000000000 7

Reference

@rootulp
rootulp / mocha.sh
Created August 21, 2024 21:06
State sync a Celestia consensus node on Mocha
#!/bin/sh
# Stop script execution if an error is encountered
set -o errexit
# Stop script execution if an undefined variable is used
set -o nounset
CHAIN_ID="mocha-4"
NODE_NAME="node-name"
SEEDS="ee9f90974f85c59d3861fc7f7edb10894f6ac3c8@seed-mocha.pops.one:26656,258f523c96efde50d5fe0a9faeea8a3e83be22ca@seed.mocha-4.celestia.aviaone.com:20279,5d0bf034d6e6a8b5ee31a2f42f753f1107b3a00e@celestia-testnet-seed.itrocket.net:11656,7da0fb48d6ef0823bc9770c0c8068dd7c89ed4ee@celest-test-seed.theamsolutions.info:443"
@rootulp
rootulp / arabica.sh
Created August 21, 2024 20:27
State sync a Celestia consensus node on Arabica
#!/bin/sh
# Stop script execution if an error is encountered
set -o errexit
# Stop script execution if an undefined variable is used
set -o nounset
CHAIN_ID="arabica-11"
NODE_NAME="node-name"
SEEDS="827583022cc6ce65cf762115642258f937c954cd@validator-1.celestia-arabica-11.com:26656,74e42b39f512f844492ff09e30af23d54579b7bc@validator-2.celestia-arabica-11.com:26656,00d577159b2eb1f524ef9c37cb389c020a2c38d2@validator-3.celestia-arabica-11.com:26656,b2871b6dc2e18916d07264af0e87c456c2bba04f@validator-4.celestia-arabica-11.com:26656"
#!/bin/bash
SNAP_RPC="https://celestia-rpc.polkachu.com:443"
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
@rootulp
rootulp / celestia-app.sh
Last active July 9, 2024 22:14
Test celestia-node with celestia-app v2
#!/bin/sh
# Stop script execution if an error is encountered
set -o errexit
# Stop script execution if an undefined variable is used
set -o nounset
if ! [ -x "$(command -v celestia-appd)" ]
then
echo "celestia-appd could not be found. Please install the celestia-appd binary using 'make install' and make sure the PATH contains the directory where the binary exists. By default, go will install the binary under '~/go/bin'"
@rootulp
rootulp / v1.json
Created May 12, 2024 22:56
`celestia-appd export` output
{
"app_hash": "",
"app_state": {
"auth": {
"accounts": [
{
"@type": "/cosmos.auth.v1beta1.ModuleAccount",
"base_account": {
"account_number": "3",
"address": "celestia1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3y3clr6",
@rootulp
rootulp / feegrant.sh
Last active March 20, 2024 18:30
Short script to demonstrate feegrant
#!/bin/sh
# Stop script execution if an error is encountered
set -o errexit
# Stop script execution if an undefined variable is used
set -o nounset
CHAIN_ID="private"
KEY_NAME="validator"
KEYRING_BACKEND="test"
@rootulp
rootulp / multisig.sh
Last active March 7, 2024 20:39
tx sign doesn't throw an error when incorrect Ledger is used
#!/bin/sh
# Stop script execution if an error is encountered
set -o errexit
# Stop script execution if an undefined variable is used
set -o nounset
# Prerequisite: prior to running this script, start a single node devnet with ./scripts/single-node.sh
CHAIN_ID="private"
KEY_NAME="validator"
@rootulp
rootulp / convert.go
Created November 29, 2023 20:13
Go playground to conver a quantity of utia to TIA
package main
import "fmt"
// utiaPerTia is the number of utia in one TIA
// see https://docs.celestia.org/learn/tia#tia-display-token
const utiaPerTia = int64(1_000_000)
func main() {
// feel free to modify utia