This repository has been archived by the owner on Jan 11, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of consensus-shipyard/ipc#342
Establishes a
fendermint_eth_api
library crate which can listen to the JSON-RPC and eventually WebSocket requests from Ethereum tools. This is started as another command underfendermint_app
:Further to these options, we have some extra settings in
default.toml
:The default values for the ports have been chosen to match
geth
.Why not a separate binary?
Initially I created the
fendermint_eth_api
as a binary crate with amain.rs
, which is where I thought it will have only one job to do, which is to run the server. It would have still required its own settings file, though, so I thought we can move some config utilities to a common crate, like log levels, home directory and tilde handling.But then I thought it might get confusing how to handle the
~/.fendermint/config
directory, which currently has adefault.toml
. Do we really want operators to have to worry about two different config files?By putting the entry under the same
fendermint
application as a subcommand, we don't have to create anotherDockerfile
, it all gets compiled into one, and just started with a different command and the relevant environment variable overrides. Notably it would not touch the DB section of the settings, and not share a volume with the ABCI container.Why these JSON-RPC libraries?
I saw the
ipc-agent
implemented one from scratch, but it can't be separately imported. The jsonrpsee library seems to be most used, but it contains many more features to learn, while the jsonrpc-v2 used by Forest seems simple, and they already worked out the details of making it work with axum, which looked all right in this comparison. I didn't ask if they would make the same choice again, but it looks like an easy start.