Skip to content

Instantly share code, notes, and snippets.

View larry0x's full-sized avatar
🇵🇹
PT

Larry larry0x

🇵🇹
PT
View GitHub Profile
@larry0x
larry0x / Cargo.toml
Created October 27, 2024 17:31
websocket demo
[package]
name = "websocket-demo"
version = "0.0.0"
edition = "2021"
[dependencies]
anyhow = "1"
futures = "0.3"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
@larry0x
larry0x / settings.json
Created May 11, 2024 18:33
Customize VSCode watermark logo
{
"apc.stylesheet": {
".editor-group-watermark > .letterpress": "background-image: url(https://raw.githubusercontent.com/Aikoyori/ProgrammingVTuberLogos/main/VSCode/VSCode.png) !important; width: unset !important; height: 250px; aspect-ratio: 16/9 !important; filter: drop-shadow(5px 5px 5px #222); margin-bottom: 2rem;"
}
}
@larry0x
larry0x / how-to-spin-up-local-devnet.md
Last active August 7, 2024 12:55
How to spin up a local Grug devnet

How to spin up a local devnet

  1. Compile CometBFT, i.e. the sequencing layer:
git clone https://github.com/cometbft/cometbft
cd cometbft
git checkout v0.38.10
make install
@larry0x
larry0x / go.mod
Last active February 12, 2024 18:39
How to use RocksDB's user-defined timestamp feature in Go
module playground
go 1.21
require github.com/linxGnu/grocksdb v1.8.4

Configure gpg signing (importing an existing private key):

git config --global user.name 'your-name'
git config --global user.email 'your-email'
git config --global user.signingkey 'your-gpg-pubkey'
git config --global commit.gpgsign true
git config --global --list

sudo apt install gpg
@larry0x
larry0x / cw-sdk-bank-contract.md
Last active August 25, 2023 23:26
CW-SDK bank contract

CW-SDK's bank contract will manage both fungible and nonfungible tokens.

  • Each fungible token is identified by a denom
  • Each nonfungible token is identified by a tuple (denom, sequence) where sequence is a u64; the 1st token in the collection gets a sequence of 0, the 2nd gets 1, so on

An NFT collection cannot share the same denom with a fungible token.

struct Coin {
    pub denom:  String,
{
"genesis_time": "2023-05-23T00:00:00.000000Z",
"chain_id": "dev-1",
"initial_height": "1",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "-1"
},
"evidence": {
#!/bin/bash
# Some helper functions for working with cosmos-sdk txs from the command line or
# in bash scripts.
#
# Example: say, if you want to send coins to multiple recipients. We need to:
#
# - compose a tx containing multiple "send" messages
# - set an appropriate gas limit and fee amount
# - sign it
# update ubuntu packages
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
# update rust
rustup update && rustc -V
# update cargo global dependencies
# dependencies:
# sudo apt install build-essential libssl-dev wget pkg-config
cargo install cargo-update --bin cargo-install-update
//! ```cargo
//! [dependencies]
//! chrono = "0.4"
//! csv = "1"
//! ethers = "2"
//! reqwest = { version = "0.11", features = ["json"] }
//! rustc-hex = "2"
//! serde = "1"
//! thiserror = "1"
//! tokio = { version = "1", features = ["full"] }