Go to file
Tyera 875df9600d
Bump h2 to v0.3.17 (#31187)
h2 below v0.3.17 has a denial of service alert: https://github.com/solana-labs/solana/security/dependabot/349
2023-04-13 14:56:59 -07:00
.buildkite ci: export channel info in buildkite pre-command (#31162) 2023-04-13 11:32:57 +08:00
.github ci: use preinstalled openssl (#31107) 2023-04-13 06:24:53 +00:00
account-decoder
accounts-bench
accounts-cluster-bench
banking-bench
banks-client Add missing versioned tx support to BanksClient (#30958) 2023-03-29 20:47:25 +00:00
banks-interface
banks-server
bench-streamer uses Duration type instead of untyped ..._ms: u64 (#30971) 2023-03-31 15:42:49 +00:00
bench-tps reworks streamer::StakedNodes (#31082) 2023-04-10 17:07:40 +00:00
bloom
bucket_map disk index: add more tests (#31135) 2023-04-11 07:30:11 -07:00
cd
ci Remove workaround for already-fixed clippy bug (#30952) 2023-03-29 13:45:27 +09:00
clap-utils Enforce a minimum of 1 on full and incremental snapshot retention (#30968) 2023-03-30 10:16:36 -05:00
clap-v3-utils [clap-v3-utils] Define `EncodableKey` and make `keypair_from_path` and `keypair_from_seed` generic functions (#30947) 2023-04-06 07:42:11 +09:00
cli Cleanup - mock InvokeContext (#31007) 2023-04-03 17:23:24 +02:00
cli-config
cli-output
client uses Duration type instead of untyped ..._ms: u64 (#30971) 2023-03-31 15:42:49 +00:00
client-test
connection-cache passes through concrete QUIC connection errors up the call stack (#31168) 2023-04-12 19:53:25 +00:00
core Removes `base` from `IncrementalSnapshotHash` (#31185) 2023-04-13 17:35:35 +00:00
docs [docs][ci] skip usage doc build for non-deploys (#31063) 2023-04-13 13:26:26 -05:00
dos chore: workspace inheritance (#30939) 2023-03-29 03:28:56 +00:00
download-utils Enforce a minimum of 1 on full and incremental snapshot retention (#30968) 2023-03-30 10:16:36 -05:00
entry Only pass num_transactions to EntryNotifier (#31053) 2023-04-04 18:00:47 -06:00
faucet
frozen-abi
genesis
genesis-utils Reconfigure genesis hash download and check (#30949) 2023-04-10 11:46:56 -07:00
geyser-plugin-interface Update discord invite links (#30909) 2023-03-29 09:14:22 -07:00
geyser-plugin-manager Only pass num_transactions to EntryNotifier (#31053) 2023-04-04 18:00:47 -06:00
gossip validator: `--tpu-host-addr` -> `--public-tpu-address` (#31137) 2023-04-12 13:33:09 +00:00
install
keygen Improve keygen grind algo by 10% (#30365) 2023-04-05 22:36:13 -06:00
ledger Removes `base` from `IncrementalSnapshotHash` (#31185) 2023-04-13 17:35:35 +00:00
ledger-tool ledger-tool verify cli for final hash calc (#31153) 2023-04-12 07:30:45 -07:00
local-cluster Refactor fault hash injection into lambda (#31093) 2023-04-07 17:50:21 -05:00
log-analyzer
logger
measure
memory-management
merkle-root-bench
merkle-tree
metrics update influx enterprise scripts (#31117) 2023-04-10 09:10:54 -05:00
multinode-demo
net
net-shaper
net-utils
notifier
perf remove pub from to_packet_batches_for_tests (#31056) 2023-04-05 08:57:17 -07:00
poh Improve poh.rs readability (#30298) 2023-04-03 12:12:41 -07:00
poh-bench
program-runtime Retain usage counter on program upgrade (#31142) 2023-04-11 09:43:42 -07:00
program-test Refactor - Cleanup error handling in program runtime (#30693) 2023-04-05 15:50:34 +02:00
programs Bump h2 to v0.3.17 (#31187) 2023-04-13 14:56:59 -07:00
pubsub-client
quic-client passes through concrete QUIC connection errors up the call stack (#31168) 2023-04-12 19:53:25 +00:00
rayon-threadlimit
rbpf-cli Cleanup - mock InvokeContext (#31007) 2023-04-03 17:23:24 +02:00
remote-wallet
rpc Only pass num_transactions to EntryNotifier (#31053) 2023-04-04 18:00:47 -06:00
rpc-client
rpc-client-api
rpc-client-nonce-utils
rpc-test
runtime bank_from_latest_snapshot_dir (#31115) 2023-04-13 12:44:56 -07:00
scripts
sdk removes Packet Meta.sender_stake and find_packet_sender_stake_stage (#31077) 2023-04-06 21:33:43 +00:00
send-transaction-service
stake-accounts
storage-bigtable
storage-proto chore: workspace inheritance (#30939) 2023-03-29 03:28:56 +00:00
streamer removes duplicate connection-table arguments (#31172) 2023-04-12 20:39:29 +00:00
sys-tuner
system-test
test-validator
thin-client Relax `Sized` bound for `Signers` in `Transaction` and `Client` (#30568) 2023-03-30 13:12:48 +00:00
tokens
tpu-client Relax `Sized` bound for `Signers` in `Transaction` and `Client` (#30568) 2023-03-30 13:12:48 +00:00
transaction-dos
transaction-status
udp-client chore: workspace inheritance (#30939) 2023-03-29 03:28:56 +00:00
upload-perf
validator Inlines variables into logging format strings (#31177) 2023-04-12 22:16:38 +00:00
version
watchtower
web3.js
zk-token-sdk Remove unneeded `clippy::new_ret_no_self` allows (#31035) 2023-04-03 20:35:20 -06:00
.clippy.toml
.codecov.yml
.gitignore
.mergify.yml
.travis.yml
CONTRIBUTING.md contributing: Is your PR easy to say "yes" to? (#31059) 2023-04-06 08:43:22 -04:00
Cargo.lock Bump h2 to v0.3.17 (#31187) 2023-04-13 14:56:59 -07:00
Cargo.toml Bump serde from 1.0.158 to 1.0.159 (#31119) 2023-04-10 15:19:16 -07:00
LICENSE
README.md
RELEASE.md
SECURITY.md SECURITY.md: Require exploit PoC for submission consideration (#31113) 2023-04-11 19:32:48 -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.