> For the complete documentation index, see [llms.txt](https://docs.startrail.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.startrail.io/startrail-sdk-js/getting-started/rpc-endpoint.md).

# RPC endpoint and chainId

While the default RPC endpoint and chainId are automatically configured in the StartrailSdk based on the environment you select, you can also overwrite them by specifying the values at the time of StartrailSdk instantiation. This is particularly useful in irregular cases that require immediate action or action without a StartrailSdk update, such as when

* a particular RPC endpoint experiences downtime
* the chainId is changed due to network deprecation

As the production environment is connected to the Polygon network while the staging environment is connected to the Amoy network, it's essential to provide the same rpcEndpoint as the network to which the StartrailSdk is connected.

{% hint style="warning" %}
It's important to note that Startrail smart contracts reside in the Polygon and Amoy blockchains, and changing the chainId to other networks is not supported.
{% endhint %}

### RPC endpoint

One of the following RPC endpoints is selected after a live status check from StartrailSdk, following the order from the top under the hood.

<table><thead><tr><th width="147.33333333333331">Env</th><th>Staging</th><th>Production</th></tr></thead><tbody><tr><td><strong>EVM network</strong></td><td><strong>Amoy</strong></td><td><strong>Polygon</strong></td></tr><tr><td><strong>Default RPC</strong></td><td><pre class="language-typescript"><code class="lang-typescript">https://polygon-amoy.infura.io/v3/693b51fa95334eb3bb1849da03cef748
</code></pre></td><td><pre><code>'https://polygon-rpc.com',
'https://rpc-mainnet.matic.network',
'https://matic-mainnet.chainstacklabs.com',
'https://rpc-mainnet.maticvigil.com',
'https://rpc-mainnet.matic.quiknode.pro',
'https://matic-mainnet-full-rpc.bwarelabs.com'
</code></pre></td></tr><tr><td>Default ChainId</td><td>80002</td><td>137</td></tr></tbody></table>

```javascript

sdk = new Startrail({
	...
  // example
  rpcEndpoint: 'https://YOUR_RPC_ENDPOINT',
  chainId: 123 // Select the chainId you want to overwrite.
})
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.startrail.io/startrail-sdk-js/getting-started/rpc-endpoint.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
