You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# - COINBASE: To be set by the operator. This is an EVM EOA or COA address which is set as the receiver of GW transaction fees (remove 0x prefix)
173
174
# - COA_ADDRESS: To be set by the operator. This is a Cadence address which funds gateway operations (remove 0x prefix)
174
175
# - COA_KEY: A full weight, private key belonging to operator COA_ADDRESS (remove 0x prefix). NB: For development use only. We recommend using cloud KMS configuration on mainnet
Copy file name to clipboardExpand all lines: README.md
+35-26Lines changed: 35 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
# EVM Gateway
4
4
5
-
**EVM Gateway enables seamless interaction with EVM on Flow, mirroring the experience of engaging with any other EVM blockchain.**
5
+
## EVM Gateway enables seamless interaction with EVM on Flow, mirroring the experience of engaging with any other EVM blockchain
6
6
7
7
EVM Gateway implements the Ethereum JSON-RPC API for [EVM on Flow](https://developers.flow.com/evm/about) which conforms to the Ethereum [JSON-RPC specification](https://ethereum.github.io/execution-apis/api-documentation/). The EVM Gateway is tailored for integration with the EVM environment on the Flow blockchain. Rather than implementing the full `geth` stack, the JSON-RPC API available in EVM Gateway is a lightweight implementation that uses Flow's underlying consensus and smart contract language, [Cadence](https://cadence-lang.org/docs/), to handle calls received by the EVM Gateway. For those interested in the underlying implementation details, please refer to the [FLIP #243](https://github.com/onflow/flips/issues/243) (EVM Gateway) and [FLIP #223](https://github.com/onflow/flips/issues/223) (EVM on Flow Core) improvement proposals.
8
8
@@ -23,7 +23,7 @@ The basic design of the EVM Gateway is as follows:
23
23
24
24
# Building
25
25
26
-
**Build from source**
26
+
## Build from source
27
27
28
28
```bash
29
29
# Make sure you pull the latest changes before running `make build`
@@ -76,7 +76,7 @@ It is acceptable to create a single Cadence account for the COA and use the EVM
76
76
77
77
For local development, first install [Flow CLI](https://developers.flow.com/tools/flow-cli/install). The examples below require no configuration and are intended for local development.
78
78
79
-
**Run from CLI**
79
+
### Run from CLI
80
80
81
81
Before running the gateway locally you need to start the Flow Emulator:
82
82
@@ -96,7 +96,7 @@ make start-local
96
96
Note that the gateway will be starting from the latest emulator block, so if the emulator is run before any transactions happen in the meantime, the gateway will not fetch those historical blocks & transactions.
97
97
This will be improved soon.
98
98
99
-
**Run with Docker**
99
+
### Run with Docker
100
100
101
101
Using Docker for local development is also supported. The following target builds the current source directory into a docker image
102
102
@@ -108,7 +108,7 @@ This target starts the flow emulator and then runs the EVM Gateway using the ima
108
108
make docker-run-local
109
109
```
110
110
111
-
**Verify**
111
+
## Verify
112
112
113
113
To verify the service is up and running:
114
114
@@ -131,7 +131,7 @@ it should return:
131
131
Running against the testnet with a local build can be done by pointing the gateway to the testnet ANs and providing the correct configuration.
132
132
Please refer to the configuration section and read through all the configuration flags before proceeding.
133
133
134
-
**Create Flow account to use for COA**
134
+
### Create Flow account to use for COA
135
135
136
136
If you don't already have a Flow account you will need to create account keys using the following command.
The `--init-cadence-height` is the Flow block height to start indexing from. To index the full EVM state, from its beginning, the proper value for this flag for testnet is `211176670`. This is the height where the `EVM` contract was first deployed on testnet, and this is where the EVM state starts from.
174
-
175
172
If you wish to test this out with your own Access Node, simply set `--access-node-grpc-host` to the DNS or IP where it is hosted.
176
-
**Note:** You need to make sure that the testnet Access Node which the gateway is connected to has indexed at least up to Flow block height `211176670`.
177
173
178
174
For the `--gas-price`, feel free to experiment with different values.
179
175
@@ -195,16 +191,15 @@ Should return a response similar to:
195
191
}
196
192
```
197
193
198
-
**Run local EVM GW docker container connected to Testnet**
194
+
### Run local EVM GW docker container connected to Testnet
199
195
200
-
To use the `make` target to connect a containerbased gateway instance to testnet requires the following environment variables to be set.
196
+
To use the `make` target to connect a container-based gateway instance to testnet requires the following environment variables to be set.
The application can be configured using the following flags at runtime:
@@ -231,7 +240,6 @@ The application can be configured using the following flags at runtime:
231
240
|`access-node-spork-hosts`|`""`| Previous spork AN hosts, defined as a comma-separated list (e.g. `"host-1.com,host2.com"`) |
232
241
|`flow-network-id`|`flow-emulator`| Flow network ID (options: `flow-emulator`, `flow-testnet`, `flow-mainnet`) |
233
242
|`coinbase`|`""`| Coinbase address to use for fee collection |
234
-
|`init-cadence-height`|`0`| Cadence block height to start indexing; avoid using on a new network |
235
243
|`gas-price`|`1`| Static gas price for EVM transactions |
236
244
|`enforce-gas-price`|`true`| Enable enforcing minimum gas price for EVM transactions. When true (default), transactions must specify a gas price greater than or equal to the configured gas price. |
237
245
|`coa-address`|`""`| Flow address holding COA account for submitting transactions |
@@ -286,14 +294,15 @@ To connect using Websockets you can use the same DNS names as above but change `
286
294
# JSON-RPC API
287
295
The EVM Gateway implements APIs according to the Ethereum specification: https://ethereum.org/en/developers/docs/apis/json-rpc/#json-rpc-methods.
288
296
289
-
**Additional APIs**
290
-
- Tracing APIs allows you to fetch execution traces
291
-
*`debug_traceTransaction`
292
-
*`debug_traceBlockByNumber`
293
-
*`debug_traceBlockByHash`
297
+
## Additional APIs
298
+
- Tracing APIs allow fetching execution traces
299
+
*`debug_traceTransaction`
300
+
*`debug_traceBlockByNumber`
301
+
*`debug_traceBlockByHash`
302
+
*`debug_traceCall`
294
303
-`debug_flowHeightByBlock` - returns the flow block height for the given EVM block (id or height)
295
304
296
-
**Unsupported APIs**
305
+
## Unsupported APIs
297
306
- Wallet APIs: we don't officially support wallet APIs (`eth_accounts`, `eth_sign`, `eth_signTransaction`, `eth_sendTransaction`) due to security
298
307
concerns that come with managing the keys on production environments, however, it is possible to configure the gateway to allow these
299
308
methods for local development by using a special flag `--wallet-api-key`.
0 commit comments