Skip to content

Instantly share code, notes, and snippets.

@assafmo
assafmo / main.ts
Created March 19, 2024 09:31
Manually send an IBC timeout
// Run this code with `ts-node main.ts`
import { IbcClient, Link } from "@confio/relayer";
import { stringToPath } from "@cosmjs/crypto";
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { GasPrice } from "@cosmjs/stargate";
import Long from "long";
import { fromHex } from "secretjs";
export async function createIbcConnection(): Promise<Link> {
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x2 addr=0x7f12160ac000 pc=0x7f125f3d931f]
runtime stack:
runtime.throw({0x1c913b1?, 0x7f125f3d92d6?})
/usr/local/go/src/runtime/panic.go:1047 +0x5d fp=0x7f12168aacd0 sp=0x7f12168aaca0 pc=0x44189d
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:819 +0x369 fp=0x7f12168aad20 sp=0x7f12168aacd0 pc=0x458389
goroutine 1 [syscall]:
runtime.cgocall(0x187fe50, 0xc004846138)
/usr/local/go/src/runtime/cgocall.go:158 +0x5c fp=0xc0048460a0 sp=0xc004846068 pc=0x40b79c
import {
BroadcastMode,
coinsFromString,
SecretNetworkClient,
Wallet,
} from "secretjs";
import { BaseAccount } from "secretjs/dist/grpc_gateway/cosmos/auth/v1beta1/auth.pb";
import { AminoWallet } from "secretjs/dist/wallet_amino";
function sleep(ms: number) {
@assafmo
assafmo / when_last_block.sh
Created October 11, 2022 08:57
Last block
watch $'curl -s localhost:26657/status |
jq .result.sync_info.latest_block_time |
perl -pe "s/\.\d+Z/Z/" |
jq -r \'"Last block: " + (now - (. | fromdate) | floor | tostring) + " seconds ago"\''
#!/bin/bash
# https://gist.github.com/assafmo/01d7ee0d131a99518d2a4189a9250460
BLOCK_WINDOW="${1}" # e.g. 100000 blocks in the past
UPGRADE_TIME="${2}" # e.g. 2023-03-02T19:07:13Z
LCD="${3}" # e.g. https://lcd.secret.express or https://api.pulsar.scrttestnet.com
LATEST="$(curl -s "$LCD/cosmos/base/tendermint/v1beta1/blocks/latest")"
@assafmo
assafmo / shockwave-alpha.sh
Last active April 11, 2022 17:45
Launching a new local testnet
SGX_MODE=SW SCRT_SGX_STORAGE="$(pwd)/.sgx_secrets" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)" RUST_BACKTRACE=1 ./secretd --home "$(pwd)/.secretd" tx gov submit-proposal software-upgrade v1.3 --upgrade-height 28100 --title hi --description bye --deposit 10000000uscrt -y --from a
SGX_MODE=SW SCRT_SGX_STORAGE="$(pwd)/.sgx_secrets" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)" RUST_BACKTRACE=1 ./secretd --home "$(pwd)/.secretd" tx gov vote 1 yes --from a -y
@assafmo
assafmo / index.html
Last active March 28, 2024 15:24
SEO
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- SEO Title -->
<meta name="application-name" content="$SHORT_TITLE" />
<meta name="title" content="$TITLE" />
@assafmo
assafmo / Showcase_of_Secret_Network_for_LinkNow_by_Blocklike.pdf
Last active July 14, 2021 17:09
Showcase of Secret Network for LinkNow by Blocklike
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@assafmo
assafmo / Showcase of Secret Network for Privacy in Cosmos.pdf
Last active June 30, 2021 14:11
Showcase of Secret Network for Privacy in Cosmos
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@assafmo
assafmo / secretcli.sh
Last active June 9, 2021 14:11
{secret,terra}cli setup for testnet
sudo wget -O /bin/secretcli https://github.com/enigmampc/SecretNetwork/releases/download/v1.0.4/secretcli-linux-amd64
sudo chmod +x /bin/secretcli
mkdir -p ~/.secretcli/config
echo 'chain-id = "holodeck-2"
indent = true
keyring-backend = "test"
node = "https://chainofsecrets.secrettestnet.io:26667"
output = "json"