2022-09-30 10:56:16 +00:00
|
|
|
# MetaMask configuration with Alchemy provider
|
|
|
|
|
2022-11-18 13:37:22 +00:00
|
|
|
This document explains how to configure the proxy, and how to configure MetaMask
|
|
|
|
to make use of the proxy.
|
2022-09-30 10:56:16 +00:00
|
|
|
|
2022-11-23 16:11:38 +00:00
|
|
|
### 1. Building the Nimbus Verified Proxy
|
2022-09-30 10:56:16 +00:00
|
|
|
|
2022-11-23 16:11:38 +00:00
|
|
|
First build the Nimbus Verified Proxy as explained [here](../README.md#Build-light-client-proxy).
|
2022-09-30 10:56:16 +00:00
|
|
|
|
2022-11-23 16:11:38 +00:00
|
|
|
### 2. Configuring and running the Nimbus Verified Proxy
|
2022-09-30 10:56:16 +00:00
|
|
|
|
2022-11-18 13:37:22 +00:00
|
|
|
To start the proxy for the Goerli network, run the following command (inserting your own `TRUSTED_BLOCK_ROOT` and Alchemy `API_KEY`):
|
2022-09-30 10:56:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# From the nimbus-eth1 repository
|
2022-11-18 13:37:22 +00:00
|
|
|
TRUSTED_BLOCK_ROOT=0x1234567890123456789012345678901234567890123456789012345678901234 # Replace this
|
|
|
|
API_KEY=abcd # Replace this
|
2022-11-23 16:11:38 +00:00
|
|
|
./build/nimbus_verified_proxy \
|
2022-11-18 13:37:22 +00:00
|
|
|
--network=goerli \
|
|
|
|
--trusted-block-root=${TRUSTED_BLOCK_ROOT} \
|
|
|
|
--web3-url="wss://eth-goerli.g.alchemy.com/v2/${API_KEY}"
|
2022-09-30 10:56:16 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
2022-11-23 16:11:38 +00:00
|
|
|
After startup, the Nimbus Verified Proxy will start looking for suitable peers in the network,
|
2022-11-18 13:37:22 +00:00
|
|
|
i.e peers which serve consensus light client data, and will then start syncing.
|
2022-09-30 10:56:16 +00:00
|
|
|
During syncing most of the RPC endpoints will be inactive
|
2022-11-18 13:37:22 +00:00
|
|
|
and will fail to respond to queries. This happens because the proxy cannot verify responses
|
2022-09-30 10:56:16 +00:00
|
|
|
from the data provider until the consensus light client is in sync with the consensus chain.
|
|
|
|
|
2022-11-18 13:37:22 +00:00
|
|
|
When the consensus light client is in sync, the following line should be visible in the logs:
|
2022-09-30 10:56:16 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
NOT 2022-09-29 10:06:15.974+02:00 New LC optimistic block opt=81de61ec:3994230 wallSlot=3994231
|
|
|
|
```
|
|
|
|
|
|
|
|
After receiving the first optimistic block, the proxy is ready to be used with MetaMask.
|
|
|
|
|
2022-11-18 13:37:22 +00:00
|
|
|
### 3. Configuring MetaMask extension to use a custom network
|
2022-09-30 10:56:16 +00:00
|
|
|
|
|
|
|
To add custom network in MetaMask browser extension:
|
2022-11-18 13:37:22 +00:00
|
|
|
1. Go to MetaMask `settings`.
|
|
|
|
2. In `settings`, go to `networks` tab.
|
2022-09-30 10:56:16 +00:00
|
|
|
3. Click on the `Add a network` button.
|
2022-11-18 13:37:22 +00:00
|
|
|
4. Click on `Add a network manually`.
|
|
|
|
5. Type a Network name of choice, e.g. "Trusted Goerli".
|
|
|
|
The `New RPC URL` field must be configured to point to the HTTP server of the proxy. In this
|
|
|
|
example it will be `http://127.0.0.1:8545`. The `Chain ID` field must be set to the chain id of
|
|
|
|
the network used by the proxy. The chain id for Goerli is `5`.
|
2022-09-30 10:56:16 +00:00
|
|
|
|
2022-11-18 13:37:22 +00:00
|
|
|
If everything went smooth there should be a new network in `Networks` drop down menu.
|
2022-09-30 10:56:16 +00:00
|
|
|
|
|
|
|
After switching to this network it should be possible to create new accounts, and
|
|
|
|
perform transfers between them.
|
|
|
|
|
2022-11-18 13:37:22 +00:00
|
|
|
> Note: Currently, adding a custom network with a chain id which already exists in the MetaMask
|
|
|
|
configuration will be highlighted as an error. This should be ignored
|
|
|
|
as this should be rather a warning, and is a known [bug](https://github.com/MetaMask/metamask-extension/issues/13249) in MetaMask.
|