Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View trevorbernard's full-sized avatar

Trevor Bernard trevorbernard

View GitHub Profile
@trevorbernard
trevorbernard / understanding-mina-transaction-fees.md
Last active February 29, 2024 18:18
Understanding how Mina transaction fees work on the `mainnet` network

User Commands (Transactions)

What are User Commands?

User commands, commonly called transactions, are user-initiated actions on the Mina blockchain. There are two types of transactions: payment transactions and stake delegations.

  • Payment Transactions: Users send MINA to other users.
  • Stake Delegations: Users delegate their staking weight to
use std::{fs, sync::Arc, thread};
use crossbeam_channel::bounded;
use mina_indexer::{block::ingestion, mina_blocks::v1::precomputed_block::parse_file};
use tempfile::TempDir;
#[test]
fn block_ingestion_watch_blocks() -> anyhow::Result<()> {
let block_src = "tests/data/non_sequential_blocks/mainnet-2-3NLyWnjZqUECniE1q719CoLmes6WDQAod4vrTeLfN7XXJbHv6EHH.json";
let (watch_tx, watch_rx) = bounded(16);
query StakesQuery($limit: Int = 10, $sort_by: StakeSortByInput!, $query: StakeQueryInput!) {
stakes(limit: $limit, sortBy: $sort_by, query: $query ) {
balance
chainId
delegate
epoch
ledgerHash
nonce
pk
public_key
query TransactionsQuery($limit: Int = 10, $sort_by: TransactionSortByInput!, $query: TransactionQueryInput!) {
transactions(limit: $limit, sortBy: $sort_by, query: $query ) {
blockHeight
canonical
amount
fee
kind
id
to
from
query BlocksQuery($query: BlockQueryInput!, $limit: Int = 10, $sort_by: BlockSortByInput!) {
blocks(query: $query, limit: $limit, sortBy: $sort_by) {
blockHeight
dateTime
stateHash
transactions {
coinbase
coinbaseReceiverAccount {
publicKey
}
use anyhow::anyhow;
use crossbeam_channel::{bounded, Receiver};
use glob::glob;
use mina_indexer::block::precomputed::{BlockLogContents, PrecomputedBlock};
use mina_indexer::display_duration;
use mina_indexer::state::ledger::genesis::{parse_file, GenesisLedger, GenesisRoot};
use notify::{Config, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
use rocksdb::{ColumnFamilyDescriptor, Options, WriteBatch, DB};
use serde_derive::{Deserialize, Serialize};
use std::path::{Path, PathBuf};

Mina Indexer

Build status

The Mina Indexer is a redesigned version of the software collectively called the "Mina archive node."

Note: As the project is in active development, be aware that the

# cloned from https://gist.github.com/jrwashburn/a46f67dd49500842b13638af85c35a63
# Modifed for MIP4 voting
from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport
# Select your transport with a defined url endpoint
transport = AIOHTTPTransport(url="https://graphql.minaexplorer.com")
# Create a GraphQL client using the defined transport
# cloned from https://gist.github.com/jrwashburn/a46f67dd49500842b13638af85c35a63
# Modifed for MIP3 voting
from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport
# Select your transport with a defined url endpoint
transport = AIOHTTPTransport(url="https://graphql.minaexplorer.com")
# Create a GraphQL client using the defined transport
@trevorbernard
trevorbernard / uat01.org
Last active May 10, 2023 16:59
Testing steps for UAT01 OCV

Mina User Acceptance Testing

UAT01 - Delegate vote override

An account holder that delegates their stake can override the vote of their delegate.

The follow defines some convenience methods to execute the testing sceneario.