[][src]Crate solana

The solana library implements the Solana high-performance blockchain architecture. It includes a full Rust implementation of the architecture (see Fullnode) as well as hooks to GPU implementations of its most paralellizable components (i.e. SigVerify). It also includes command-line tools to spin up fullnodes and a Rust library (see ThinClient) to interact with them.

Modules

bank

The bank module tracks client accounts and the progress of smart contracts. It offers a high-level API that signs transactions on behalf of the caller, and a low-level API for when they have already been signed and verified.

banking_stage

The banking_stage processes Transaction messages. It is intended to be used to contruct a software pipeline. The stage uses all available CPU cores and can do its processing in parallel with signature verification on the GPU.

blob_fetch_stage

The blob_fetch_stage pulls blobs from UDP sockets and sends it to a channel.

bpf_loader

BPF loader

broadcast_stage

The broadcast_stage broadcasts data from a leader node to validators

budget

The budget module provides a domain-specific language for payment plans. Users create Budget objects that are given to an interpreter. The interpreter listens for Witness transactions, which it uses to reduce the payment plan. When the budget is reduced to a Payment, the payment is executed.

budget_instruction
budget_program

budget program

budget_transaction

The budget_transaction module provides functionality for creating Budget transactions.

choose_gossip_peer_strategy
client
cluster_info

The cluster_info module defines a data structure that is shared by all the nodes in the network over a gossip control plane. The goal is to share small bits of off-chain information and detect and repair partitions.

counter
drone

The drone module provides an object for launching a Solana Drone, which is the custodian of any remaining tokens in a mint. The Solana Drone builds and send airdrop transactions, checking requests against a request cap for a given time time_slice and (to come) an IP rate limit.

entry

The entry module is a fundamental building block of Proof of History. It contains a unique ID that is the hash of the Entry before it, plus the hash of the transactions within it. Entries cannot be reordered, and its field num_hashes represents an approximate amount of time since the last Entry was created.

entry_writer

The entry_writer module helps implement the TPU's write stage. It writes entries to the given writer, which is typically a file or stdout, and then sends the Entry to its output channel.

fetch_stage

The fetch_stage batches input from a UDP socket and sends it to a channel.

fullnode

The fullnode module hosts all the fullnode microservices.

hash

The hash module provides functions for creating SHA-256 hashes.

leader_scheduler

The leader_scheduler module implements a structure and functions for tracking and managing the schedule for leader rotation

leader_vote_stage

The leader_vote_stage module implements the TPU's vote stage. It computes and notes the votes for the entries, and then sends the Entry to its output channel.

ledger

The ledger module provides functions for parallel verification of the Proof of History ledger as well as iterative read, append write, and random access read to a persistent file-based ledger.

ledger_write_stage

The ledger_write_stage module implements the ledger write stage. It writes entries to the given writer, which is typically a file

loader_transaction

The dynamic_transaction module provides functionality for loading and calling a program

logger

The logger module provides a setup function for env_logger. Its only function, setup() may be called multiple times.

metrics

The metrics module enables sending measurements to an InfluxDB instance

mint

The mint module is a library for generating the chain's genesis block.

native_loader

Native loader

ncp

The ncp module implements the network control plane.

netutil

The netutil module assists with networking

packet

The packet module defines data structures and methods to pull data from the network.

payment_plan

The plan module provides a domain-specific language for payment plans. Users create Budget objects that are given to an interpreter. The interpreter listens for Witness transactions, which it uses to reduce the payment plan. When the plan is reduced to a Payment, the payment is executed.

poh

The Poh module provides an object for generating a Proof of History. It records Hashes items on behalf of its users.

poh_recorder

The poh_recorder module provides an object for synchronizing with Proof of History. It synchronizes PoH, bank's register_entry_id and the ledger

poh_service

The poh_service module implements a service that records the passing of "ticks", a measure of time in the PoH stream

recvmmsg

The recvmmsg module provides recvmmsg() API implementation

replicate_stage

The replicate_stage replicates transactions broadcast by the leader.

replicator
request

The request module defines the messages for the thin client.

request_processor

The request_processor processes thin client Request messages.

request_stage

The request_stage processes thin client Request messages.

result

The result module exposes a Result type that propagates one of many different Error types.

retransmit_stage

The retransmit_stage retransmits blobs between validators

rpc

The rpc module implements the Solana RPC interface.

rpc_pubsub

The pubsub module implements a threaded subscription service on client RPC request

rpc_request
rpu

The rpu module implements the Request Processing Unit, a 3-stage transaction processing pipeline in software. It listens for Request messages from clients and replies with Response messages.

service
signature

The signature module provides functionality for public, and private keys.

sigverify

The sigverify module provides digital signature verification functions. By default, signatures are verified in parallel using all available CPU cores. When --features=cuda is enabled, signature verification is offloaded to the GPU.

sigverify_stage

The sigverify_stage implements the signature verification stage of the TPU. It receives a list of lists of packets and outputs the same list, but tags each top-level list with a list of booleans, telling the next stage whether the signature in that packet is valid. It assumes each packet contains one transaction. All processing is done on the CPU by default and on a GPU if the cuda feature is enabled with --features=cuda.

storage_program

storage program Receive mining proofs from miners, validate the answers and give reward for good proofs.

storage_transaction
store_ledger_stage

The store_ledger stores the ledger from received entries for storage nodes

streamer

The streamer module defines a set of services for efficiently pulling data from UDP sockets.

system_program

system program

system_transaction

The system_transaction module provides functionality for creating system transactions.

thin_client

The thin_client module is a client-side object that interfaces with a server-side TPU. Client code should use this object instead of writing messages to the network directly. The binary encoding of its messages are unstable and may change in future releases.

tictactoe_dashboard_program

tic-tac-toe dashboard program

tictactoe_program

tic-tac-toe program

timing

The timing module provides std::time utility functions.

token_program

ERC20-like Token program

tpu

The tpu module implements the Transaction Processing Unit, a 5-stage transaction processing pipeline in software.

transaction

The transaction module provides functionality for creating log transactions.

tvu

The tvu module implements the Transaction Validation Unit, a 3-stage transaction validation pipeline in software.

vote_stage

The vote_stage votes on the last_id of the bank at a regular cadence

wallet
window

The window module defines data structure for storing the tail of the ledger.

window_service

The window_service provides a thread for maintaining a window (tail of the ledger).

Macros

socketaddr
socketaddr_any