Move from gitbook to docusaurus, build docs in Travis CI (#10970)

* fix: ignore unknown fields in more RPC responses

* Remove mdbook infrastructure

* Delete gitattributes and other theme related items

Move all docs to /docs folder to support Docusaurus

* all docs need to be moved to /docs

* can be changed in the future

Add Docusaurus infrastructure

* initialize docusaurus repo

Remove trailing whitespace, add support for eslint

Change Docusaurus configuration to support `src`

* No need to rename the folder! Change a setting and we're all good to
go.

* Fixing rebase items

* Remove unneccessary markdown file, fix type

* Some fonts are hard to read. Others, not so much. Rubik, you've been
sidelined. Roboto, into the limelight!

* As much as we all love tutorials, I think we all can navigate around a
markdown file. Say goodbye, `mdx.md`.

* Setup deployment infrastructure

* Move docs job from buildkite to travic

* Fix travis config

* Add vercel token to travis config

* Only deploy docs after merge

* Docker rust env

* Revert "Docker rust env"

This reverts commit f84bc208e807aab1c0d97c7588bbfada1fedfa7c.

* Build CLI usage from docker

* Pacify shellcheck

* Run job on PR and new commits for publication

* Update README

* Fix svg image building

* shellcheck

Co-authored-by: Michael Vines <mvines@gmail.com>
Co-authored-by: Ryan Shea <rmshea@users.noreply.github.com>
Co-authored-by: publish-docs.sh <maintainers@solana.com>
This commit is contained in:
Dan Albert
2020-07-10 23:11:07 -06:00
committed by GitHub
parent 4046f87134
commit ffeac298a2
172 changed files with 2862 additions and 3429 deletions

View File

@@ -1,7 +1,9 @@
# Command-line Guide
---
title: Command-line Guide
---
In this section, we will describe how to use the Solana command-line tools to
create a *wallet*, to send and receive SOL tokens, and to participate in
create a _wallet_, to send and receive SOL tokens, and to participate in
the cluster by delegating stake.
To interact with a Solana cluster, we will use its command-line interface, also
@@ -11,8 +13,10 @@ necessarily the easiest to use, but it provides the most direct, flexible, and
secure access to your Solana accounts.
## Getting Started
To get started using the Solana Command Line (CLI) tools:
- [Install the Solana Tools](install-solana-cli-tools.md)
- [Choose a Cluster](choose-a-cluster.md)
- [Create a Wallet](../wallet-guide/cli.md)
- [Check out our CLI conventions](conventions.md)
- [Install the Solana Tools](install-solana-cli-tools.md)
- [Choose a Cluster](choose-a-cluster.md)
- [Create a Wallet](../wallet-guide/cli.md)
- [Check out our CLI conventions](conventions.md)

View File

@@ -1,8 +1,12 @@
# Connecting to a Cluster
---
title: Connecting to a Cluster
---
See [Solana Clusters](../clusters.md) for general information about the
available clusters.
## Configure the command-line tool
You can check what cluster the Solana command-line tool (CLI) is currently targeting by
running the following command:
@@ -10,11 +14,12 @@ running the following command:
solana config get
```
Use `solana config set` command to target a particular cluster. After setting
Use `solana config set` command to target a particular cluster. After setting
a cluster target, any future subcommands will send/receive information from that
cluster.
For example to target the Devnet cluster, run:
```bash
solana config set --url https://devnet.solana.com
```

View File

@@ -1,4 +1,6 @@
# Using Solana CLI
---
title: Using Solana CLI
---
Before running any Solana CLI commands, let's go over some conventions that
you will see across all commands. First, the Solana CLI is actually a collection
@@ -19,7 +21,7 @@ where you replace the text `<COMMAND>` with the name of the command you want
to learn more about.
The command's usage message will typically contain words such as `<AMOUNT>`,
`<ACCOUNT_ADDRESS>` or `<KEYPAIR>`. Each word is a placeholder for the *type* of
`<ACCOUNT_ADDRESS>` or `<KEYPAIR>`. Each word is a placeholder for the _type_ of
text you can execute the command with. For example, you can replace `<AMOUNT>`
with a number such as `42` or `100.42`. You can replace `<ACCOUNT_ADDRESS>` with
the base58 encoding of your public key, such as
@@ -27,12 +29,13 @@ the base58 encoding of your public key, such as
## Keypair conventions
Many commands using the CLI tools require a value for a `<KEYPAIR>`. The value
Many commands using the CLI tools require a value for a `<KEYPAIR>`. The value
you should use for the keypair depend on what type of
[command line wallet you created](../wallet-guide/cli.md).
For example, the way to display any wallet's address
(also known as the keypair's pubkey), the CLI help document shows:
```bash
solana-keygen pubkey <KEYPAIR>
```
@@ -49,9 +52,11 @@ enter the word `ASK` and the program will prompt you to enter your seed words
when you run the command.
To display the wallet address of a Paper Wallet:
```bash
solana-keygen pubkey ASK
```
#### File System Wallet
With a file system wallet, the keypair is stored in a file on your computer.
@@ -59,6 +64,7 @@ Replace `<KEYPAIR>` with the complete file path to the keypair file.
For example, if the file system keypair file location is
`/home/solana/my_wallet.json`, to display the address, do:
```bash
solana-keygen pubkey /home/solana/my_wallet.json
```
@@ -68,6 +74,7 @@ solana-keygen pubkey /home/solana/my_wallet.json
If you chose a hardware wallet, use your
[keypair URL](../hardware-wallets/README.md#specify-a-hardware-wallet-key),
such as `usb://ledger?key=0`.
```bash
solana-keygen pubkey usb://ledger?key=0
```
```

View File

@@ -1,8 +1,14 @@
# Delegate Stake
This page describes the workflow and commands needed to create and manage stake
accounts, and to delegate your stake accounts to a validator using the Solana
command-line tools. The [stake accounts](../staking/stake-accounts.md)
document provides an overview of stake account features and concepts.
---
title: Delegate Stake
---
After you have [received SOL](transfer-tokens.md), you might consider putting
it to use by delegating _stake_ to a validator. Stake is what we call tokens
in a _stake account_. Solana weights validator votes by the amount of stake
delegated to them, which gives those validators more influence in determining
then next valid block of transactions in the blockchain. Solana then generates
new SOL periodically to reward stakers and validators. You earn more rewards
the more stake you delegate.
## Create a Stake Account
To delegate stake, you will need to transfer some tokens into a stake account.
@@ -87,8 +93,7 @@ solana create-stake-account --from <KEYPAIR> <STAKE_ACCOUNT_KEYPAIR> --seed <STR
number corresponding to which derived account this is. The first account might
be "0", then "1", and so on. The public key of `<STAKE_ACCOUNT_KEYPAIR>` acts
as the base address. The command derives a new address from the base address
and seed string. To see what stake address the command will derive, use `solana
create-address-with-seed`:
and seed string. To see what stake address the command will derive, use `solana create-address-with-seed`:
```bash
solana create-address-with-seed --from <PUBKEY> <SEED_STRING> STAKE
@@ -190,6 +195,6 @@ keypair for the new account, and `<AMOUNT>` is the number of tokens to transfer
to the new account.
To split a stake account into a derived account address, use the `--seed`
option. See
option. See
[Derive Stake Account Addresses](#advanced-derive-stake-account-addresses)
for details.

View File

@@ -1,28 +1,31 @@
# Install the Solana Tool Suite
---
title: Install the Solana Tool Suite
---
There are multiple ways to install the Solana tools on your computer
depending on your preferred workflow:
- [Use Solana's Install Tool (Simplest option)](#use-solanas-install-tool)
- [Download Prebuilt Binaries](#download-prebuilt-binaries)
- [Build from Source](#build-from-source)
- [Use Solana's Install Tool (Simplest option)](#use-solanas-install-tool)
- [Download Prebuilt Binaries](#download-prebuilt-binaries)
- [Build from Source](#build-from-source)
## Use Solana's Install Tool
### MacOS & Linux
- Open your favorite Terminal application
- Open your favorite Terminal application
- Install the Solana release
[LATEST_SOLANA_RELEASE_VERSION](https://github.com/solana-labs/solana/releases/tag/LATEST_SOLANA_RELEASE_VERSION) on your
machine by running:
- Install the Solana release
[LATEST_SOLANA_RELEASE_VERSION](https://github.com/solana-labs/solana/releases/tag/LATEST_SOLANA_RELEASE_VERSION) on your
machine by running:
```bash
curl -sSf https://raw.githubusercontent.com/solana-labs/solana/LATEST_SOLANA_RELEASE_VERSION/install/solana-install-init.sh | sh -s - LATEST_SOLANA_RELEASE_VERSION
```
- If you are connecting to a different testnet, you can replace `LATEST_SOLANA_RELEASE_VERSION` with the
release tag matching the software version of your desired testnet, or replace it
with the named channel `stable`, `beta`, or `edge`.
- If you are connecting to a different testnet, you can replace `LATEST_SOLANA_RELEASE_VERSION` with the
release tag matching the software version of your desired testnet, or replace it
with the named channel `stable`, `beta`, or `edge`.
- The following output indicates a successful update:
@@ -36,59 +39,64 @@ Active release directory: /home/solana/.local/share/solana/install/active_releas
Update successful
```
- Depending on your system, the end of the installer messaging may prompt you
to
```bash
- Depending on your system, the end of the installer messaging may prompt you
to
```bash
Please update your PATH environment variable to include the solana programs:
```
- If you get the above message, copy and paste the recommended command below
it to update `PATH`
- Confirm you have the desired version of `solana` installed by running:
```bash
solana --version
- If you get the above message, copy and paste the recommended command below
it to update `PATH`
- Confirm you have the desired version of `solana` installed by running:
```bash
solana --version
```
- After a successful install, `solana-install update` may be used to easily
update the Solana software to a newer version at any time.
- After a successful install, `solana-install update` may be used to easily
update the Solana software to a newer version at any time.
***
---
###Windows
- Open a Command Prompt (`cmd.exe`) as an Administrator
- Search for Command Prompt in the Windows search bar. When the Command
Prompt app appears, right-click and select “Open as Administrator”.
If you are prompted by a pop-up window asking “Do you want to allow this app to
make changes to your device?”, click Yes.
- Open a Command Prompt (`cmd.exe`) as an Administrator
- Copy and paste the following command, then press Enter to download the Solana
installer into a temporary directory:
- Search for Command Prompt in the Windows search bar. When the Command
Prompt app appears, right-click and select “Open as Administrator”.
If you are prompted by a pop-up window asking “Do you want to allow this app to
make changes to your device?”, click Yes.
- Copy and paste the following command, then press Enter to download the Solana
installer into a temporary directory:
```bash
curl http://release.solana.com/LATEST_SOLANA_RELEASE_VERSION/solana-install-init-x86_64-pc-windows-gnu.exe --output C:\solana-install-tmp\solana-install-init.exe --create-dirs
```
- Copy and paste the following command, then press Enter to install the latest
version of Solana. If you see a security pop-up by your system, please select
to allow the program to run.
- Copy and paste the following command, then press Enter to install the latest
version of Solana. If you see a security pop-up by your system, please select
to allow the program to run.
```bash
C:\solana-install-tmp\solana-install-init.exe LATEST_SOLANA_RELEASE_VERSION
```
- When the installer is finished, press Enter.
- When the installer is finished, press Enter.
- Close the command prompt window and re-open a new command prompt window as a
normal user
- Search for "Command Prompt" in the search bar, then left click on the
Command Prompt app icon, no need to run as Administrator)
- Confirm you have the desired version of `solana` installed by entering:
```bash
solana --version
- Close the command prompt window and re-open a new command prompt window as a
normal user
- Search for "Command Prompt" in the search bar, then left click on the
Command Prompt app icon, no need to run as Administrator)
- Confirm you have the desired version of `solana` installed by entering:
```bash
solana --version
```
- After a successful install, `solana-install update` may be used to easily
update the Solana software to a newer version at any time.
- After a successful install, `solana-install update` may be used to easily
update the Solana software to a newer version at any time.
## Download Prebuilt Binaries
@@ -99,7 +107,7 @@ manually download and install the binaries.
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
download **solana-release-x86_64-unknown-linux-gnu.tar.bz2**, then extract the
archive:
```bash
@@ -112,7 +120,7 @@ export PATH=$PWD/bin:$PATH
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
download **solana-release-x86_64-apple-darwin.tar.bz2**, then extract the
archive:
```bash
@@ -124,12 +132,12 @@ export PATH=$PWD/bin:$PATH
### Windows
- 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-pc-windows-gnu.tar.bz2**, then extract the
archive using WinZip or similar.
[https://github.com/solana-labs/solana/releases/latest](https://github.com/solana-labs/solana/releases/latest),
download **solana-release-x86_64-pc-windows-gnu.tar.bz2**, then extract the
archive using WinZip or similar.
- Open a Command Prompt and navigate to the directory into which you extracted
the binaries and run:
the binaries and run:
```bash
cd solana-release/

View File

@@ -1,4 +1,6 @@
# Manage Stake Accounts
---
title: Manage Stake Accounts
---
If you want to delegate stake to many different validators, you will need
to create a separate stake account for each. If you follow the convention

View File

@@ -1,10 +1,13 @@
# Send and Receive Tokens
---
title: Send and Receive Tokens
---
This page decribes how to receive and send SOL tokens using the command line
tools with a command line wallet such as a [paper wallet](../paper-wallet/README.md),
a [file system wallet](../file-system-wallet/README.md), or a
[hardware wallet](../hardware-wallets/README.md). Before you begin, make sure
[hardware wallet](../hardware-wallets/README.md). Before you begin, make sure
you have created a wallet and have access to its address (pubkey) and the
signing keypair. Check out our
signing keypair. Check out our
[conventions for entering keypairs for different wallet types](../cli/conventions.md#keypair-conventions).
## Testing your Wallet
@@ -13,15 +16,15 @@ Before sharing your public key with others, you may want to first ensure the
key is valid and that you indeed hold the corresponding private key.
In this example, we will create a second wallet in addition to your first wallet,
and then transfer some tokens to it. This will confirm that you can send and
and then transfer some tokens to it. This will confirm that you can send and
receive tokens on your wallet type of choice.
This test example uses our Developer Testnet, called devnet. Tokens issued
This test example uses our Developer Testnet, called devnet. Tokens issued
on devnet have **no** value, so don't worry if you lose them.
#### Airdrop some tokens to get started
First, *airdrop* yourself some play tokens on the devnet.
First, _airdrop_ yourself some play tokens on the devnet.
```bash
solana airdrop 10 <RECIPIENT_ACCOUNT_ADDRESS> --url https://devnet.solana.com
@@ -85,6 +88,7 @@ where `<ACCOUNT_ADDRESS>` is either the public key from your keypair or the
recipient's public key.
#### Full example of test transfer
```bash
$ solana-keygen new --outfile my_solana_wallet.json # Creating my first wallet, a file system wallet
Generating a new keypair
@@ -130,7 +134,7 @@ $ solana balance 7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv --url https://devn
To receive tokens, you will need an address for others to send tokens to. In
Solana, the wallet address is the public key of a keypair. There are a variety
of techniques for generating keypairs. The method you choose will depend on how
you choose to store keypairs. Keypairs are stored in wallets. Before receiving
you choose to store keypairs. Keypairs are stored in wallets. Before receiving
tokens, you will need to [create a wallet](../wallet-guide/cli.md).
Once completed, you should have a public key
for each keypair you generated. The public key is a long string of base58