Solana is a high-performance blockchain platform designed to support decentralized applications and cryptocurrencies. Solana is known for its scalability, speed, and low transaction costs.
When building the master branch, ensure you are using the latest stable rust version by running:
When building a specific release branch, check the rust version in ci/rust-version.sh
and, if necessary, install that version:
Note that if this is not the latest rust version on your machine, cargo commands may require an override to use the correct version.
On Linux systems, you may need to install additional dependencies:
Start your own testnet locally; instructions are in the online docs.
First, install the nightly build of rustc. cargo bench
requires the use of the unstable features available only in the nightly build.
Run the benchmarks:
To generate code coverage statistics:
Why coverage? While most see coverage as a code quality metric, Solana sees it primarily as a developer productivity metric. When a developer makes a change to the codebase, the test suite indicates if the change didn't infringe on any other solutions. Adding a test protects your solution from future changes. If a line of code seems unnecessary, try deleting it and running the unit tests. The nearest test failure should indicate why the code exists. If no test fails, consider submitting a Pull Request to ask, "what problem is solved by this code?" If a test fails and you have a better solution, a Pull Request with your solution is welcome! Similarly, if rewriting a test can better communicate what code it's protecting, please send that patch!