Skip to content
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
8 changes: 8 additions & 0 deletions packages/provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ const web3 = new Web3Provider()
// Accepts either a URL or a network name (main, kovan)
const provider = new OptimismProvider('http://localhost:8545', web3)
```

## Goerli Testnet

To connect to the Goerli testnet:

```js
const provider = new OptimismProvider('goerli')
```
7 changes: 4 additions & 3 deletions packages/provider/src/app/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ export function getUrl(
// List of publically available urls to use
// TODO(mark): in this case, turn off calls for `eth_getChainId`
switch (network ? network.name : 'unknown') {
case 'main':
host = '' // TODO: once the url of mainnet is known
case 'goerli':
host = 'goerli.optimism.io'
break
case 'main':
default:
logger.throwError('unsupported network', Logger.errors.INVALID_ARGUMENT, {
argument: 'network',
Expand All @@ -154,7 +155,7 @@ export function getUrl(
}

const connection: ConnectionInfo = {
url: `http://${host}`,
url: `https://${host}`,
}

return connection
Expand Down