# Full Node

#### Heima RPC nodes <a href="#litmus-rpc-nodes" id="litmus-rpc-nodes"></a>

By default, Heima has a few self-hosted, load-balanced RPC nodes that provide public service. Contrary to collators, the RPC nodes don't produce blocks but only sync the chain states and provide RPC/Websocket services to the users.

You can find the Heima RPC entrypoint [here](https://polkadot.js.org/apps/?rpc=wss://rpc.litentry-parachain.litentry.io#/explorer) on polkadot-js.

With the service, the end-users can query the chain state, inspect the constant and storage, and execute extrinsics.

#### Run your full nodes <a href="#run-your-own-full-nodes" id="run-your-own-full-nodes"></a>

**using docker (preferred)**

1\. Create a local directory to store the chain database:

```
mkdir /var/lib/litentry
# or use sudo if you don't have permission
sudo mkdir /var/lib/litentry
```

2\. Make sure the permission and ownership of the local directory are correctly set:

```
sudo chown -R $(id -u):$(id -g) /var/lib/litentry
```

3\. Run the following Docker command, you can replace the `--name="heima-node"` with your node name:

```
docker run -d --network=host -v /var/lib/litentry:/data \
    -u $(id -u):$(id -g) \
    litentry/litentry-collator:v0.9.22-02  \
    --base-path=/data \
    --name="litentry-collator" \
    --chain=litentry \
    --state-pruning=archive \
    --state-cache-size 0 \
    --ws-external \
    --rpc-external \
    --rpc-cors=all \
    --execution=wasm \
    -- \
    --execution=wasm \
    --chain kusama
```

`litentry/heima-node:v0.9.22-02` is used as an example, please check [github release page](https://github.com/litentry/heima/releases) for the up-to-date releases

The command will run the docker container in the background and the container ID will be printed in the console. With `docker logs -f <container-id>` you should be able to see the node starts to sync.

Wait until syncing is done, depending on the hardware and network status it could take several days to fully sync the parachain and relaychain database.

After it's fully synced, you should be able to access the chain via local ws endpoint in polkadot-js: [https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9944#/explorer](https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer)

**using binary**

Running a full node with the raw binary is very similar to the docker setup above, it only differs a bit in the command line arguments. So instead of steps 1-3 above, run:

Copy

```
./target/release/litentry-collator \
    --name="litentry-collator" \
    --chain=litentry \
    --state-pruning=archive \
    --state-cache-size 0 \
    --ws-external \
    --rpc-external \
    --rpc-cors=all \
    --execution=wasm \
    -- \
    --execution=wasm \
    --chain kusama
```

By default, the database is stored at `~/.local/share/`, you can override it by using `--base-path=<your-path>`.

To get the binary, you could either download it directly from Heima's [Github release page](https://github.com/litentry/heima/releases) (**Linux x86-64** only) or [build](broken://spaces/qZamGXeNdPKNQXKBWxz5) it from the source.


---

# 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.heima.network/full-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.
