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

Commit cf066d2

Browse files
author
Dan Forbes
committed
Remove References to Specific Providers
1 parent 6d47f5e commit cf066d2

File tree

1 file changed

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

1 file changed

+10
-10
lines changed

docs/docs/guides/web3_providers_guide/index.md

Lines changed: 10 additions & 10 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://<PROVIDER_URL>');
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://<PROVIDER_URL>'));
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://<PROVIDER_URL>', 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://<PROVIDER_URL>');
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://<PROVIDER_URL>'));
109109

110110
await web3.eth.getBlockNumber();
111111
// ↳ 18849658n
@@ -118,7 +118,7 @@ The [`WebSocketProvider` constructor](/api/web3-providers-ws/class/WebSocketProv
118118
```ts title='Configuring a WebSocket Provider'
119119
// include both optional parameters
120120
const provider = new WebSocketProvider(
121-
`ws://localhost:8545`,
121+
`wss://<PROVIDER_URL>`,
122122
{
123123
headers: {
124124
// for node services that require an API key in a header
@@ -134,7 +134,7 @@ const provider = new WebSocketProvider(
134134

135135
// OR include only ReconnectOptions
136136
const provider = new WebSocketProvider(
137-
`ws://localhost:8545`,
137+
`wss://<PROVIDER_URL>`,
138138
{},
139139
{
140140
delay: 500,
@@ -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)