Skip to content

Instantly share code, notes, and snippets.

@ochaloup
ochaloup / delete_git_submodule.md
Created September 14, 2022 08:29 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule

Solana validator v1.14.17 startup + catchup logs

This document contains a listing of solana-validator logs that outline noteworthy steps during node startup + catchup process. Several quick notes:

  • These logs are from an actual node restart with tip of v1.14 branch against mainnet-beta
  • Lines starting with // are inserted commentary
  • Some newlines have been inserted to allow for better viewing
  • This node was running with the default logging RUST_LOG=solana=info
  • Hardware config:
    • AMD EPYC 7402P 24-Core Processor
    • 256 GB RAM

Solana validator v1.14.17 startup + catchup logs

This document contains a listing of solana-validator logs that outline noteworthy steps during node startup + catchup process. Several quick notes:

  • These logs are from an actual node restart with tip of v1.14 branch against mainnet-beta
  • Lines starting with // are inserted commentary
  • Some newlines have been inserted to allow for better viewing
  • This node was running with the default logging RUST_LOG=solana=info
  • Hardware config:
    • AMD EPYC 7402P 24-Core Processor
    • 256 GB RAM
@ochaloup
ochaloup / main.rs
Created September 19, 2023 07:54 — forked from FrankC01/main.rs
Faux example of serializing BTreeMap to Solana State
use std::{collections::BTreeMap, iter::repeat};
use arrayref::{array_mut_ref, array_ref, array_refs, mut_array_refs};
use borsh::{BorshDeserialize, BorshSerialize};
const INITIALIZED_BYTES: usize = 1;
const TRACKING_CHUNK_LENGTH: usize = 4;
const TRACKING_CHUNK_BYTES: usize = 5116;
const TRACKING_ACCOUNT_STATE_SPACE: usize =
INITIALIZED_BYTES + TRACKING_CHUNK_LENGTH + TRACKING_CHUNK_BYTES;
@ochaloup
ochaloup / Dockerfile
Created January 11, 2024 16:53 — forked from siong1987/Dockerfile
Dockerfile to build 0.28.0 anchor with 1.14.18 solana.
#
# Docker image to generate deterministic, verifiable builds of Anchor programs.
# This must be run *after* a given ANCHOR_CLI version is published and a git tag
# is released on GitHub.
#
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
@ochaloup
ochaloup / snapshots.md
Created January 19, 2024 13:42 — forked from ripatel-fd/snapshots.md
Informal Guide to Solana Snapshots

Consider this an informal guide to reading the Solana snapshot format. This guide is written for Solana Labs versions v1.14 through v1.17.

You are probably reading this because you want to read the accounts in a snapshot without going through the pain of interfacing with the Solana Labs codebase.

Terminology

We assume general familiarity with the Solana ledger.

#!/usr/bin/env bash
BINDIR=./target/debug
TESTDIR=./gen-ledger
FAUCET_KEYPAIR="$TESTDIR"/bootstrap/faucet-keypair.json
CONFIG="$TESTDIR"/config.yml
VALIDATOR_CNT=4
BOOTSTRAP_RPC="http://127.0.0.1:8899"
BOOTSTRAP_GOSSIP="127.0.0.1:8000"
WARMUP_SLOT=20