-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update bootstrap logic and README instructions to work with a local Emulator #138
Conversation
863a1f5
to
a916727
Compare
@@ -14,6 +14,13 @@ import ( | |||
"github.com/onflow/flow-go/utils/io" | |||
) | |||
|
|||
// Default InitCadenceHeight for initializing the database on a local emulator. | |||
const EmulatorInitCadenceHeight = uint64(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this will cause the same issue with subscribing to events on the emulator right? the value 0 will be sent as the latest value to event subscription which will mean just get me the latest height. But if the evm-gateway misses some events on emulator and is then started it will also miss processing those events. I'm not sure how this is different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, it is not possible to use the Emulator locally. Starting the gateway fails with:
panic: failed to start event ingestion: failed to get provided cadence height: client: rpc error: code = NotFound desc = could not find block at height 1
That's because upon starting the Emulator, there is no block with height 1
. On a live network, such block will most likely exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that, but the problem I described still exists. So if the emulator is started and then later evm-gateway the evm-gateway will miss all the events that happened before. Neither is great tbh. So I think the ultimate solution here would be to change the flow-go height 0 treated as special value. Until then we can probably use this solution, but add a todo with the issue linked saying that once this is merged we should remove all of this: onflow/flow-go#5481
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Added in 75a13ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also add in readme an explanation that evm-gateway will be starting from latest emulator block, so if emulator is run before and transactions happen evm-gateway won't fetch those historically. You can also add a note that this will be improved soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, let me do that quickly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 740d89c
75a13ca
to
66756ea
Compare
66756ea
to
95350f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you
Description
For contributor use:
master
branchFiles changed
in the Github PR explorer