2019-10-21 11:29:37 -06:00
# Running an Archiver
2019-09-23 03:38:34 +00:00
2019-10-21 11:29:37 -06:00
This document describes how to setup an archiver in the testnet
2019-06-21 16:32:23 -07:00
2019-09-23 03:38:34 +00:00
Please note some of the information and instructions described here may change in future releases.
## Overview
2019-10-21 11:29:37 -06:00
Archivers are specialized light clients. They download a part of the ledger \(a.k.a Segment\) and store it. They earn rewards for storing segments.
2019-06-21 16:32:23 -07:00
2020-02-19 14:04:34 -07:00
The testnet features a validator running at devnet.solana.com, which serves as the entrypoint to the cluster for your archiver node.
2019-06-21 16:32:23 -07:00
2020-02-19 14:04:34 -07:00
Additionally there is a blockexplorer available at [http://devnet.solana.com/ ](http://devnet.solana.com/ ).
2019-06-21 16:32:23 -07:00
2019-09-23 03:38:34 +00:00
The testnet is configured to reset the ledger daily, or sooner should the hourly automated cluster sanity test fail.
2019-06-21 16:32:23 -07:00
2019-09-23 03:38:34 +00:00
## Machine Requirements
2019-06-21 16:32:23 -07:00
2019-10-21 11:29:37 -06:00
Archivers don't need specialized hardware. Anything with more than 128GB of disk space will be able to participate in the cluster as an archiver node.
2019-06-21 16:32:23 -07:00
2019-09-23 03:38:34 +00:00
Currently the disk space requirements are very low but we expect them to change in the future.
2019-06-21 16:32:23 -07:00
2019-09-23 03:38:34 +00:00
Prebuilt binaries are available for Linux x86\_64 \(Ubuntu 18.04 recommended\), macOS, and Windows.
2019-06-21 16:32:23 -07:00
2019-09-23 03:38:34 +00:00
### Confirm The Testnet Is Reachable
2019-10-21 11:29:37 -06:00
Before starting an archiver node, sanity check that the cluster is accessible to your machine by running some simple commands. If any of the commands fail, please retry 5-10 minutes later to confirm the testnet is not just restarting itself before debugging further.
2019-06-21 16:32:23 -07:00
Fetch the current transaction count over JSON RPC:
2019-09-23 03:38:34 +00:00
2019-06-21 16:32:23 -07:00
```bash
2020-02-19 14:04:34 -07:00
curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1, "method":"getTransactionCount"}' http://devnet.solana.com:8899
2019-06-21 16:32:23 -07:00
```
2020-02-19 14:04:34 -07:00
Inspect the blockexplorer at [http://devnet.solana.com/ ](http://devnet.solana.com/ ) for activity.
2019-06-21 16:32:23 -07:00
2019-09-23 03:38:34 +00:00
View the [metrics dashboard ](https://metrics.solana.com:3000/d/testnet-beta/testnet-monitor-beta?var-testnet=testnet ) for more detail on cluster activity.
2019-06-21 16:32:23 -07:00
2019-10-21 11:29:37 -06:00
## Archiver Setup
2019-06-21 16:32:23 -07:00
2019-09-23 03:38:34 +00:00
#### Obtaining The Software
#### Bootstrap with `solana-install`
The `solana-install` tool can be used to easily install and upgrade the cluster software.
#### Linux and mac OS
2019-06-21 16:32:23 -07:00
```bash
2019-10-29 17:13:20 -06:00
curl -sSf https://raw.githubusercontent.com/solana-labs/solana/v0.18.0/install/solana-install-init.sh | sh -s
2019-06-21 16:32:23 -07:00
```
2019-09-23 03:38:34 +00:00
Alternatively build the `solana-install` program from source and run the following command to obtain the same result:
2019-06-21 16:32:23 -07:00
```bash
2019-10-29 17:13:20 -06:00
solana-install init
2019-06-21 16:32:23 -07:00
```
2019-09-23 03:38:34 +00:00
#### Windows
Download and install **solana-install-init** from [https://github.com/solana-labs/solana/releases/latest ](https://github.com/solana-labs/solana/releases/latest )
2019-06-21 16:32:23 -07:00
2019-09-23 03:38:34 +00:00
After a successful install, `solana-install update` may be used to easily update the software to a newer version at any time.
#### Download Prebuilt Binaries
2019-06-21 16:32:23 -07:00
If you would rather not use `solana-install` to manage the install, you can manually download and install the binaries.
2019-09-23 03:38:34 +00:00
#### Linux
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-06-21 16:32:23 -07:00
```bash
2019-10-29 17:13:20 -06:00
tar jxf solana-release-x86_64-unknown-linux-gnu.tar.bz2
cd solana-release/
export PATH=$PWD/bin:$PATH
2019-06-21 16:32:23 -07:00
```
2019-09-23 03:38:34 +00:00
#### mac OS
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-06-21 16:32:23 -07:00
```bash
2019-10-29 17:13:20 -06:00
tar jxf solana-release-x86_64-apple-darwin.tar.bz2
cd solana-release/
export PATH=$PWD/bin:$PATH
2019-06-21 16:32:23 -07:00
```
2019-09-23 03:38:34 +00:00
#### 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-msvc.tar.bz2** , then extract it into a folder. It is a good idea to add this extracted folder to your windows PATH.
2019-10-21 11:29:37 -06:00
## Starting The Archiver
2019-09-23 03:38:34 +00:00
2019-06-21 16:32:23 -07:00
Try running following command to join the gossip network and view all the other nodes in the cluster:
2019-09-23 03:38:34 +00:00
2019-06-21 16:32:23 -07:00
```bash
2020-02-19 14:04:34 -07:00
solana-gossip spy --entrypoint devnet.solana.com:8001
2019-06-21 16:32:23 -07:00
# Press ^C to exit
```
2019-10-21 11:29:37 -06:00
Now configure the keypairs for your archiver by running:
2019-06-21 16:32:23 -07:00
Navigate to the solana install location and open a cmd prompt
2019-09-23 03:38:34 +00:00
2019-06-21 16:32:23 -07:00
```bash
2019-10-29 17:13:20 -06:00
solana-keygen new -o archiver-keypair.json
solana-keygen new -o storage-keypair.json
2019-06-21 16:32:23 -07:00
```
2019-09-23 03:38:34 +00:00
Use solana-keygen to show the public keys for each of the keypairs, they will be needed in the next step:
2019-09-22 04:31:10 +00:00
2019-09-23 03:38:34 +00:00
* Windows
```bash
2019-10-21 11:29:37 -06:00
# The archiver's identity
2019-10-29 17:13:20 -06:00
solana-keygen pubkey archiver-keypair.json
solana-keygen pubkey storage-keypair.json
2019-09-23 03:38:34 +00:00
```
* Linux and mac OS
\`\`\`bash
2019-10-29 17:13:20 -06:00
export ARCHIVER\_IDENTITY=$\(solana-keygen pubkey archiver-keypair.json\)
2019-09-23 03:38:34 +00:00
2019-10-29 17:13:20 -06:00
export STORAGE\_IDENTITY=$\(solana-keygen pubkey storage-keypair.json\)
2019-09-23 03:38:34 +00:00
```text
2019-10-21 11:29:37 -06:00
Then set up the storage accounts for your archiver by running:
2019-06-21 16:32:23 -07:00
```bash
2020-02-15 12:53:52 -07:00
solana --keypair archiver-keypair.json airdrop .0001
2019-10-29 17:13:20 -06:00
solana --keypair archiver-keypair.json create-archiver-storage-account $ARCHIVER_IDENTITY $STORAGE_IDENTITY
2019-06-21 16:32:23 -07:00
```
2019-09-23 03:38:34 +00:00
2019-10-21 11:29:37 -06:00
Note: Every time the testnet restarts, run the steps to setup the archiver accounts again.
2019-06-21 16:32:23 -07:00
2019-10-21 11:29:37 -06:00
To start the archiver:
2019-09-23 03:38:34 +00:00
2019-06-21 16:32:23 -07:00
```bash
2020-02-19 14:04:34 -07:00
solana-archiver --entrypoint devnet.solana.com:8001 --identity-keypair archiver-keypair.json --storage-keypair storage-keypair.json --ledger archiver-ledger
2019-06-21 16:32:23 -07:00
```
2019-10-21 11:29:37 -06:00
## Verify Archiver Setup
2019-09-23 03:38:34 +00:00
2019-10-21 11:29:37 -06:00
From another console, confirm the IP address and **identity pubkey** of your archiver is visible in the gossip network by running:
2019-09-23 03:38:34 +00:00
2019-06-21 16:32:23 -07:00
```bash
2020-02-19 14:04:34 -07:00
solana-gossip spy --entrypoint devnet.solana.com:8001
2019-06-21 16:32:23 -07:00
```
2020-01-20 23:06:47 -07:00
Provide the **storage account pubkey** to the `solana storage-account` command to view the recent mining activity from your archiver:
2019-09-23 03:38:34 +00:00
2019-06-21 16:32:23 -07:00
```bash
2020-01-20 23:06:47 -07:00
solana --keypair storage-keypair.json storage-account $STORAGE_IDENTITY
2019-06-21 16:32:23 -07:00
```