Go to file
steviez c2e45773af
Fixup is_niceness_adjustment_valid unit test for non-linux case (#32363)
The test needs to be aware of is_niceness_adjustment_valid from super
scope; however, the use directive in test module only runs on Linux
systems.
2023-07-05 14:27:03 -04:00
.buildkite ci: only kill containers that are based on the solanalabs/rust* images (#32292) 2023-06-29 12:18:03 +08:00
.github Patch ntapi to restore windows build (#31961) 2023-06-05 16:51:43 +09:00
account-decoder Add epoch_rewards syscalls (#32159) 2023-06-27 09:14:43 -05: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 Funding transactions must specify data limit (#32131) 2023-06-15 18:53:04 +00:00
bloom
bucket_map remove compiler warning (#32081) 2023-06-12 13:48:17 -07:00
cd
ci Install jq in docker (#32340) 2023-06-30 13:32:25 +09:00
clap-utils Move is_niceness logic out of clap utils to reduce dependencies (#32331) 2023-06-29 14:03:36 +02:00
clap-v3-utils Move is_niceness logic out of clap utils to reduce dependencies (#32331) 2023-06-29 14:03:36 +02:00
cli Enable partitioned epoch reward by feature id (#32174) 2023-06-20 12:12:50 -05:00
cli-config
cli-output Add skip rate to docs and adjust block-production to use the term ski… (#32230) 2023-06-21 16:38:46 -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 move ThreadAwareAccountLocks into scheduler module (#32298) 2023-07-05 09:44:18 -07:00
docs Fix typo in simple-payment-and-state-verification.md (#32374) 2023-07-04 11:58:00 -06:00
dos removes outdated tvu_forward socket (#32101) 2023-06-20 20:50:16 +00:00
download-utils
entry Cleanup - require_static_program_ids_in_transaction (#31767) 2023-06-07 17:12:41 +02:00
faucet
frozen-abi
genesis
genesis-utils
geyser-plugin-interface
geyser-plugin-manager
gossip Increase push fanout from 6 to 9 (#32323) 2023-06-28 19:03:12 -05:00
install
keygen
ledger ledger-tool: Manually walk optimistic slots ancestors (#32362) 2023-07-05 10:18:15 -04:00
ledger-tool Bump solana_rbpf to v0.6.0 (#32313) 2023-07-05 19:46:21 +02:00
local-cluster Define ClusterConfig::new_with_equal_stakes() (#32330) 2023-06-30 10:35:26 +09:00
log-analyzer
logger
measure
memory-management
merkle-root-bench
merkle-tree
metrics chore: remove unused code (#32195) 2023-06-20 10:48:44 +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 Fixup is_niceness_adjustment_valid unit test for non-linux case (#32363) 2023-07-05 14:27:03 -04:00
poh Fix panic in record() (#31978) 2023-06-07 18:40:46 -04:00
poh-bench
program-runtime Bump solana_rbpf to v0.6.0 (#32313) 2023-07-05 19:46:21 +02:00
program-test Test epoch rewards sysvar in program test (#32293) 2023-06-28 10:50:11 -05:00
programs Bump solana_rbpf to v0.6.0 (#32313) 2023-07-05 19:46:21 +02:00
pubsub-client
quic-client adds QUIC endpoint specific for turbine connections (#32294) 2023-07-03 18:57:18 +00:00
rayon-threadlimit
rbpf-cli
remote-wallet
rpc Move NonceInfo, NonceFull and NoncePartial out of bank.rs (#32375) 2023-07-05 10:44:54 -07:00
rpc-client
rpc-client-api
rpc-client-nonce-utils
rpc-test
runtime Adds cache_hash_data_us to HashStats (#32371) 2023-07-05 13:57:07 -04:00
scripts Update Solang Solidity compiler to v0.3.1 (#32352) 2023-07-03 10:20:49 -03:00
sdk Fix alt_bn128 declarations as expected by gen-headers and regenerate (#32367) 2023-07-03 10:59:28 -07:00
send-transaction-service Fixing send-transaction-service using quic, tpu address is wrong (#31899) 2023-06-02 09:25:23 -07:00
stake-accounts
storage-bigtable
storage-proto add ProgramExecutionTemporarilyRestricted error (#31796) 2023-06-06 14:13:41 -07:00
streamer adds QUIC endpoint specific for turbine connections (#32294) 2023-07-03 18:57:18 +00:00
system-test
test-validator refactor core to create consensus module (#32282) 2023-06-27 17:25:08 -07:00
thin-client removes redundant NewConnectionConfig trait (#31979) 2023-06-06 21:28:29 +00:00
tokens
tpu-client removes redundant NewConnectionConfig trait (#31979) 2023-06-06 21:28:29 +00:00
transaction-dos
transaction-status Cleanup - require_static_program_ids_in_transaction (#31767) 2023-06-07 17:12:41 +02:00
turbine adds QUIC endpoint specific for turbine connections (#32294) 2023-07-03 18:57:18 +00:00
udp-client removes redundant NewConnectionConfig trait (#31979) 2023-06-06 21:28:29 +00:00
upload-perf
validator Move is_niceness logic out of clap utils to reduce dependencies (#32331) 2023-06-29 14:03:36 +02:00
version
watchtower
web3.js
zk-keygen [zk-token-sdk] Make `ElGamalKeypair` fields private (#32190) 2023-06-22 10:28:13 +09:00
zk-token-sdk [zk-token-sdk] replace hard-coded constants with constant variables (#32274) 2023-06-29 07:03:26 +09:00
.clippy.toml
.codecov.yml
.gitignore
.mergify.yml
.travis.yml
CONTRIBUTING.md
Cargo.lock Bump solana_rbpf to v0.6.0 (#32313) 2023-07-05 19:46:21 +02:00
Cargo.toml Bump solana_rbpf to v0.6.0 (#32313) 2023-07-05 19:46:21 +02:00
LICENSE
README.md
RELEASE.md
SECURITY.md
cargo
cargo-build-bpf
cargo-build-sbf
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.