Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Improvement : add endpoint to return fork status #347

Closed
PhilippeR26 opened this issue Nov 21, 2022 · 7 comments · Fixed by #354
Closed

Improvement : add endpoint to return fork status #347

PhilippeR26 opened this issue Nov 21, 2022 · 7 comments · Fixed by #354
Assignees
Labels
Context: coupled interact with some parts of the codebase Difficulty: intermediate mobilise some notions about the field, but can be learn good first issue Good for newcomers Techno: python Python Type: feature New feature or request

Comments

@PhilippeR26
Copy link

It could be useful to be able to request to devnet the fork info.
For example, with a such command :
curl -X GET http://127.0.0.1:5050/fork-status -H "Content-Type:application/json"
and have in return some infos :

  • forked or not.
  • source network of the fork (alpha-goerli, alpha-goerli2, alpha-mainnet, or URL).
@FabijanC FabijanC added Type: feature New feature or request good first issue Good for newcomers Techno: python Python Context: coupled interact with some parts of the codebase Difficulty: intermediate mobilise some notions about the field, but can be learn labels Nov 22, 2022
@ptisserand
Copy link
Contributor

Hi, can I work on this issue?

@FabijanC
Copy link
Collaborator

FabijanC commented Nov 24, 2022

@ptisserand Yes you can!

Although I believe first we would need to decide on the API. Here's my suggestion, let me know what you think:

  • Introduce a new endpoint /fork_status (underscore to be in sync with other endpoints and the original gateway interface)
  • If forking, it could return an object with (at least) two keys: forking url and forking block
  • If not forking, it could return an empty object

You would need to create at least two tests (asserting response when forking and not)

@ivpavici Do we have to do anything onlydust-wise?

@ptisserand
Copy link
Contributor

@FabijanC I agree with your suggestion
For returned JSON object, is {"url": "https://.....", "block": 437771} ok for you ?

@FabijanC
Copy link
Collaborator

Yeah, looks good!

@ivpavici
Copy link
Contributor

@FabijanC we did not add any new tasks on OnlyDust, but we could I guess

@ptisserand
Copy link
Contributor

For endpoint documentation, should I add it in page/docs/guide/fork.md ?

@FabijanC
Copy link
Collaborator

@ptisserand yes. You can also create a PR (or a PR draft) so we can discuss there

ptisserand added a commit to ptisserand/starknet-devnet that referenced this issue Nov 25, 2022
ptisserand added a commit to ptisserand/starknet-devnet that referenced this issue Nov 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Context: coupled interact with some parts of the codebase Difficulty: intermediate mobilise some notions about the field, but can be learn good first issue Good for newcomers Techno: python Python Type: feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants