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

Make Obscuroscan RESTful #771

Open
jamescarlyle opened this issue Oct 28, 2022 · 0 comments
Open

Make Obscuroscan RESTful #771

jamescarlyle opened this issue Oct 28, 2022 · 0 comments

Comments

@jamescarlyle
Copy link
Contributor

jamescarlyle commented Oct 28, 2022

Obscuroscan.io currently provides an API for the front-end HTML page to call.

  1. This currently requires the use of POST HTTP verbs. I propose that the API is changed to support GET verbs in the case of information retrieval, and that each resource (e.g. block / rollup / transaction) is assigned a URL which may be used to extract information about it.

So, for example, in order to retrieve information about a particular rollup, instead of the following
URL: http://testnet.obscuroscan.io/api/rollup/
Method: POST
Payload: 0xe8f7a811e3cdda3d04bc1a16e66f8a112c6f5d6ed4421c995932a1eb68eab004

Clients could use the following
URL: http://testnet.obscuroscan.io/rollup/0xe8f7a811e3cdda3d04bc1a16e66f8a112c6f5d6ed4421c995932a1eb68eab004
Method: GET
Header: Accept: application/json or text/html

  1. Provide a RESTful endpoint for transaction data, e.g.
    URL: http://testnet.obscuroscan.io/transaction/0xe8f7a811e3cdda3d04bc1a16e66f8a112c6f5d6ed4421c995932a1eb68eab004
    Method: GET
    Header: Accept: application/json or text/html

Reasons:

  1. Make it easier for app developers to link to Obscuroscan, and to particular resources, in order to demonstrate the power of Obscuro. For example, I'd like to link events being displayed in The Guessing Game ("Your guess was incorrect") to the corresponding transaction on Obscuroscan, where users could see both the encrypted and decrypted transaction details.
  2. Align to other block explorers, like Etherscan. e.g. https://etherscan.io/block/15845848 or https://etherscan.io/tx/0x376b11c3a375336463d7163b3c55606f06d9e21df129a2db3b85cd12ba5430f8
  3. Follow REST conventions and HTTP semantics. https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants