Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RPC failover options #2140

Merged
merged 4 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/2.build/4.web3-apps/integrate-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ To create a wallet, simply import the `Wallet` object from the module and initia

Under the hood (check the `near` tab) you can see that we are actually setting up the wallet selector, and asking it if the user logged-in already. During the setup, we pass a hook to the wallet selector, which will be called each time a user logs in or out.

<details markdown="1">
<details markdown="1" id="setting-customs-rpc-endpoints">
bucanero marked this conversation as resolved.
Show resolved Hide resolved

<summary> Setting customs RPC endpoints </summary>

Expand Down
6 changes: 6 additions & 0 deletions docs/5.api/rpc/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ If you want to use a custom RPC provider with NEAR Wallet Selector, [check this
| -------------------------------------------------------------------------- | ------------------------------------------------------------ |
| [NEAR](setup.md) | `https://rpc.testnet.near.org` |
| [Pagoda](https://www.pagoda.co/console) | `https://rpc.testnet.pagoda.co` |

## RPC Failover

In `near-api-js` you can use [`FailoverRpcProvider`](../../4.tools/near-api-js/quick-reference.md#rpc-failover) to automatically switch RPC providers when one provider is experiencing downtime, or implement an RPC selection widget that allows users to add their own RPC provider.

As a user, if a dApp or wallet doesn't support RPC failover and the primary provider is down, you can use an RPC Selector browser extension to redirect all requests to an RPC provider of your choice.
Loading