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

Offer anvil_metadata RPC #6221

Closed
antazoey opened this issue Nov 6, 2023 · 6 comments · Fixed by #6240
Closed

Offer anvil_metadata RPC #6221

antazoey opened this issue Nov 6, 2023 · 6 comments · Fixed by #6240
Assignees
Labels
first issue A good way to start contributing T-feature Type: feature

Comments

@antazoey
Copy link

antazoey commented Nov 6, 2023

Component

Anvil

Describe the feature you would like

I would like the same feature from Hardhat as this: https://hardhat.org/hardhat-network/docs/reference#hardhat_metadata
This way, I can easily perform verifications on the forked network without relying on genesis block hashes or anything weird.

It is useful metadata at the node level in general.

Additional context

No response

@antazoey antazoey added the T-feature Type: feature label Nov 6, 2023
@gakonst gakonst added this to Foundry Nov 6, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Nov 6, 2023
@antazoey antazoey changed the title Offer foundry_metadata RPC Offer anvil_metadata RPC Nov 6, 2023
@mattsse
Copy link
Member

mattsse commented Nov 6, 2023

sgtm!

we can easily add this, will do if no one picks it up

@mattsse mattsse added the first issue A good way to start contributing label Nov 6, 2023
@iankressin
Copy link

Doesn't anvil_nodeInfo already returns the info that you need?

pub async fn anvil_node_info(&self) -> Result<NodeInfo> {

@mattsse
Copy link
Member

mattsse commented Nov 7, 2023

metadata includes more info and NodeInfo is standard format

we can just add a new type + call

@antazoey
Copy link
Author

antazoey commented Nov 7, 2023

All I am really doing is checking to see if the connected is a fork; I supposed to existence of forkConfig in anvil_nodeInfo may accomplish that.

One nice thing about the metadata response is the chain ID being present instead of me having to make another request to get it.

@mattsse
Copy link
Member

mattsse commented Nov 7, 2023

fyi @Evalir this would be super simple to add

@Evalir
Copy link
Member

Evalir commented Nov 7, 2023

yep there's utility to this, so let's go and add it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first issue A good way to start contributing T-feature Type: feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants