Skip to content

Commit

Permalink
fix(docs): mastering providers (#7070)
Browse files Browse the repository at this point in the history
* Improvements to Mastering Providers section

* Consistent naming of injected providers
  • Loading branch information
danforbes committed May 30, 2024
1 parent b63af9f commit 9086b98
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 238 deletions.
4 changes: 2 additions & 2 deletions docs/docs/guides/getting_started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { Web3 } from 'web3';

## Initialize `Web3` with a provider

[Providers](/guides/web3_providers_guide/) are objects that are responsible for enabling connectivity with the Ethereum network. The `Web3` object must be initialized with a valid provider to function as intended. Web3.js supports [HTTP](/guides/web3_providers_guide/#http-provider), [WebSocket](/guides/web3_providers_guide/#websocket-provider), and [IPC](/guides/web3_providers_guide/#ipc-provider) providers, and exposes packages for working with each type of provider.
[Providers](/guides/web3_providers_guide/) are services that are responsible for enabling connectivity with the Ethereum network. The `Web3` object must be initialized with a valid provider to function as intended. Web3.js supports [HTTP](/guides/web3_providers_guide/#http-provider), [WebSocket](/guides/web3_providers_guide/#websocket-provider), and [IPC](/guides/web3_providers_guide/#ipc-provider) providers, and exposes packages for working with each type of provider.

Web3.js is in compliance with [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193), the Ethereum Provider JavaScript API, so any EIP-1193 provider can be used to initialize the `Web3` object.

Expand Down Expand Up @@ -248,7 +248,7 @@ console.log(eventTransfer);
Web3.js allows user to subscribe to events for real-time notification of important contract interactions. Here is an example of creating a subscription to the Uniswap token's `Transfer` event:

:::note
You MUST initialize the `Web3` object with a [WebSocket](/guides/web3_providers_guide/#websocket-provider) provider to subscribe to live events.
HTTP providers do not support real-time event subscriptions. Use one of the other [provider types](/guides/web3_providers_guide/#providers-types) to subscribe to real-time events.
:::

```ts
Expand Down
Loading

1 comment on commit 9086b98

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 9086b98 Previous: b63af9f Ratio
processingTx 9425 ops/sec (±3.89%) 8492 ops/sec (±5.07%) 0.90
processingContractDeploy 40876 ops/sec (±7.53%) 39518 ops/sec (±6.31%) 0.97
processingContractMethodSend 20109 ops/sec (±6.99%) 18741 ops/sec (±7.77%) 0.93
processingContractMethodCall 40926 ops/sec (±6.33%) 39031 ops/sec (±6.06%) 0.95
abiEncode 46401 ops/sec (±6.86%) 43800 ops/sec (±6.74%) 0.94
abiDecode 31387 ops/sec (±7.92%) 29194 ops/sec (±8.15%) 0.93
sign 1581 ops/sec (±3.62%) 1549 ops/sec (±0.87%) 0.98
verify 384 ops/sec (±0.33%) 368 ops/sec (±0.60%) 0.96

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.