Crate solana[][src]

The solana library implements the Solana high-performance blockchain architecture. It includes a full Rust implementation of the architecture (see Server) 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 balances 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.

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.

counter
crdt

The crdt 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.

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.

hash

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

ledger

The ledger module provides functions for parallel verification of the Proof of History ledger.

logger

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

mint

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

ncp

The ncp module implements the network control plane.

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.

record_stage

The record_stage module provides an object for generating a Proof of History. It records Transaction items on behalf of its users. It continuously generates new hashes, only stopping to check if it has been sent an Transaction item. It tags each Transaction with an Entry, and sends it back. The Entry includes the Transaction, the latest hash, and the number of hashes since the last transaction. The resulting stream of entries represents ordered transactions in time.

recorder

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

replicate_stage

The replicate_stage replicates transactions broadcast by the leader.

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.

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.

server

The server module hosts all the server microservices.

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.

streamer

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

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.

timing

The timing module provides std::time utility functions.

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 5-stage transaction validation pipeline in software.

write_stage

The write_stage module implements 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.