Skip to content
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

Allow the use of custom Ethereum JSON-RPC endpoint #253

Merged
merged 4 commits into from
Oct 7, 2022

Conversation

james-chf
Copy link
Contributor

@james-chf james-chf commented Aug 2, 2022

Closes #417 and #464

This PR makes it so that the ledger will not start up geth if the ledger.ethereum.mode = "Remote". The motivation for this PR is to be able to test the ledger more easily (with a separately managed geth process or some standin like npx hardhat node, or some remote Ethereum endpoint). I've manually tested using a separate geth process and passing envvars to override the appropriate config e.g.

# with npx hardhat node
export ANOMA_LEDGER__ETHEREUM__MODE='Remote'
target/debug/namadan ledger run

@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch from 87ae736 to 32289f4 Compare August 3, 2022 09:12
@james-chf james-chf changed the title Allow use of custom Ethereum JSON RPC endpoint via ETHEREUM_URL environment variable Allow use of custom Ethereum JSON RPC endpoint via ANOMA_ETHEREUM_URL envvar Aug 3, 2022
@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch 4 times, most recently from 978fe79 to b8ab36c Compare August 4, 2022 12:10
apps/src/lib/config/mod.rs Outdated Show resolved Hide resolved
apps/src/lib/node/ledger/ethereum_node/oracle.rs Outdated Show resolved Hide resolved
apps/src/lib/node/ledger/mod.rs Outdated Show resolved Hide resolved
@james-chf james-chf marked this pull request as ready for review August 4, 2022 13:02
@james-chf james-chf requested review from batconjurer and sug0 August 4, 2022 13:03
@james-chf james-chf marked this pull request as draft August 5, 2022 09:24
@james-chf
Copy link
Contributor Author

I'll make the following changes to this PR:

  • use a struct (e.g. host + port) rather than a string for configuring the custom RPC endpoint
  • this should be set in Config, not in an envvar

@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch from b8ab36c to 08552ed Compare August 11, 2022 15:01
@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch from b7c377e to 4acc6f5 Compare August 30, 2022 11:12
@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch from 4acc6f5 to f694e65 Compare August 30, 2022 14:44
@james-chf james-chf changed the title Allow use of custom Ethereum JSON RPC endpoint via ANOMA_ETHEREUM_URL envvar Allow the use of custom Ethereum JSON-RPC endpoint Sep 1, 2022
@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch from f694e65 to bb8dd88 Compare September 4, 2022 10:59
@james-chf james-chf changed the base branch from eth-bridge-integration to james/ethbridge/configuration September 4, 2022 11:05
Base automatically changed from james/ethbridge/configuration to eth-bridge-integration September 4, 2022 11:07
@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch 2 times, most recently from f1d601f to d9662e0 Compare September 6, 2022 10:12
@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch from d9662e0 to cdf2283 Compare September 9, 2022 10:50
@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch from cdf2283 to f07284a Compare September 9, 2022 12:18
@james-chf james-chf marked this pull request as ready for review September 9, 2022 12:19
@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch 3 times, most recently from 3681490 to ef55fb6 Compare September 22, 2022 13:48
@james-chf james-chf changed the base branch from eth-bridge-integration to tiago/refactor-ledger-run-with-cleanup September 22, 2022 13:49
@james-chf james-chf changed the base branch from tiago/refactor-ledger-run-with-cleanup to eth-bridge-integration September 22, 2022 15:12
@james-chf james-chf changed the base branch from eth-bridge-integration to tiago/refactor-ledger-run-with-cleanup September 22, 2022 15:12
@james-chf james-chf changed the base branch from tiago/refactor-ledger-run-with-cleanup to eth-bridge-integration September 23, 2022 12:37
@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch from ef55fb6 to 777d8bb Compare September 23, 2022 12:44
@james-chf james-chf marked this pull request as draft October 3, 2022 16:27
@Fraccaman Fraccaman force-pushed the eth-bridge-integration branch 2 times, most recently from 8d7b66f to c285b74 Compare October 6, 2022 10:49
@james-chf james-chf force-pushed the james/ethbridge/optional-geth branch from 190bf02 to d71088e Compare October 6, 2022 18:11
@james-chf james-chf marked this pull request as ready for review October 6, 2022 18:53
@james-chf
Copy link
Contributor Author

I thought about the issue of oracle_rpc_endpoint potentially containing a secret API key, like in the case where someone was using an Alchemy endpoint e.g. https://eth-goerli.alchemyapi.io/v2/${ALCHEMY_API_KEY}. Generally I don't think this config value should be treated as secret, so it's still OK to log oracle_rpc_endpoint as we're currently doing. I don't think having sensitive information in an (Ethereum endpoint) URL is a good practice we need to accommodate.

@james-chf james-chf merged commit 85d5542 into eth-bridge-integration Oct 7, 2022
@james-chf james-chf deleted the james/ethbridge/optional-geth branch October 7, 2022 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants