Go to file
Yueh-Hsuan Chiang ce4251be99
Fix the return type of AccountsFile::account_matches_owners() (#30354)
Update AccountsFile::account_matches_owners() to return the matched index
2023-02-16 03:34:36 +00:00
.buildkite
.github ci: Do not produce build artifacts when run in a fork (#30294) 2023-02-14 00:31:44 -08:00
account-decoder
accounts-bench
accounts-cluster-bench embeds the new gossip ContactInfo in ClusterInfo (#30022) 2023-02-10 20:07:45 +00:00
banking-bench
banks-client
banks-interface
banks-server
bench-streamer
bench-tps embeds the new gossip ContactInfo in ClusterInfo (#30022) 2023-02-10 20:07:45 +00:00
bloom
bucket_map
cd
ci ci: group check steps into an individual queue (#30309) 2023-02-15 13:03:17 +08:00
clap-utils
clap-v3-utils
cli Simplify some comparisons using (a1, a2).cmp(&(b1, b2)) (#30321) 2023-02-15 05:11:48 +00:00
cli-config
cli-output Simplify some comparisons using (a1, a2).cmp(&(b1, b2)) (#30321) 2023-02-15 05:11:48 +00:00
client consolidates quic/udp dispatch macros (#30249) 2023-02-11 12:24:27 +00:00
client-test Bump futures-util from 0.3.25 to 0.3.26 (#30240) 2023-02-10 13:46:16 -07:00
connection-cache Bump futures-util from 0.3.25 to 0.3.26 (#30240) 2023-02-10 13:46:16 -07:00
core Rewrite accumulate_execute_units_and_time without allocation (#30338) 2023-02-15 17:22:24 -08:00
docs TPU and TVU docs changes (#30301) 2023-02-15 17:34:32 -07:00
dos embeds the new gossip ContactInfo in ClusterInfo (#30022) 2023-02-10 20:07:45 +00:00
download-utils
entry entry: Split `start_verify_transactions` into `*_{cpu,gpu}` (#29962) 2023-02-13 11:52:01 -08:00
faucet Use Ipv4Addr constants in socketaddr! (#30095) 2023-02-02 16:48:21 -07:00
frozen-abi Bump sha2 from 0.10.5 to 0.10.6 (#30215) 2023-02-09 12:18:09 -07:00
genesis
genesis-utils
geyser-plugin-interface Replace txn_signature in ReplicaAccountInfo with transaction (#30189) 2023-02-09 12:00:33 -08:00
geyser-plugin-manager Replace txn_signature in ReplicaAccountInfo with transaction (#30189) 2023-02-09 12:00:33 -08:00
gossip removes redundant CrdsGossipPull.msg_timeout (#30334) 2023-02-16 00:23:27 +00:00
install
keygen
ledger restore timestamp() in find_missing_indexes (#30345) 2023-02-15 16:12:36 -08:00
ledger-tool fixup! lt: Reallow custom accounts path with Secondary access (#30228) (#30236) 2023-02-10 14:09:14 -06:00
local-cluster Fixes race in local cluster incremental snapshot test (#30340) 2023-02-15 20:54:48 +00:00
log-analyzer
logger
measure measure_us! use Instant and duration_to_us internally (#30339) 2023-02-15 12:43:47 -08:00
memory-management
merkle-root-bench
merkle-tree
metrics
multinode-demo
net add client-type cli option documentation (#30170) 2023-02-08 10:56:25 +01:00
net-shaper
net-utils
notifier
perf chore: Use `i` over `ix` variable name when naming worker threads (#30206) 2023-02-09 01:24:57 +00:00
poh use measure_us, remove incorrect name (#30254) 2023-02-13 11:15:01 -08:00
poh-bench
program-runtime Code to load a program from its account (#30282) 2023-02-15 09:05:26 -08:00
program-test
programs Add timeout for getting bootstrap RPC peers (#30277) 2023-02-15 14:24:42 -08:00
pubsub-client Bump futures-util from 0.3.25 to 0.3.26 (#30240) 2023-02-10 13:46:16 -07:00
quic-client removes dynamic cast and dynamic dispatch from connection-cache (#30128) 2023-02-09 00:50:44 +00:00
rayon-threadlimit
rbpf-cli Added support of consumed BPF units tracing (#30042) 2023-02-10 16:17:44 +01:00
remote-wallet
rpc embeds the new gossip ContactInfo in ClusterInfo (#30022) 2023-02-10 20:07:45 +00:00
rpc-client
rpc-client-api Fix camelCase response for RpcPrioritizationFee (#30162) 2023-02-07 13:42:58 -07:00
rpc-client-nonce-utils
rpc-test Bump futures-util from 0.3.25 to 0.3.26 (#30240) 2023-02-10 13:46:16 -07:00
runtime Fix the return type of AccountsFile::account_matches_owners() (#30354) 2023-02-16 03:34:36 +00:00
scripts
sdk add cost tracking for each bank during replay (#30035) 2023-02-13 13:09:48 -06:00
send-transaction-service removes dynamic cast and dynamic dispatch from connection-cache (#30128) 2023-02-09 00:50:44 +00:00
stake-accounts
storage-bigtable chore: remove storage-bigtable/build-proto/Cargo.lock (#30273) 2023-02-14 01:36:39 +08:00
storage-proto
streamer Bump futures-util from 0.3.25 to 0.3.26 (#30240) 2023-02-10 13:46:16 -07:00
sys-tuner
system-test
test-validator embeds the new gossip ContactInfo in ClusterInfo (#30022) 2023-02-10 20:07:45 +00:00
thin-client Cleanup tempoary pub modules (#30268) 2023-02-10 20:35:09 -08:00
tokens
tpu-client Cleanup tempoary pub modules (#30268) 2023-02-10 20:35:09 -08:00
transaction-dos embeds the new gossip ContactInfo in ClusterInfo (#30022) 2023-02-10 20:07:45 +00:00
transaction-status chore: bump borsh to 0.9.3 (#29606) 2023-02-11 22:15:46 +08:00
udp-client removes dynamic cast and dynamic dispatch from connection-cache (#30128) 2023-02-09 00:50:44 +00:00
upload-perf
validator Add timeout for getting bootstrap RPC peers (#30277) 2023-02-15 14:24:42 -08:00
version
watchtower
zk-token-sdk
.clippy.toml
.gitignore
.mergify.yml chore: remove Explorer build scripts from the Monorepo (#30262) 2023-02-10 17:25:32 -06:00
.travis.yml chore: remove Explorer build scripts from the Monorepo (#30262) 2023-02-10 17:25:32 -06:00
CONTRIBUTING.md
Cargo.lock Add timeout for getting bootstrap RPC peers (#30277) 2023-02-15 14:24:42 -08:00
Cargo.toml
LICENSE
README.md
RELEASE.md
SECURITY.md chore: remove Explorer build scripts from the Monorepo (#30262) 2023-02-10 17:25:32 -06:00
cargo
cargo-build-bpf
cargo-build-sbf
cargo-test-bpf
cargo-test-sbf
fetch-perf-libs.sh
fetch-spl.sh
run.sh
rust-toolchain.toml
rustfmt.toml
test-abi.sh
vercel.json

README.md

Solana

Solana crate Solana documentation Build status codecov

Building

1. Install rustc, cargo and rustfmt.

$ curl https://sh.rustup.rs -sSf | sh
$ source $HOME/.cargo/env
$ rustup component add rustfmt

When building the master branch, please make sure you are using the latest stable rust version by running:

$ rustup update

When building a specific release branch, you should check the rust version in ci/rust-version.sh and if necessary, install that version by running:

$ rustup install VERSION

Note that if this is not the latest rust version on your machine, cargo commands may require an override in order to use the correct version.

On Linux systems you may need to install libssl-dev, pkg-config, zlib1g-dev, protobuf etc.

On Ubuntu:

$ sudo apt-get update
$ sudo apt-get install libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang cmake make libprotobuf-dev protobuf-compiler

On Fedora:

$ sudo dnf install openssl-devel systemd-devel pkg-config zlib-devel llvm clang cmake make protobuf-devel protobuf-compiler perl-core

2. Download the source code.

$ git clone https://github.com/solana-labs/solana.git
$ cd solana

3. Build.

$ ./cargo build

Testing

Run the test suite:

$ ./cargo test

Starting a local testnet

Start your own testnet locally, instructions are in the online docs.

Accessing the remote development cluster

  • devnet - stable public cluster for development accessible via devnet.solana.com. Runs 24/7. Learn more about the public clusters

Benchmarking

First, install the nightly build of rustc. cargo bench requires the use of the unstable features only available in the nightly build.

$ rustup install nightly

Run the benchmarks:

$ cargo +nightly bench

Release Process

The release process for this project is described here.

Code coverage

To generate code coverage statistics:

$ scripts/coverage.sh
$ open target/cov/lcov-local/index.html

Why coverage? While most see coverage as a code quality metric, we see it primarily as a developer productivity metric. When a developer makes a change to the codebase, presumably it's a solution to some problem. Our unit-test suite is how we encode the set of problems the codebase solves. Running the test suite should indicate that your change didn't infringe on anyone else's solutions. Adding a test protects your solution from future changes. Say you don't understand why a line of code exists, try deleting it and running the unit-tests. The nearest test failure should tell you what problem was solved by that code. If no test fails, go ahead and submit a Pull Request that asks, "what problem is solved by this code?" On the other hand, if a test does fail and you can think of a better way to solve the same problem, a Pull Request with your solution would most certainly be welcome! Likewise, if rewriting a test can better communicate what code it's protecting, please send us that patch!

Disclaimer

All claims, content, designs, algorithms, estimates, roadmaps, specifications, and performance measurements described in this project are done with the Solana Labs, Inc. (“SL”) good faith efforts. It is up to the reader to check and validate their accuracy and truthfulness. Furthermore, nothing in this project constitutes a solicitation for investment.

Any content produced by SL or developer resources that SL provides are for educational and inspirational purposes only. SL does not encourage, induce or sanction the deployment, integration or use of any such applications (including the code comprising the Solana blockchain protocol) in violation of applicable laws or regulations and hereby prohibits any such deployment, integration or use. This includes the use of any such applications by the reader (a) in violation of export control or sanctions laws of the United States or any other applicable jurisdiction, (b) if the reader is located in or ordinarily resident in a country or territory subject to comprehensive sanctions administered by the U.S. Office of Foreign Assets Control (OFAC), or (c) if the reader is or is working on behalf of a Specially Designated National (SDN) or a person subject to similar blocking or denied party prohibitions.

The reader should be aware that U.S. export control and sanctions laws prohibit U.S. persons (and other persons that are subject to such laws) from transacting with persons in certain countries and territories or that are on the SDN list. Accordingly, there is a risk to individuals that other persons using any of the code contained in this repo, or a derivation thereof, may be sanctioned persons and that transactions with such persons would be a violation of U.S. export controls and sanctions law.