# Run a Glittr Node

This guide is designed for running a Glittr Node locally.

Make sure you have access to Bitcoin RPC, read the following guide on running bitcoin node

{% content-ref url="/pages/GVkqfRbiODArRKiX8m5s" %}
[Run a Bitcoin Node](/node/run-a-bitcoin-node.md)
{% endcontent-ref %}

### Requirements

Install Rust toolchain (<https://doc.rust-lang.org/cargo/getting-started/installation.html>)

### Installation

1. Clone the repository

```bash
git clone https://github.com/Glittrfi/glittr-core-public
cd glittr-core-public
```

Checkout `testnet` if you want to run on testnet4. Use the `main` branch for local development.

2. Build the project

```bash
cargo build --release --features helper-api
```

The compiled binary will be available at `./target/release/glittr`

### Configuration

Create a `settings.yaml` file in your project directory:

```
btc_rpc_url: http://127.0.0.1:18443
btc_rpc_username: user
btc_rpc_password: password
rocks_db_path: db_data
api_url: 127.0.0.1:3001
```

#### Configuration Options

| Option             | Description                              | Default                  |
| ------------------ | ---------------------------------------- | ------------------------ |
| `btc_rpc_url`      | Bitcoin RPC endpoint URL                 | `http://127.0.0.1:48332` |
| `btc_rpc_username` | Bitcoin RPC authentication username      | -                        |
| `btc_rpc_password` | Bitcoin RPC authentication password      | -                        |
| `rocks_db_path`    | Local storage path for the node database | `db_data`                |
| `api_url`          | Glittr node API listening address        | `127.0.0.1:3001`         |

### Running the Node

Start the Glittr node:

```bash
./target/release/glittr
```

If you can see "Indexing block ..." then you have successfully run the Glittr node.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.glittr.fi/node/run-a-glittr-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
