2020-03-10 07:43:38 -07:00
|
|
|
# Install the Solana Tool Suite
|
2019-08-08 10:42:17 -07:00
|
|
|
|
2019-12-02 09:53:07 -08:00
|
|
|
Install the Solana release
|
2020-03-12 08:36:19 -07:00
|
|
|
[LATEST_SOLANA_RELEASE_VERSION](https://github.com/solana-labs/solana/releases/tag/LATEST_SOLANA_RELEASE_VERSION) on your
|
2019-12-02 09:53:07 -08:00
|
|
|
machine by running:
|
2019-08-08 10:42:17 -07:00
|
|
|
|
|
|
|
```bash
|
2020-03-12 08:36:19 -07:00
|
|
|
curl -sSf https://raw.githubusercontent.com/solana-labs/solana/LATEST_SOLANA_RELEASE_VERSION/install/solana-install-init.sh | sh -s - LATEST_SOLANA_RELEASE_VERSION
|
2019-08-08 10:42:17 -07:00
|
|
|
```
|
|
|
|
|
2020-03-12 08:36:19 -07:00
|
|
|
If you are connecting to a different testnet, you can replace `LATEST_SOLANA_RELEASE_VERSION` with the
|
2019-12-06 13:07:41 -08:00
|
|
|
release tag matching the software version of your desired testnet, or replace it
|
|
|
|
with the named channel `stable`, `beta`, or `edge`.
|
|
|
|
|
2019-11-28 14:39:27 -08:00
|
|
|
The following output indicates a successful update:
|
2019-09-22 20:38:34 -07:00
|
|
|
|
2019-11-28 14:39:27 -08:00
|
|
|
```text
|
|
|
|
looking for latest release
|
2020-03-12 08:36:19 -07:00
|
|
|
downloading LATEST_SOLANA_RELEASE_VERSION installer
|
2019-11-28 14:39:27 -08:00
|
|
|
Configuration: /home/solana/.config/solana/install/config.yml
|
|
|
|
Active release directory: /home/solana/.local/share/solana/install/active_release
|
2020-03-12 08:36:19 -07:00
|
|
|
* Release version: LATEST_SOLANA_RELEASE_VERSION
|
|
|
|
* Release URL: https://github.com/solana-labs/solana/releases/download/LATEST_SOLANA_RELEASE_VERSION/solana-release-x86_64-unknown-linux-gnu.tar.bz2
|
2019-11-28 14:39:27 -08:00
|
|
|
Update successful
|
2019-08-08 10:42:17 -07:00
|
|
|
```
|
|
|
|
|
2019-12-02 09:53:07 -08:00
|
|
|
After a successful install, `solana-install update` may be used to easily update
|
|
|
|
the cluster software to a newer version at any time.
|
2019-08-08 10:42:17 -07:00
|
|
|
|
|
|
|
## Download Prebuilt Binaries
|
2019-09-22 20:38:34 -07:00
|
|
|
|
2019-12-02 09:53:07 -08:00
|
|
|
If you would rather not use `solana-install` to manage the install, you can
|
|
|
|
manually download and install the binaries.
|
2019-08-08 10:42:17 -07:00
|
|
|
|
|
|
|
### Linux
|
2019-09-22 20:38:34 -07:00
|
|
|
|
2019-12-02 09:53:07 -08:00
|
|
|
Download the binaries by navigating to
|
|
|
|
[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest),
|
|
|
|
download **solana-release-x86\_64-unknown-linux-gnu.tar.bz2**, then extract the
|
|
|
|
archive:
|
2019-09-22 20:38:34 -07:00
|
|
|
|
2019-08-08 10:42:17 -07:00
|
|
|
```bash
|
2019-10-29 16:13:20 -07:00
|
|
|
tar jxf solana-release-x86_64-unknown-linux-gnu.tar.bz2
|
|
|
|
cd solana-release/
|
|
|
|
export PATH=$PWD/bin:$PATH
|
2019-08-08 10:42:17 -07:00
|
|
|
```
|
2019-09-22 20:38:34 -07:00
|
|
|
|
2019-11-28 14:39:27 -08:00
|
|
|
### macOS
|
2019-09-22 20:38:34 -07:00
|
|
|
|
2019-12-02 09:53:07 -08:00
|
|
|
Download the binaries by navigating to
|
|
|
|
[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest),
|
|
|
|
download **solana-release-x86\_64-apple-darwin.tar.bz2**, then extract the
|
|
|
|
archive:
|
2019-09-22 20:38:34 -07:00
|
|
|
|
2019-08-08 10:42:17 -07:00
|
|
|
```bash
|
2019-10-29 16:13:20 -07:00
|
|
|
tar jxf solana-release-x86_64-apple-darwin.tar.bz2
|
|
|
|
cd solana-release/
|
|
|
|
export PATH=$PWD/bin:$PATH
|
2019-08-08 10:42:17 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
## Build From Source
|
2019-09-22 20:38:34 -07:00
|
|
|
|
2019-12-02 09:53:07 -08:00
|
|
|
If you are unable to use the prebuilt binaries or prefer to build it yourself
|
|
|
|
from source, navigate to
|
|
|
|
[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest),
|
|
|
|
and download the **Source Code** archive. Extract the code and build the
|
|
|
|
binaries with:
|
2019-09-22 20:38:34 -07:00
|
|
|
|
2019-08-08 10:42:17 -07:00
|
|
|
```bash
|
2019-10-29 16:13:20 -07:00
|
|
|
./scripts/cargo-install-all.sh .
|
|
|
|
export PATH=$PWD/bin:$PATH
|
2019-08-08 10:42:17 -07:00
|
|
|
```
|
2019-11-28 14:39:27 -08:00
|
|
|
|
2019-12-02 09:53:07 -08:00
|
|
|
You can then run the following command to obtain the same result as with
|
|
|
|
prebuilt binaries:
|
2019-11-28 14:39:27 -08:00
|
|
|
|
|
|
|
```bash
|
|
|
|
solana-install init
|
|
|
|
```
|
2020-03-10 09:23:58 -07:00
|
|
|
|
|
|
|
# Choosing a Cluster
|
|
|
|
|
|
|
|
Solana maintains several clusters, each featuring a Solana-owned validator
|
|
|
|
that serves as an entrypoint to the cluster.
|
|
|
|
|
|
|
|
Current cluster entrypoints:
|
|
|
|
|
|
|
|
* Devnet: devnet.solana.com
|
|
|
|
* Tour de SOL: tds.solana.com
|
|
|
|
|
|
|
|
Application developers should target Devnet. Key differences
|
|
|
|
between Devnet and what will be Mainnet:
|
|
|
|
|
|
|
|
* Devnet tokens are not real
|
|
|
|
* Devnet includes a token faucet for application testing
|
|
|
|
* Devnet may be subject to ledger resets
|
|
|
|
* Devnet typically runs a newer software version than mainnet
|
|
|
|
* Devnet may be maintained by different validators than mainnet
|
|
|
|
|
|
|
|
## Configure the Command-line
|
|
|
|
|
|
|
|
You can check what cluster the Solana CLI is currently targeting by
|
|
|
|
running the following command:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
solana config get
|
|
|
|
```
|
|
|
|
|
|
|
|
Use the `solana config set` command to target a different cluster.
|
|
|
|
For example, for Devnet, use:
|
|
|
|
|
|
|
|
```bash
|
2020-03-13 15:00:27 -07:00
|
|
|
solana config set --url http://devnet.solana.com
|
2020-03-10 09:23:58 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
## Ensure Versions Match
|
|
|
|
|
|
|
|
Though not strictly necessary, the CLI will generally work best when its version
|
|
|
|
matches the software version running on the cluster. To get the CLI version, run:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
solana --version
|
|
|
|
```
|
|
|
|
|
|
|
|
To get the cluster version, run:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
solana cluster-version
|
|
|
|
```
|
|
|
|
|
|
|
|
Ensure the CLI version is greater than or equal to the cluster version.
|