# Heco archive node for public use

With the official support of heco, HyperGraph has set up two public archive nodes for public  use. These node supports RPC and WS mode, but since they are public and free resources, please do not overuse them or use them for long-term and large-scale data services.

The specific configuration and test methods are as follows:

Node 1：

http Mode：

URL：

[`https://pub001.hg.network/rpc`](https://pub001.hg.network/rpc)

WS Mode:

URL:&#x20;

`wss://pub001.hg.network/ws`

The connection configuration in metamask is shown in the figure below：

![](/files/-MevtiA9amYS5WYAkhk6)

RPC can be used to test node No.1 to obtain the chain ID and the latest block number respectively. Examples and results are as follows：

`# curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' -H "Content-Type: application/json" https://pub001.hg.network/rpc`

`{"jsonrpc":"2.0","id":1,"result":"0x80"}`

`# curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' -H "Content-Type: application/json" https://pub001.hg.network/rpc`

`{"jsonrpc":"2.0","id":1,"result":"0x6479e9"}`

&#x20;You can also write the following code to test the connectivity of websocket protocol：：

`var Web3 = require('web3');`

`var web3 = new Web3('wss://pub001.hg.network/ws');`

`subscription = web3.eth.subscribe('pendingTransactions', function (error, result) {})`

&#x20;   `.on("data", function (transactionHash) {`

&#x20;       `web3.eth.getTransaction(transactionHash)`

&#x20;       `.then(function (transaction) {`

&#x20;         `console.log(transaction)`

&#x20;       `});`

`})`

Output:

![](/files/-MevtiAAqEXmZgWiVLn9)

Node 2：

http Mode：

URL：

`https://pub002.hg.network/rpc`

WS Mode:

URL:&#x20;

`wss://pub002.hg.network/ws`

The connection configuration in metamask is shown in the figure below：

![](/files/-MevtiABWYD-yueA2-lI)

RPC can be used to test node No.2 to obtain the chain ID and the latest block number respectively. Examples and results are as follows：

`# curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' -H "Content-Type: application/json" https://pub002.hg.network/rpc`

`{"jsonrpc":"2.0","id":1,"result":"0x80"}`

`# curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' -H "Content-Type: application/json" https://pub002.hg.network/rpc`

`{"jsonrpc":"2.0","id":1,"result":"0x6479ea"}`

&#x20;You can also write the following code to test the connectivity of websocket protocol：

`var Web3 = require('web3');`

`var web3 = new Web3('wss://pub002.hg.network/ws');`

`subscription = web3.eth.subscribe('pendingTransactions', function (error, result) {})`

&#x20;   `.on("data", function (transactionHash) {`

&#x20;       `web3.eth.getTransaction(transactionHash)`

&#x20;       `.then(function (transaction) {`

&#x20;         `console.log(transaction)`

&#x20;       `});`

`})`

Output:

![](/files/-MevtiAC2NQbNoYUJDBo)


---

# 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://en.docs.hg.network/network/heco-archive-node-for-public.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.
