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.

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.

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.

EnvStagingProduction

EVM network

Amoy

Polygon

Default RPC

https://polygon-amoy.infura.io/v3/693b51fa95334eb3bb1849da03cef748
'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'

Default ChainId

80002

137


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

Last updated

©2023 Startbahn, Inc.