2020-06-09 23:56:58 -04:00
-----
2020-07-03 01:54:56 -04:00
Documentation: [html ](https://docs.ethers.io/ )
2020-06-09 23:56:58 -04:00
-----
Providers
=========
Default Provider
----------------
#### *ethers* . **getDefaultProvider**( [ network , [ options ] ] ) => *[Provider](/v5/api/providers/provider/)*
2020-11-22 23:07:13 -05:00
Returns a new Provider, backed by multiple services, connected to *network* . If no *network* is provided, **homestead** (i.e. mainnet) is used.
2020-06-09 23:56:58 -04:00
2020-09-08 01:12:15 -04:00
The *network* may also be a URL to connect to, such as `http://localhost:8545` or `wss://example.com` .
2020-06-09 23:56:58 -04:00
The *options* is an object, with the following properties:
Option Properties
#### Note: API Keys
2020-11-22 23:07:13 -05:00
It is highly recommended for production services to acquire and specify an API Key for each service.
2020-06-09 23:56:58 -04:00
2020-07-03 01:54:56 -04:00
The default API Keys used by ethers are shared across all users, so services may throttle all services that are using the default API Keys during periods of load without realizing it.
2020-06-09 23:56:58 -04:00
2020-07-03 01:54:56 -04:00
Many services also have monitoring and usage metrics, which are only available if an API Key is specified. This allows tracking how many requests are being sent and which methods are being used the most.
2020-06-09 23:56:58 -04:00
2020-07-03 01:54:56 -04:00
Some services also provide additional paid features, which are only available when specifying an API Key.
2020-06-09 23:56:58 -04:00
2020-09-08 01:12:15 -04:00
Networks
--------
### Custom ENS Contract
```
const network = {
name: "dev",
chianId: 1337,
ensAddress: customEnsAddress
};
```
2020-06-09 23:56:58 -04:00
Provider Documentation
----------------------
* [Provider ](provider )
* [Accounts Methods ](provider )
* [Blocks Methods ](provider )
* [Ethereum Naming Service (ENS) Methods ](provider )
2021-02-08 15:26:10 -05:00
* [EnsResolver ](provider )
2020-06-09 23:56:58 -04:00
* [Logs Methods ](provider )
* [Network Status Methods ](provider )
* [Transactions Methods ](provider )
* [Event Emitter Methods ](provider )
* [Inspection Methods ](provider )
* [JsonRpcProvider ](jsonrpc-provider )
* [JsonRpcSigner ](jsonrpc-provider )
* [JsonRpcUncheckedSigner ](jsonrpc-provider )
* [Node-Specific Methods ](jsonrpc-provider )
* [API Providers ](api-providers )
* [EtherscanProvider ](api-providers )
* [InfuraProvider ](api-providers )
* [AlchemyProvider ](api-providers )
* [CloudflareProvider ](api-providers )
* [Other Providers ](other )
* [FallbackProvider ](other )
* [IpcProvider ](other )
* [UrlJsonRpcProvider ](other )
* [Web3Provider ](other )
2020-07-03 01:54:56 -04:00
* [WebSocketProvider ](other )
2020-06-09 23:56:58 -04:00
* [Types ](types )
* [BlockTag ](types )
2020-09-08 01:12:15 -04:00
* [Networkish ](types )
2020-06-09 23:56:58 -04:00
* [Network ](types )
* [Block ](types )
* [Events and Logs ](types )
* [Transactions ](types )