Skip to content

Commit

Permalink
fix(docs): Typos and style fixes in snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGackstatter committed Aug 14, 2024
1 parent 8ee9eaf commit fa6a9f5
Showing 1 changed file with 31 additions and 28 deletions.
59 changes: 31 additions & 28 deletions docs/content/operator/snapshots.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,31 @@ Full nodes do not take snapshots by default. To enable this feature you must app
Follow these steps to change the configs for a Full node:

1. Stop your node, if it's running.
2. Open your fullnode.yaml config file and apply config updates as the following sections show.
3. Save the fullnode.yaml file and restart the node.
2. Open your `fullnode.yaml` config file and apply config updates as the following sections show.
3. Save the `fullnode.yaml` file and restart the node.

### Enabling DB snapshots

Add an entry to the config file for `db-checkpoint-config`. Using Amazon's S3 service as an example:
```yaml
db-checkpoint-config:
perform-db-checkpoints-at-epoch-end: true
perform-index-db-checkpoints-at-epoch-end: true
object-store-config:
object-store: "S3"
bucket: "<BUCKET-NAME>"
aws-access-key-id: “<ACCESS-KEY>”
aws-secret-access-key: “<SHARED-KEY>”
aws-region: "<BUCKET-REGION>"
object-store-connection-limit: 20
```
- `object-store`: The remote object store to upload snapshots. Set as Amazon's `S3` service in the example.
- `bucket`: The S3 bucket name to store the snapshots.
- `aws-access-key-id` and `aws-secret-access-key`: AWS authentication information with write access to the bucket.
- `aws-region`: Region where bucket exists.
- `object-store-connection-limit`: Number of simultaneous connections to the object store.

```yaml
db-checkpoint-config:
perform-db-checkpoints-at-epoch-end: true
perform-index-db-checkpoints-at-epoch-end: true
object-store-config:
object-store: "S3"
bucket: "<BUCKET-NAME>"
aws-access-key-id: "<ACCESS-KEY>"
aws-secret-access-key: "<SHARED-KEY>"
aws-region: "<BUCKET-REGION>"
object-store-connection-limit: 20
```
- `object-store`: The remote object store to upload snapshots. Set as Amazon's `S3` service in the example.
- `bucket`: The S3 bucket name to store the snapshots.
- `aws-access-key-id` and `aws-secret-access-key`: AWS authentication information with write access to the bucket.
- `aws-region`: Region where bucket exists.
- `object-store-connection-limit`: Number of simultaneous connections to the object store.

### Enabling Formal snapshots

Expand All @@ -74,8 +76,8 @@ Add an entry to the config file for `db-checkpoint-config`. Using Amazon's S3 se
object-store-config:
object-store: "S3"
bucket: "<BUCKET-NAME>"
aws-access-key-id: <ACCESS-KEY>
aws-secret-access-key: <SHARED-KEY>
aws-access-key-id: "<ACCESS-KEY>"
aws-secret-access-key: "<SHARED-KEY>"
aws-region: "<BUCKET-REGION>"
object-store-connection-limit: 200
```
Expand All @@ -88,34 +90,35 @@ Add an entry to the config file for `db-checkpoint-config`. Using Amazon's S3 se
To restore from a RocksDB snapshot, follow these steps:

1. Download the snapshot for the epoch you want to restore to your local disk. There is one snapshot per epoch in s3 bucket.
1. Place the snapshot into the directory that the `db-config` value points to in your fullnode.yaml file. For example, if the `db-config` value points to `/opt/iota/db/authorities_db/full_node_db` and you want to restore from epoch 10, then copy the snapshot to the directory with this command:
1. Place the snapshot into the directory that the `db-config` value points to in your `fullnode.yaml` file. For example, if the `db-config` value points to `/opt/iota/db/authorities_db/full_node_db` and you want to restore from epoch 10, then copy the snapshot to the directory with this command:

You can use the aws cli (provided you have credentials to associate with the download):
`aws s3 cp s3://<BUCKET_NAME>/epoch_10 /opt/iota/db/authorities_db/full_node_db/live --recursive`.

An alternative is to use `iota-tool` to copy the files:
```
```shell
iota-tool download-db-snapshot --epoch "<EPOCH-NUMBER>" \
--network <NETWORK> --snapshot-bucket <BUCKET-NAME> \
--snapshot-bucket-type <TYPE> --path <PATH-TO-NODE-DB> \
--num-parallel-downloads 25 \
--skip-indexes \
--no-sign-request
```
- `--epoch`: The epoch that you want to download, for example `200`. the IOTA Foundation hosted buckets will only keep the last 90 epochs.
- `--epoch`: The epoch that you want to download, for example `200`. The buckets hosted by the IOTA Foundation will only keep the last 90 epochs.
- `--network`: Network to download snapshot for. Defaults to "mainnet".
- `--path`: Path to snapshot directory on local filesystem.
- `--no-sign-request`: If set, `--snapshot-bucket` and `--snapshot-bucket-type` are ignored, and Cloudflare R2 is used.
- `--snapshot-bucket`: Source snapshot bucket name, eg `iota-mainnet-snapshots`.
- `--snapshot-bucket-type`: Snapshot bucket type. GCS and S3 currently supported.
- `--skip-indexes`: Skips downloading the very large `indexes/` dir, used by jsonrpc on the fullnode
- `--skip-indexes`: Skips downloading the very large `indexes/` dir, used by jsonrpc on the fullnode.

The following environment variables are used if `--no-sign-request` is not set:
* *AWS*: `AWS_SNAPSHOT_ACCESS_KEY_ID`, `AWS_SNAPSHOT_SECRET_ACCESS_KEY`, `AWS_SNAPSHOT_REGION`
* *GCS*: `GCS_SNAPSHOT_SERVICE_ACCOUNT_FILE_PATH`
* *AZURE*: `AZURE_SNAPSHOT_STORAGE_ACCOUNT`, `AZURE_SNAPSHOT_STORAGE_ACCESS_KEY`

1. Make sure you update the ownership of the downloaded directory to the iota user (whichever linux user you run `iota-node` as)
1. Make sure you update the ownership of the downloaded directory to the `iota` user (or whichever linux user you run `iota-node` as):

`sudo chown -R iota:iota /opt/iota/db/authorities_db/full_node_db/live`.
1. Start the IOTA node.

Expand All @@ -134,12 +137,12 @@ The following steps can be used to restore a node from a Formal snapshot:

1. If it's running, stop the node.
2. Run the command:
```
```shell
iota-tool download-formal-snapshot --epoch "<EPOCH-NUMBER>" --genesis "<PATH-TO-GENESIS-BLOB>" \
--network <NETWORK> --snapshot-bucket <BUCKET-NAME> --snapshot-bucket-type <TYPE> \
--path <PATH-TO-NODE-DB> --num-parallel-downloads 50 --no-sign-request
```
- `--epoch`: The epoch that you want to download, for example `200`. the IOTA Foundation hosted buckets will only keep the last 90 epochs.
- `--epoch`: The epoch that you want to download, for example `200`. The buckets hosted by the IOTA Foundation will only keep the last 90 epochs.
- `--genesis`: The path to the location of the network's `genesis.blob`.
- `--network`: Network to download snapshot for. Defaults to "mainnet".
- `--path`: Path to snapshot directory on local filesystem.
Expand Down

0 comments on commit fa6a9f5

Please sign in to comment.