Go to file
hana 11f331764e
derive Clone for OutputFormat in cli-output (#32138)
2023-06-14 15:22:23 -07:00
.buildkite ci: discard misleading `cargo uninstall` errors in bk post-checkout hook (#32139) 2023-06-14 16:01:48 -06:00
.github
account-decoder Hide Keybase and replace with URL (#31852) 2023-06-06 06:22:55 -07:00
accounts-bench
accounts-cluster-bench
banking-bench
banks-client
banks-interface
banks-server Cleanup - require_static_program_ids_in_transaction (#31767) 2023-06-07 17:12:41 +02:00
bench-streamer
bench-tps bench-tps add 1_000 as multiplier to compute-unit-price (#32132) 2023-06-14 14:50:18 -05:00
bloom chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
bucket_map remove compiler warning (#32081) 2023-06-12 13:48:17 -07:00
cd
ci
clap-utils
clap-v3-utils
cli Fix minimum balance when deploying program (#32129) 2023-06-14 17:44:20 +00:00
cli-config
cli-output derive Clone for OutputFormat in cli-output (#32138) 2023-06-14 15:22:23 -07:00
client removes redundant NewConnectionConfig trait (#31979) 2023-06-06 21:28:29 +00:00
client-test
connection-cache removes redundant NewConnectionConfig trait (#31979) 2023-06-06 21:28:29 +00:00
core bank_send_loop: Reduce feature flag polling frequency 2023-06-13 15:51:50 -06:00
docs Add epoch_reward sysvar (#32049) 2023-06-14 08:41:26 -05:00
dos
download-utils Enforce a minimum of 1 on full and incremental snapshot retention (#30968) 2023-03-30 10:16:36 -05:00
entry Cleanup - require_static_program_ids_in_transaction (#31767) 2023-06-07 17:12:41 +02:00
faucet
frozen-abi
genesis Bumps base64 from 0.13.1 to 0.21.0. (#31522) 2023-05-11 11:34:58 -07:00
genesis-utils
geyser-plugin-interface
geyser-plugin-manager
gossip adds const SOCKET_ADDR_UNSPECIFIED (#32102) 2023-06-13 19:34:59 +00:00
install Cargo.toml: winapi: List used features (#31417) 2023-04-29 01:23:15 -07:00
keygen
ledger Cleanup - require_static_program_ids_in_transaction (#31767) 2023-06-07 17:12:41 +02:00
ledger-tool Fix - LoadedProgramType::Closed (#31922) 2023-06-08 15:40:18 +02:00
local-cluster Removes unnecessary call to `purge_old_bank_snapshots()` in local-cluster test (#32111) 2023-06-14 14:11:35 -04:00
log-analyzer chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
logger
measure
memory-management
merkle-root-bench
merkle-tree
metrics fix: metrics deploy script (#32074) 2023-06-12 22:15:09 +08:00
multinode-demo
net
net-shaper
net-utils adds quic receiver to shred-fetch-stage (#31576) 2023-06-12 13:16:27 +00:00
notifier
perf
poh Fix panic in record() (#31978) 2023-06-07 18:40:46 -04:00
poh-bench
program-runtime Add runtime environment to FailedVerification tombstones (#31991) 2023-06-06 22:24:39 +00:00
program-test
programs Cleanup - filter_votes_outside_slot_hashes (#31760) 2023-06-14 01:31:27 +02:00
pubsub-client
quic-client adds code-path broadcasting shreds using QUIC (#31610) 2023-06-12 22:58:27 +00:00
rayon-threadlimit
rbpf-cli
remote-wallet
rpc Cleanup - require_static_program_ids_in_transaction (#31767) 2023-06-07 17:12:41 +02:00
rpc-client
rpc-client-api
rpc-client-nonce-utils
rpc-test
runtime add begin_partitioned_rewards (#32116) 2023-06-14 14:24:49 -07:00
scripts Bump patched ntapi from v0.3.6 to v0.3.7 (#31981) 2023-06-06 13:33:57 +09:00
sdk Add epoch_reward sysvar (#32049) 2023-06-14 08:41:26 -05:00
send-transaction-service
stake-accounts chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
storage-bigtable
storage-proto add ProgramExecutionTemporarilyRestricted error (#31796) 2023-06-06 14:13:41 -07:00
streamer Use QUIC Retry packets during handshake (#31802) 2023-06-06 14:23:23 -07:00
system-test
test-validator
thin-client removes redundant NewConnectionConfig trait (#31979) 2023-06-06 21:28:29 +00:00
tokens Clean up Spl type conversions (#31845) 2023-05-30 14:34:38 -06:00
tpu-client removes redundant NewConnectionConfig trait (#31979) 2023-06-06 21:28:29 +00:00
transaction-dos makes sockets in LegacyContactInfo private (#31248) 2023-04-21 15:39:16 +00:00
transaction-status Cleanup - require_static_program_ids_in_transaction (#31767) 2023-06-07 17:12:41 +02:00
udp-client removes redundant NewConnectionConfig trait (#31979) 2023-06-06 21:28:29 +00:00
upload-perf chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
validator adds const SOCKET_ADDR_UNSPECIFIED (#32102) 2023-06-13 19:34:59 +00:00
version
watchtower
web3.js
zk-keygen
zk-token-sdk [zk-token-sdk] Update transcript functions to use full names (#32095) 2023-06-13 14:52:15 +09: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 borsh from 0.10.3 to 0.11.0 (#31964) 2023-06-13 21:45:45 +02:00
Cargo.toml Bump borsh from 0.10.3 to 0.11.0 (#31964) 2023-06-13 21:45:45 +02:00
LICENSE
README.md
RELEASE.md
SECURITY.md
cargo
cargo-build-bpf
cargo-build-sbf replace ./cargo with cargo in sbf/bpf build scripts (#29371) 2022-12-22 20:17:11 +01:00
cargo-test-bpf
cargo-test-sbf
fetch-perf-libs.sh
fetch-spl.sh
nextest.toml
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.