Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp and Expand Pathfinder Documentation #2473

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
20 changes: 20 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
83 changes: 83 additions & 0 deletions docs/docs/database-snapshots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
sidebar_position: 4
---

# Database Snapshots

Database snapshots let you quickly start your node without having to download all blocks from the very beginning. Instead, you use a pre-made version of the database that’s already in sync up to a certain block. This saves you a lot of time, especially if the network has many blocks.

There are two main ways to download and use a snapshot with Pathfinder:

* [Using Rclone](#using-rclone-for-snapshots)
* [Using a direct HTTPS link](#downloading-via-https)

## Using Rclone for Snapshots

[**Rclone**](https://rclone.org/) is a command-line program to manage files on cloud storage. It is highly recommended for Pathfinder snapshots due to its reliability and support for resumable downloads.

### Rclone Configuration

1. Follow the [official installation guide](https://rclone.org/install/) for your operating system.
2. Open or create your Rclone configuration file (`$HOME/.config/rclone/rclone.conf`) and add:
```ini
[pathfinder-snapshots]
type = s3
provider = Cloudflare
env_auth = false
access_key_id = 7635ce5752c94f802d97a28186e0c96d
secret_access_key = 529f8db483aae4df4e2a781b9db0c8a3a7c75c82ff70787ba2620310791c7821
endpoint = https://cbf011119e7864a873158d83f3304e27.r2.cloudflarestorage.com
acl = private
```
3. Use `rclone` to copy the compressed SQLite file to your local directory:
```bash
rclone copy -P pathfinder-snapshots:pathfinder-snapshots/sepolia-testnet_0.14.0_209745_pruned.sqlite.zst .
```

:::tip
Add `-P` to get a progress display that helps you track the download status.
:::

## Downloading via HTTPS

While HTTPS URLs are also provided, direct HTTPS downloads can sometimes be less reliable for very large files. If you must use HTTPS, verify you can resume downloads or maintain a stable connection. For example:

```bash
wget --continue https://pub-1fac64c3c0334cda85b45bcc02635c32.r2.dev/mainnet_0.14.0_751397_pruned.sqlite.zst
```

## Extracting Snapshots and Checksums

Snapshots come as zstd-compressed SQLite files. Once the download completes, follow these steps:

1. Compare the file’s checksum against the published value to ensure data integrity:
```bash
sha256sum sepolia-testnet_0.14.0_209745_pruned.sqlite.zst
# Compare with the listed hash in the documentation
```
2. Use `zstd` (version 1.5 or later) to extract:
```bash
zstd -T0 -d sepolia-testnet_0.14.0_209745_pruned.sqlite.zst -o testnet-sepolia.sqlite
```
This produces an uncompressed file, e.g., `testnet-sepolia.sqlite`.

3. If you intend to replace your existing database, **stop** the Pathfinder process, rename or remove your old database, and move the new file into place. For example:
```bash
mv testnet-sepolia.sqlite /path/to/your/pathfinder/data/mainnet.sqlite
```
Ensure your file names and paths match the network you’re running.

## Available Snapshots

The table below lists currently available snapshots, their block heights, and corresponding checksums. Refer to the [official release page](https://github.com/eqlabs/pathfinder/releases) or the snapshot hosting platform for the latest files.

| **Network** | **Block** | **Pathfinder Version** | **Mode** | **Filename** | **Download URL** | **Size** | **Checksum (SHA2-256)** |
| --------------- | --------- | ---------------------- | -------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------ |
| Mainnet | 751397 | >= 0.14.0 | pruned | `mainnet_0.14.0_751397_pruned.sqlite.zst` | [Download](https://pub-1fac64c3c0334cda85b45bcc02635c32.r2.dev/mainnet_0.14.0_751397_pruned.sqlite.zst) | 71.03 GB | `2f9aa8b98086c12a1ce14e89ddfe02ebf320a7ba47e63829056a405866568113` |
| Mainnet | 751250 | >= 0.14.0 | archive | `mainnet_0.14.0_751250_archive.sqlite.zst` | [Download](https://pub-1fac64c3c0334cda85b45bcc02635c32.r2.dev/mainnet_0.14.0_751250_archive.sqlite.zst) | 433.13 GB | `3540087b326b58437fd12bcf427eaeb6323f3efc3def56816b7e5fc06d2633ae` |
| Sepolia testnet | 209745 | >= 0.14.0 | pruned | `sepolia-testnet_0.14.0_209745_pruned.sqlite.zst` | [Download](https://pub-1fac64c3c0334cda85b45bcc02635c32.r2.dev/sepolia-testnet_0.14.0_209745_pruned.sqlite.zst) | 5.71 GB | `5cc9a13079a36ee09c04824f6b30b5ce16cd2d26039b23c7c7937f57a76ba19b` |
| Sepolia testnet | 209758 | >= 0.14.0 | archive | `sepolia-testnet_0.14.0_209758_archive.sqlite.zst` | [Download](https://pub-1fac64c3c0334cda85b45bcc02635c32.r2.dev/sepolia-testnet_0.14.0_209758_archive.sqlite.zst) | 18.93 GB | `3c24a6e9e5294d738f5976e2c949ebac42ed3fc4865a21893df44897fe803686` |

:::info
**Pruned** mode retains limited historical state tries, reducing storage size but limiting storage-proof queries. **Archive** mode is fully historic, storing all state tries since genesis.
:::
28 changes: 28 additions & 0 deletions docs/docs/deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
sidebar_position: 6
sidebar_class_name: hidden
---

# Deployment

Pathfinder can be deployed on various cloud platforms to ensure scalability and availability. Below are brief instructions for deploying Pathfinder on popular cloud platforms.

### Google Cloud Platform (GCP) Setup

1. **Create a Virtual Machine**: Create a VM instance on GCP with the recommended hardware specifications for running Pathfinder.

2. **Install Docker**: SSH into your VM and install Docker as per the [Docker installation guide](https://docs.docker.com/get-docker/).

3. **Run Pathfinder**: Use the earlier Docker commands to run Pathfinder on your GCP instance.


### Amazon Web Services (AWS) Setup

1. **Launch an EC2 Instance**: Create an EC2 instance using the recommended hardware specifications.

2. **Install Docker**: Connect to your EC2 instance and install Docker.

3. **Run Pathfinder**: Run Pathfinder using Docker or Docker Compose, as explained in the earlier sections.


These cloud deployment setups help ensure that Pathfinder is accessible and can scale based on the network's needs.
104 changes: 104 additions & 0 deletions docs/docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
sidebar_position: 7
slug: /faq
---

# Frequently Asked Questions

This section addresses common issues and questions that might arise while running or developing with Pathfinder. If you don’t find your answer here, consider searching the [GitHub issues](https://github.com/eqlabs/pathfinder/issues) or asking in the [Starknet Discord channel](https://discord.com/invite/QypNMzkHbc).

<details>
<summary><strong>What is Pathfinder?</strong></summary>

Pathfinder is a full node implementation designed to interact with the Starknet blockchain, providing a secure and reliable view of the network.
</details>

<details>
<summary><strong>How can I run Pathfinder?</strong></summary>

You can run Pathfinder using Docker or by building it from source. Detailed instructions for both methods are provided in the [installation section](getting-started/running-pathfinder#installation-methods).
</details>

<details>
<summary><strong>What are the hardware requirements for running Pathfinder?</strong></summary>

The recommended hardware includes 4 CPU cores, 8 GiB RAM, and 250 GiB SSD storage for optimal performance. These requirements are applicable for running Pathfinder on both mainnet and testnet.
</details>

<details>
<summary><strong>How can I configure my Pathfinder node?</strong></summary>

Pathfinder can be configured using environment variables or command-line options, such as specifying the network, logging level, and Ethereum API URL. You can find more details in the [configuration section](getting-started/configuration).
</details>

<details>
<summary><strong>How can I update my Pathfinder node?</strong></summary>

Check out the [Updating Pathfinder](getting-started/updating-pathfinder) guide for detailed instructions on updating your Pathfinder node to the latest version.
</details>

<details>
<summary><strong>How can I interact with my Pathfinder node?</strong></summary>

You can interact with Pathfinder using the [JSON-RPC API](interacting-with-pathfinder/json-rpc-api) or the [WebSocket API](interacting-with-pathfinder/websocket-api) for real-time updates. These APIs allow you to query the blockchain, submit transactions, and subscribe to events.
</details>

<details>
<summary><strong>Can I switch from archive mode to pruned mode (or vice versa) without re-syncing?</strong></summary>

Currently, you cannot switch directly between archive and pruned modes mid-run. You may, however, change the k value in pruned mode between runs. If you need to go from archive to pruned, consider downloading a pruned Database Snapshot or re-sync with the `--storage.state-tries=<k>` option.
</details>

<details>
<summary><strong>How can I monitor my Pathfinder node?</strong></summary>

Use the monitoring API endpoints (`/health`, `/ready`, `/ready/synced`) and integrate Prometheus metrics to monitor the node's health and performance. For more details, refer to the [Monitoring API section](monitoring-and-metrics).
</details>

<details>
<summary><strong>Do node operators receive any rewards, or is participation solely to support the network?</strong></summary>

Currently, running a Pathfinder node is a voluntary effort to support the Starknet network, and there are no direct rewards for node operators.
</details>

<details>
<summary><strong>How can I view Pathfinder logs from Docker?</strong></summary>

You can view the logs of your Pathfinder Docker container using the command: `docker logs -f pathfinder`.
</details>

<details>
<summary><strong>How can I get real-time updates of new blocks?</strong></summary>

Use the WebSocket API to subscribe to the `newHeads` event, which provides real-time notifications for new blocks added to the blockchain.
</details>

<details>
<summary><strong>Does Pathfinder provide snapshots to sync with Starknet quickly?</strong></summary>

Yes, Pathfinder provides database snapshots that can be downloaded and used to speed up the syncing process. Refer to the [snapshots section](database-snapshots) for more details.
</details>

<details>
<summary><strong>How can I contribute to Pathfinder?</strong></summary>

You can contribute by opening issues, submitting pull requests, or joining the Starknet community on Discord to provide feedback and collaborate with other developers. For more details, refer to the [contribution guidelines](https://github.com/eqlabs/pathfinder/blob/main/contributing.md).
</details>

<details>
<summary><strong>Can I use Pathfinder with a custom Starknet network?</strong></summary>

Yes, you can configure Pathfinder to connect to a custom network by specifying the `--network custom` command line option and providing the appropriate gateway URLs. For more details, refer to the [custom network section](getting-started/configuration#custom-networks-and-gateway-proxies).
</details>

<details>
<summary><strong>How do I monitor my Pathfinder node?</strong></summary>

Use the monitoring API endpoints (`/health`, `/ready`, `/ready/synced`) and integrate Prometheus metrics for detailed monitoring. For more information, refer to the [Monitoring API section](monitoring-and-metrics).
</details>

<details>
<summary><strong>What should I do if my node is not syncing?</strong></summary>

Ensure your Ethereum endpoint is accessible and has archive capabilities, and verify that your hardware meets the performance requirements.
</details>
4 changes: 4 additions & 0 deletions docs/docs/getting-started/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Getting Started",
"position": 2
}
Loading
Loading