Go to file
DimAn 7d556a110d
Cli: add `find-program-derived-address` command (#30370)
* Add find-program-address solana cli command

* clippy

* clippy after rebase

* rename find-program-address -> find-program-derived-address

* rename is_complex_seed -> is_structured_seed

* add validator is_structured_seed to clap-v3-utils

* return CliError::BadParameter for PROGRAM_ID arg in case of incorrect parsing

* improve help for SEEDS arg

* extend About for create-address-with-seed command

* fix SEED help
2023-04-17 16:17:40 +09: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 Upgrade to token-2022 0.6.0 (#30353) 2023-03-10 10:32:19 +09:00
accounts-bench chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
accounts-cluster-bench Add solana_clap_utils::hidden_unless_forced() (#30843) 2023-03-22 08:59:17 +00:00
banking-bench LeaderBankNotifier (#30395) 2023-03-27 08:17:17 -07:00
banks-client Add missing versioned tx support to BanksClient (#30958) 2023-03-29 20:47:25 +00:00
banks-interface chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
banks-server chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
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 chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
bucket_map disk index: add more tests (#31135) 2023-04-11 07:30:11 -07:00
cd Create continuous delivery directory and add readme with canary details. (#27683) 2022-09-13 14:33:49 -05:00
ci ci: cleanup (#31196) 2023-04-14 20:37:07 +00:00
clap-utils Cli: add `find-program-derived-address` command (#30370) 2023-04-17 16:17:40 +09:00
clap-v3-utils Cli: add `find-program-derived-address` command (#30370) 2023-04-17 16:17:40 +09:00
cli Cli: add `find-program-derived-address` command (#30370) 2023-04-17 16:17:40 +09:00
cli-config chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
cli-output Cli: add `find-program-derived-address` command (#30370) 2023-04-17 16:17:40 +09:00
client uses Duration type instead of untyped ..._ms: u64 (#30971) 2023-03-31 15:42:49 +00:00
client-test Track max_complete_rewards_slot for use in rpc, bigtable (#30698) 2023-03-14 12:08:48 -06:00
connection-cache passes through concrete QUIC connection errors up the call stack (#31168) 2023-04-12 19:53:25 +00:00
core Move reference-holding last_snapshot_storages from ABS to AHV (#31175) 2023-04-14 14:38:44 -07:00
docs fix docs blockstore formatting (#31105) 2023-04-14 12:13:28 +00: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 chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
frozen-abi remove unused hashbrown dependency (#31207) 2023-04-15 21:12:22 -07:00
genesis replaced chunks with tuples in validator (#30499) 2023-03-07 14:32:42 +01:00
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 test: add test_load_serde_yaml_v_0_8_config (#30558) 2023-03-03 12:44:02 +08:00
keygen Improve keygen grind algo by 10% (#30365) 2023-04-05 22:36:13 -06:00
ledger Move rent debit out of bank (#31204) 2023-04-14 19:41:10 +00:00
ledger-tool ledger-tool: Add deprecation warning for --no-compaction (#31178) 2023-04-15 00:18:03 -05:00
local-cluster Refactor fault hash injection into lambda (#31093) 2023-04-07 17:50:21 -05:00
log-analyzer chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
logger chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
measure measure: Measure::end_as{ns,us,ms,s,duration} (#30762) 2023-03-17 12:26:06 -07:00
memory-management chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
merkle-root-bench chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
merkle-tree chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
metrics add influx servers (#31218) 2023-04-16 19:42:25 -05:00
multinode-demo Simplify using additional arguments in bench-tps.sh (#31210) 2023-04-15 21:13:47 -07:00
net Tweak net.sh docs for primordial stakes (#30586) 2023-03-04 00:28:10 +01:00
net-shaper chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
net-utils chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
notifier chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
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 chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
program-runtime Fix incorrect ExecuteAccessoryTimings (#31167) 2023-04-16 22:40:52 +02:00
program-test Refactor - Cleanup error handling in program runtime (#30693) 2023-04-05 15:50:34 +02:00
programs remove unused hashbrown dependency (#31207) 2023-04-15 21:12:22 -07:00
pubsub-client Disambiguate tx = transaction, tx = sender in `pubsub-client` (#30519) 2023-02-24 20:20:00 -08:00
quic-client passes through concrete QUIC connection errors up the call stack (#31168) 2023-04-12 19:53:25 +00:00
rayon-threadlimit chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
rbpf-cli Refactor - Syscalls in RBPF CLI (#31109) 2023-04-14 15:20:08 +02:00
remote-wallet chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
rpc Move rent debit out of bank (#31204) 2023-04-14 19:41:10 +00:00
rpc-client chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
rpc-client-api chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
rpc-client-nonce-utils chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
rpc-test chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
runtime packed ancient: addref when pack operation fails (#31211) 2023-04-16 12:24:25 -07:00
scripts ci: cleanup (#31196) 2023-04-14 20:37:07 +00:00
sdk clean up delegation errors (#31202) 2023-04-14 15:30:59 -07:00
send-transaction-service chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
stake-accounts chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
storage-bigtable chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
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 chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
system-test chore: add bare type to testnet-automation.sh (#30933) 2023-03-28 20:02:49 +08:00
test-validator poh_verify => run_verification: Rename to be more accurate (#30811) 2023-03-22 11:03:30 -07:00
thin-client Relax `Sized` bound for `Signers` in `Transaction` and `Client` (#30568) 2023-03-30 13:12:48 +00:00
tokens chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
tpu-client Relax `Sized` bound for `Signers` in `Transaction` and `Client` (#30568) 2023-03-30 13:12:48 +00:00
transaction-dos chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
transaction-status Upgrade to token-2022 0.6.0 (#30353) 2023-03-10 10:32:19 +09:00
udp-client chore: workspace inheritance (#30939) 2023-03-29 03:28:56 +00:00
upload-perf chore: workspace inheritance (#29893) 2023-02-23 22:01:54 +08:00
validator Inlines variables into logging format strings (#31177) 2023-04-12 22:16:38 +00:00
version ci: test-checks.sh all sbf code & use nightly only (#30602) 2023-03-13 14:28:34 +09:00
watchtower Add solana_clap_utils::hidden_unless_forced() (#30843) 2023-03-22 08:59:17 +00:00
web3.js Add link to new web3.js repo (#30096) 2023-02-27 10:23:54 -06:00
zk-token-sdk Remove unneeded `clippy::new_ret_no_self` allows (#31035) 2023-04-03 20:35:20 -06:00
.clippy.toml
.codecov.yml Add .codecov.yml with checks disabled (#30666) 2023-03-10 20:11:22 +09:00
.gitignore Ingest duplicate proofs sent through Gossip (#29227) 2023-01-19 13:00:56 -08:00
.mergify.yml CI: Remove mergify backport config for v1.13 (#30520) 2023-03-07 11:10:23 -06:00
.travis.yml chore: remove Explorer build scripts from the Monorepo (#30262) 2023-02-10 17:25:32 -06:00
CONTRIBUTING.md contributing: Is your PR easy to say "yes" to? (#31059) 2023-04-06 08:43:22 -04:00
Cargo.lock Cli: add `find-program-derived-address` command (#30370) 2023-04-17 16:17:40 +09:00
Cargo.toml remove unused hashbrown dependency (#31207) 2023-04-15 21:12:22 -07:00
LICENSE update license 2023-01-30 15:42:44 -05:00
README.md update disclaimer 2023-01-30 17:40:53 -05:00
RELEASE.md RELEASE.md cleanup (#28007) 2022-09-24 20:30:25 -06:00
SECURITY.md SECURITY.md: Require exploit PoC for submission consideration (#31113) 2023-04-11 19:32:48 -06:00
cargo
cargo-build-bpf replace ./cargo with cargo in sbf/bpf build scripts (#29371) 2022-12-22 20:17:11 +01:00
cargo-build-sbf replace ./cargo with cargo in sbf/bpf build scripts (#29371) 2022-12-22 20:17:11 +01:00
cargo-test-bpf replace ./cargo with cargo in sbf/bpf build scripts (#29371) 2022-12-22 20:17:11 +01:00
cargo-test-sbf replace ./cargo with cargo in sbf/bpf build scripts (#29371) 2022-12-22 20:17:11 +01:00
fetch-perf-libs.sh
fetch-spl.sh Upgrade to token-2022 0.6.0 (#30353) 2023-03-10 10:32:19 +09:00
run.sh
rust-toolchain.toml Revert Rust 1.68.0 upgrade (#30897) 2023-03-25 02:41:12 +00:00
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.