Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit b608114

Browse files
author
Dan Forbes
committed
Update Provider Examples to Use QuickNode URLs
1 parent 6d47f5e commit b608114

File tree

1 file changed

+8
-8
lines changed
  • docs/docs/guides/web3_providers_guide

1 file changed

+8
-8
lines changed

docs/docs/guides/web3_providers_guide/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import { Web3, HttpProvider } from 'web3';
4242

4343
// supply an HTTP provider as a URL string
4444
// highlight-next-line
45-
const web3 = new Web3('https://mainnet.infura.io/v3/YOUR_INFURA_ID');
45+
const web3 = new Web3('https://<NETWORK_ENDPOINT>.quiknode.pro/<API_TOKEN>/');
4646

4747
await web3.eth.getBlockNumber()
4848
// ↳ 18849658n
@@ -51,7 +51,7 @@ await web3.eth.getBlockNumber()
5151

5252
// supply an HTTP provider by constructing a new HttpProvider
5353
// highlight-next-line
54-
const web3_2 = new Web3(new HttpProvider('https://mainnet.infura.io/v3/YOUR_INFURA_ID'));
54+
const web3_2 = new Web3(new HttpProvider('https://<NETWORK_ENDPOINT>.quiknode.pro/<API_TOKEN>/'));
5555

5656
await web3.eth.getBlockNumber()
5757
// ↳ 18849658n
@@ -84,7 +84,7 @@ const httpOptions = {
8484
} as RequestInit,
8585
};
8686

87-
const web3 = new Web3(new HttpProvider('https://eth.llamarpc.com', httpOptions));
87+
const web3 = new Web3(new HttpProvider('https://<NETWORK_ENDPOINT>.quiknode.pro/<API_TOKEN>/', httpOptions));
8888
```
8989

9090
### WebSocket Provider
@@ -96,7 +96,7 @@ import { Web3, WebSocketProvider } from 'web3';
9696

9797
// supply a WebSocket provider as a URL string
9898
// highlight-next-line
99-
const web3 = new Web3('wss://mainnet.infura.io/ws/v3/YOUR_INFURA_ID');
99+
const web3 = new Web3('wss://<NETWORK_ENDPOINT>.quiknode.pro/<API_TOKEN>/');
100100

101101
await web3.eth.getBlockNumber();
102102
// ↳ 18849658n
@@ -105,7 +105,7 @@ await web3.eth.getBlockNumber();
105105

106106
// supply a WebSocket provider by constructing a new WebSocketProvider
107107
// highlight-next-line
108-
const web3_2 = new Web3(new WebSocketProvider('wss://mainnet.infura.io/ws/v3/YOUR_INFURA_ID'));
108+
const web3_2 = new Web3(new WebSocketProvider('wss://<NETWORK_ENDPOINT>.quiknode.pro/<API_TOKEN>/'));
109109

110110
await web3.eth.getBlockNumber();
111111
// ↳ 18849658n
@@ -230,11 +230,11 @@ web3.setProvider(new Web3.providers.WebsocketProvider('ws://localhost:8546'));
230230

231231
### Remote Provider
232232

233-
Services like [Alchemy](https://www.alchemy.com/), [Infura](https://www.infura.io/), and [QuickNode](https://www.quicknode.com/) offer Ethereum node services that can be accessed via HTTP or Websocket.
233+
Services like [QuickNode](https://www.quicknode.com/), [Alchemy](https://www.alchemy.com/), and [Infura](https://www.infura.io/), offer Ethereum node services that can be accessed via HTTP or Websocket.
234234

235-
```ts title='Alchemy, Infura, etc'
235+
```ts title='QuickNode, Alchemy, Infura, etc'
236236
import { Web3 } from 'web3';
237-
const web3 = new Web3('https://eth-mainnet.alchemyapi.io/v2/your-api-key');
237+
const web3 = new Web3('https://<NETWORK_ENDPOINT>.quiknode.pro/<API_TOKEN>/');
238238
```
239239

240240
Web3.js provides helpful utilities for working with certain well-known remote providers. Read more about these utilities in the [Web3.js External Providers](#web3js-external-providers) section.

0 commit comments

Comments
 (0)