Go to file
buffalu 70ebab2c82
Add rustfmt.toml and `cargo fmt` (#23238)
* fmt

* formatted

Co-authored-by: Lucas B <buffalu@jito.network>
2022-02-19 13:32:29 +08:00
.buildkite Extend buildkite cargo cache name to include host side rust version 2022-02-17 09:53:51 -08:00
.github opened github action after updated workflow permissions 2022-01-31 13:36:23 +05:30
.travis chore(web3): use github actions (#19816) 2021-09-13 16:37:18 -05:00
account-decoder chore: bump zstd from 0.9.2+zstd.1.5.1 to 0.10.0+zstd.1.5.2 (#23089) 2022-02-15 10:56:04 -07:00
accounts-bench Bump version to v1.10.0 2021-12-04 20:17:54 +00:00
accounts-cluster-bench rpc: use minimal mode by default 2022-02-01 19:00:06 -07:00
accountsdb-plugin-interface Add docs for notifying transactions via plugin (#22097) 2021-12-29 16:22:13 -08:00
accountsdb-plugin-manager Load AccountsDB plugins relative to plugin config (#23000) 2022-02-11 15:20:54 -08:00
banking-bench remove block limit for bench tests to avoid skew test result (#23204) 2022-02-17 03:44:34 +00:00
banks-client Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
banks-interface chore: bump serde from 1.0.134 to 1.0.136 (#22817) 2022-01-28 12:20:37 -07:00
banks-server convert std::sync::mpsc to crossbeam_channel (#22264) 2022-01-11 02:44:46 -08:00
bench-streamer bench-streamer improvements (#22945) 2022-02-05 14:13:49 +01:00
bench-tps adds validator version to set_panic_hook (#23082) 2022-02-11 18:04:10 +00:00
bloom chore: bump serde from 1.0.134 to 1.0.136 (#22817) 2022-01-28 12:20:37 -07:00
book/src/proposals Proposal to handle duplicate blocks (#16127) 2021-07-08 04:36:11 +00:00
bucket_map Use modular_bitfield to bitpack IndexEntry (#22447) 2022-01-12 14:37:34 -06:00
ci Enable incremental snapshots by default (#22938) 2022-02-09 13:26:35 -06:00
clap-utils Pacify clippy 2022-01-21 19:12:57 -08:00
cli cli: accept 'system' program id mnemonic for with seed 2022-02-18 19:51:18 -07:00
cli-config chore: bump serde from 1.0.134 to 1.0.136 (#22817) 2022-01-28 12:20:37 -07:00
cli-output Implement json output for solana ping (#22959) 2022-02-05 21:40:12 +00:00
client rpc: genericize client constructors 2022-02-16 10:05:46 -07:00
client-test Enforce tx metadata upload with static types (#23028) 2022-02-10 13:28:18 +08:00
core Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
docs docs: remove wallet ads 2022-02-16 22:19:10 -07:00
dos Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
download-utils Bump version to v1.10.0 2021-12-04 20:17:54 +00:00
entry Refactor: Add trait for loading addresses (#22903) 2022-02-03 11:00:12 +00:00
explorer Explorer: Add ed25519 sigverify precompile to search results (#23228) 2022-02-18 07:18:01 +00:00
faucet adds validator version to set_panic_hook (#23082) 2022-02-11 18:04:10 +00:00
frozen-abi chore: bump serde from 1.0.134 to 1.0.136 (#22817) 2022-01-28 12:20:37 -07:00
genesis chore: bump serde from 1.0.134 to 1.0.136 (#22817) 2022-01-28 12:20:37 -07:00
genesis-utils Bump version to v1.10.0 2021-12-04 20:17:54 +00:00
gossip Search for consecutive ports (#22979) 2022-02-07 17:53:40 +01:00
install chore: bump semver from 1.0.4 to 1.0.5 (#23071) 2022-02-11 11:19:52 -07:00
keygen chore: bump num_cpus from 1.13.0 to 1.13.1 (#22044) 2021-12-21 00:06:14 -07:00
ledger Skip adding builtins if they will be removed (#23233) 2022-02-18 18:36:59 -08:00
ledger-tool Introduce experimental FIFO-compaction option for shreds in blockstore (#22140) 2022-02-10 11:34:03 -08:00
local-cluster Fix flaky optimistic confirmation tests (#23178) 2022-02-16 16:13:58 -05:00
log-analyzer chore: bump serde from 1.0.134 to 1.0.136 (#22817) 2022-01-28 12:20:37 -07:00
logger Bump version to v1.10.0 2021-12-04 20:17:54 +00:00
measure Bump version to v1.10.0 2021-12-04 20:17:54 +00:00
merkle-root-bench Bump version to v1.10.0 2021-12-04 20:17:54 +00:00
merkle-tree chore: remove remaining unused Xargo.toml files 2022-01-24 15:35:54 -08:00
metrics adds validator version to set_panic_hook (#23082) 2022-02-11 18:04:10 +00:00
multinode-demo Enable incremental snapshots by default (#22938) 2022-02-09 13:26:35 -06:00
net minor fix for handling unsupported opt in script 2022-02-11 20:43:20 -08:00
net-shaper chore: bump serde from 1.0.134 to 1.0.136 (#22817) 2022-01-28 12:20:37 -07:00
net-utils Search for consecutive ports (#22979) 2022-02-07 17:53:40 +01:00
notifier Bump version to v1.10.0 2021-12-04 20:17:54 +00:00
perf Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
poh Introduce slot-specific packet metrics (#22906) 2022-02-11 03:07:45 -05:00
poh-bench Don't publish poh-bench to crates.io 2021-12-14 12:09:39 -08:00
program-runtime Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
program-test Cleanup: get_program_key() and get_loader_key() in TransactionContext (#23191) 2022-02-17 10:16:28 +01:00
programs Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
rayon-threadlimit chore: bump num_cpus from 1.13.0 to 1.13.1 (#22044) 2021-12-21 00:06:14 -07:00
rbpf-cli rbpf-cli: only run static analysis when needed (#23110) 2022-02-16 02:35:05 +00:00
remote-wallet Pacify clippy 2022-01-21 19:12:57 -08:00
replica-lib chore: bump tonic-build from 0.6.0 to 0.6.2 (#21764) 2021-12-10 09:31:15 +00:00
replica-node rpc: use minimal mode by default 2022-02-01 19:00:06 -07:00
rpc Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
rpc-test chore: bump serde from 1.0.134 to 1.0.136 (#22817) 2022-01-28 12:20:37 -07:00
runtime Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
scripts Add --locked to spl-token-cli install (#23223) 2022-02-17 22:09:29 -06:00
sdk Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
send-transaction-service rpc-sts: dedupe before initial send 2022-01-31 16:50:35 -07:00
stake-accounts Remove active features stake program v3 and v4 (#22612) 2022-01-21 19:27:53 -06:00
storage-bigtable chore: bump zstd from 0.9.2+zstd.1.5.1 to 0.10.0+zstd.1.5.2 (#23089) 2022-02-15 10:56:04 -07:00
storage-proto Enforce tx metadata upload with static types (#23028) 2022-02-10 13:28:18 +08:00
streamer Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
sys-tuner chore: bump libc from 0.2.115 to 0.2.117 (#23034) 2022-02-09 16:49:44 -07:00
system-test fixing CI 2022-01-17 16:12:24 +05:30
test-validator test-validator: use `JsonRpcConfig::default_for_test` for consistency 2022-02-16 10:05:46 -07:00
tokens Add fees to tx-wide caps (#22081) 2022-02-11 16:23:16 -08:00
transaction-dos rpc: use minimal mode by default 2022-02-01 19:00:06 -07:00
transaction-status Enforce tx metadata upload with static types (#23028) 2022-02-10 13:28:18 +08:00
upload-perf chore: bump serde_json from 1.0.75 to 1.0.78 (#22748) 2022-01-26 18:01:02 -07:00
validator validator: invert vote account sanity check arg 2022-02-16 10:05:46 -07:00
version chore: bump serde from 1.0.134 to 1.0.136 (#22817) 2022-01-28 12:20:37 -07:00
watchtower adds validator version to set_panic_hook (#23082) 2022-02-11 18:04:10 +00:00
web3.js feat(stake-program): support `splitWithSeed` (#23213) 2022-02-17 12:21:07 -07:00
zk-token-sdk Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
.clippy.toml
.codecov.yml
.gitignore Add option to load accounts from file 2021-12-15 11:05:02 -08:00
.mergify.yml Restrict the Mergify copy command to core contributors 2022-01-27 09:07:50 -08:00
.travis.yml closed explorer travis.yml after giving workflow permisssion in github action 2022-01-31 13:39:20 +05:30
CONTRIBUTING.md Fix CONTRIBUTING wording (#22291) 2022-01-05 06:27:10 +00:00
Cargo.lock accounts_index: Add SPL Token account indexing for token-2022 accounts (#23043) 2022-02-16 16:23:25 -08:00
Cargo.toml Fix ed25519 builtin program handling (#23182) 2022-02-16 18:48:55 +00:00
LICENSE up year in license 2022-02-01 08:29:29 -08:00
README.md Remove obsolete M1 setup information 2022-01-04 21:14:13 +00:00
RELEASE.md Update release documentation (#22086) 2021-12-22 22:51:32 -06:00
SECURITY.md Update security bounty levels (#20471) 2021-10-06 13:57:52 -06:00
cargo Speed up net.sh builds (#16360) 2021-04-07 14:45:03 +08:00
cargo-build-bpf Add helper crate to generate syscalls.txt 2021-12-14 21:20:13 -08:00
cargo-test-bpf Add cargo-test-bpf 2020-11-05 14:29:17 -08:00
fetch-perf-libs.sh
fetch-spl.sh feature: add new token program feature (#18780) 2021-07-21 14:34:25 +02:00
run.sh add some guidance in place of `./run.sh` 2021-09-11 14:49:17 -06:00
rustfmt.toml Add rustfmt.toml and `cargo fmt` (#23238) 2022-02-19 13:32:29 +08:00
test-abi.sh Update frozen_abi hashes 2020-10-24 08:37:55 -07:00
vercel.json removing the "autoJobCancelation": false 2021-10-07 20:49:58 +05:30

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, etc. On Ubuntu:

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

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 Foundation's ("SF") 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 SF or developer resources that SF provides are for educational and inspirational purposes only. SF 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. As a project-based primarily on open-source software, it is possible that such sanctioned persons may nevertheless bypass prohibitions, obtain the code comprising the Solana blockchain protocol (or other project code or applications) and deploy, integrate, or otherwise use it. Accordingly, there is a risk to individuals that other persons using the Solana blockchain protocol may be sanctioned persons and that transactions with such persons would be a violation of U.S. export controls and sanctions law. This risk applies to individuals, organizations, and other ecosystem participants that deploy, integrate, or use the Solana blockchain protocol code directly (e.g., as a node operator), and individuals that transact on the Solana blockchain through light clients, third party interfaces, and/or wallet software.