# Configuration

Configurations are only stored locally. RPCHub will route your requests based on the configurations.

Users can setup the configurations by either web explorer or posting raw configurations in CLI.

{% hint style="info" %}
You can only get access to the configurations when the RPCHub is running.
{% endhint %}

Before proceeding, we suggest that you check the reference to better understand the parameter settings of RPChub,

[Reference](/user-guide/reference.md)

## Configure With Web Explorer

We provide a user-friendly interface with web explorer.

Go to <https://ag-cfg.rpchub.io/>

Fill with the aggregator management endpoint <mark style="color:blue;"><http://localhost:8012></mark> and password <mark style="color:blue;">123456</mark>

<figure><img src="/files/gldsOkyJCGHsuvpK4zqf" alt=""><figcaption></figcaption></figure>

After login, there is the configuration console. On this page, you can perform the following settings.

<figure><img src="/files/rWH3keP8My22Zz0znQwM" alt=""><figcaption></figcaption></figure>

#### Set your password

It is recommended to set the password as soon as possible. Please note that your password is stored in your **local** profile. If you forget your password, you won't be able to get access to the configurations. To configure, you have to start over from [Installation and run](/user-guide/installation-and-run.md) and configure from default.

#### Add or edit RPC&#x20;

You can either add a new RPC or edit an existing RPC. In the popup tab, chose the chain, input endpoint name, endpoint url and weight.&#x20;

On each RPC card, you can delete the RPC, or switch the "Read Only" and "Disable"

<figure><img src="/files/yolv7CJRTP7vZnVJT6gM" alt=""><figcaption></figcaption></figure>

#### Basic setup

Here you can set the proxy address, request timeout, request max retries.

#### Phishing DB

The phishing database is a feature to prevent users from interacting with suspicious addresses. A user can add any phishing DB url on his own behalf. RPCHub will stop the request if the payload contains any address in the added database.

#### Find the localhost endpoint

To find the localhost endpoint for a specific chain, simply click the chain name and the endpoint will appear below the chains list.

<figure><img src="/files/SntGYDh5ZaZuHw6uCQmM" alt=""><figcaption></figcaption></figure>

## Configure With CLI

CLI provides more flexible configurations, including password reset and adding arbitry chains.

#### Default configuration

To set the configuration of the aggregator, you must know the format of the file first. To show the current configurations after the first run,

```
curl -u rpchub:123456 'http://localhost:8012/config'
```

The response payload should be like,

```
{
    "password": "123456",
    "request_timeout": 30,
    "max_retries": 3,
    "nodes": {
        "<chain1>": [
            {
                "name": "<name1>",
                "endpoint": "<endpoint1>",
                "weight": 100,
                "read_only": false,
                "disabled": false
            },
            {
                "name": "<name2>",
                "endpoint": "<endpoint2>",
                "weight": 100,
                "read_only": false,
                "disabled": false
            },
            ......
        ],
        "<chain2>": [
            ......
        ],
        ......
    },
    "phishing_db": [
        "https://cfg.rpchub.io/agg/scam-addresses.json"
    ],
    "phishing_db_update_interval": 3600,
    "mrt": 1
}
```

#### Set new configuration&#x20;

Parameters are explained in the "Configure With Web Explorer" part. Edit them as your wish.&#x20;

If you want to add or edit an RPC endpoint, just compose following this format,

```
{
    "name":"<endpoint name>",
    "endpoint":"<endpoint url>",
    "weight":<number>,
    "read_only":<true or false>,
    "disabled":<true or false>
}
```

And insert into or replace one in the payload. Then use the following command to post the entire payload back to the configuration,

```
curl -u rpchub:<password> -X POST 'http://localhost:8012/config' 
    --header 'Content-Type: application/json' 
    --data-raw 
    '<payload>' 
```

The new configurations should work after restart RPCHub.

Here is an example to set the configuration to use RPCHub for Arbitrum (2 endpoints) and BSC (1 endpoint),

```
curl -u rpchub:123456 -X POST 'http://localhost:8012/config' --header 'Content-Type: application/json' --data-raw 
{
	"password": "123456",
	"request_timeout": 30,
	"max_retries": 3,
	"nodes": {
		"arbitrum": [{
			"name": "blockpi-public-arbitrum",
			"endpoint": "https://arbitrum.blockpi.network/v1/rpc/public",
			"weight": 90,
			"read_only": false,
			"disabled": false
		}, {
			"name": "arbitrum-official",
			"endpoint": "https://arb1.arbitrum.io/rpc",
			"weight": 10,
			"read_only": false,
			"disabled": false
		}],
		"bsc": [{
			"name": "blockpi-official",
			"endpoint": "https://bsc-dataseed.binance.org",
			"weight": 100,
			"read_only": false,
			"disabled": false
		}]	
	},
	"phishing_db": ["https://cfg.rpchub.io/agg/scam-addresses.json"],
	"phishing_db_update_interval": 3600
}
```

#### Reset configuration

Stop RPCHub.

Delete the configuration directory,

```
rm -rf $HOME/.rpchub/aggregator/
```

Start RPCHub again.&#x20;

Configurations will be reset including the password.


---

# 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.rpchub.io/user-guide/configuration.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.
