Skip to content

Instantly share code, notes, and snippets.

View jhelison's full-sized avatar
🐾

Jhelison Uchoa jhelison

🐾
View GitHub Profile
@jhelison
jhelison / pre-push
Created September 12, 2025 13:05
Pre Push KiiEx Backend hook
#!/bin/sh
remote="$1"
url="$2"
zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
# Check for WIP commits in the pushed range
while read local_ref local_oid remote_ref remote_oid
do
@jhelison
jhelison / gist:31bb86c01a718226c16621b9903e414f
Last active July 29, 2025 20:59
KiiEx module architecture
x/creditcard/
module.go
domain/
entities.go # CreditCard, CardTransaction
services.go # BillingService, FraudDetection
events.go # CardIssued, PaymentDue
application/
commands.go # IssueCardCommand, PayBillCommand
services.go # IssueCardService, ProcessPaymentService
infrastructure/
@jhelison
jhelison / execution.sh
Created July 1, 2025 22:33
Astroport Pool Creation and Swap
#!/bin/bash -e
KEY_NAME=astroport
TXFLAG=(--gas "auto" --gas-adjustment "1.2" --gas-prices "500000000000akii" --keyring-backend "test" --node https://rpc.uno.sentry.testnet.v3.kiivalidator.com --chain-id oro_1336-1)
ADDRESS=$(kiichaind keys show $KEY_NAME -a --keyring-backend test)
# Variables
CW20_BASE_CODE_ID=165
FACTORY_ADDRESS="kii1ct5yx003l9h2fsahug0vpx7xec4k66he0try0fclxg59fd4aztys4mnds9"
ROUTER_ADDRESS="kii12qs8835alkea96rtv9rllfwnkdfrk4vv89mxtkjapayjfknyzdwsjmmqp4"
@jhelison
jhelison / proposal.py
Created June 23, 2025 20:18
Cosmos management scripts
# This script checks if the voting was enough to pass a proposal
import requests
import json
REST_URL = "https://lcd.uno.sentry.testnet.v3.kiivalidator.com"
PROPOSAL_ID = "4"
def get_proposal_tally(proposal_id):
url = f"{REST_URL}/cosmos/gov/v1/proposals/{proposal_id}/tally"
@jhelison
jhelison / commands.sh
Last active May 29, 2025 18:42
Upgrade commands SDK 0.50
# Import the keys
kiichaind keys import devnet_validator_1 devnet/devnet_validator_1.txt
kiichaind keys import devnet_validator_2 devnet/devnet_validator_2.txt
# Create the proposal
kiichaind tx gov submit-proposal testnet_oro/proposals/proposal_4.json --from devnet_validator_1 --keyring-backend test --gas auto --gas-adjustment 5 --gas-prices 100000000000akii --node https://rpc.plata-404.kiivalidator.com --chain-id plata_404-1 -y
# Vote from both keys
kiichaind tx gov vote 3 yes --from devnet_validator_1 --keyring-backend test --gas auto --gas-adjustment 5 --gas-prices 100000000000akii --node https://rpc.plata-404.kiivalidator.com --chain-id plata_404-1 -y
kiichaind tx gov vote 3 yes --from devnet_validator_2 --keyring-backend test --gas auto --gas-adjustment 5 --gas-prices 100000000000akii --node https://rpc.plata-404.kiivalidator.com --chain-id plata_404-1 -y
{
"contract_name": "counter",
"contract_version": "0.1.0",
"idl_version": "1.0.0",
"instantiate": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "InstantiateMsg",
"oneOf": [
{
"type": "string",
@jhelison
jhelison / commands.sh
Last active May 6, 2025 21:17
Vesting accounts - Cosmos-SDK
kiichaind tx vesting create-vesting-account kii1qze8zsllu0ww62u5q0mekv3kl0mukl9qrseqa2 10000000000000000000akii 1746630000 --from localkeplr --keyring-backend test --fees 20000000000000000akii --gas 10000000 --node https://rpc.uno.sentry.testnet.v3.kiivalidator.com --chain-id oro_1336-1
@jhelison
jhelison / Logs.txt
Last active May 2, 2025 12:58
Kiichain Migration - 2025-04-29
8:01PM INF Unlocking keyring module=server
8:01PM INF starting ABCI with CometBFT module=server
8:01PM INF Upgrading IAVL storage for faster queries + execution on live state. This may take a while commit=436F6D6D697449447B5B5D3A307D module=server store_key="KVStoreKey{0xc00290ad70, distribution}" version=0
8:01PM INF Upgrading IAVL storage for faster queries + execution on live state. This may take a while commit=436F6D6D697449447B5B5D3A307D module=server store_key="KVStoreKey{0xc00290ada0, params}" version=0
8:01PM INF Upgrading IAVL storage for faster queries + execution on live state. This may take a while commit=436F6D6D697449447B5B5D3A307D module=server store_key="KVStoreKey{0xc00290add0, evidence}" version=0
8:01PM INF Upgrading IAVL storage for faster queries + execution on live state. This may take a while commit=436F6D6D697449447B5B5D3A307D module=server store_key="KVStoreKey{0xc00290ad10, acc}" version=0
8:01PM INF Upgrading IAVL storage for faster queries + execution on live state. This may take a
@jhelison
jhelison / genesis.json
Last active April 17, 2025 21:20
Kiichain Devnet migration
{
"app_hash": null,
"app_name": "kiichaind",
"app_state": {
"auth": {
"accounts": [
{
"@type": "/cosmos.auth.v1beta1.ModuleAccount",
"base_account": {
"account_number": "7",
@jhelison
jhelison / delegation.py
Last active April 15, 2025 23:44
Needed delegation
import requests
# === Configuration ===
REST_ENDPOINT = "https://lcd.uno.sentry.testnet.v3.kiivalidator.com"
VALIDATORS = [
"kiivaloper1zumlpw2c86ycg36a2zjtxdrj936vmjx3h5sjdd",
"kiivaloper1am7xh6qwxr8vt6ztz2gm6vxnu8w4psmcdg45yd",
]
TARGET_PERCENT = 70