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

Add http api to mirror cli commands #186

Closed
ethanfrey opened this issue Jul 27, 2017 · 9 comments
Closed

Add http api to mirror cli commands #186

ethanfrey opened this issue Jul 27, 2017 · 9 comments

Comments

@ethanfrey
Copy link
Contributor

This will be much easier to work with for web developers. Just standard POST and GET to manage keys, sign transactions and query database state with the full security of the light client, attempting to make a REST API.

Discussing desired API with js devs to find something usable.

@ethanfrey
Copy link
Contributor Author

Decided to run it over HTTP on localhost at first for ease of development. CORS is disabled (better), or set specifically in the config file for one site.

Future use of unix sockets or encryption.

@odeke-em
Copy link
Collaborator

So for starters this is a spitball enumeration of the CLI commands:

  • send:

    • Description: Send tokens between two basecoin accounts.
    • Method: POST
    • Requirements:
      • [Authentication of some sorts] If needed, perhaps can be skipped over for MVP
      • FromID
      • To
      • Gas
      • Sequence Number
      • Fee
  • query account:

    • Description: Get details of an account with proof
    • Method: GET
    • Requirements:
      • [Authentication of some sorts] If needed, perhaps can be skipped over for MVP
      • AccountID
    • Request JSON schema
  • authentication:

    • Description: authenticate the user. Perhaps not necessary for the MVP
    • Method: POST
    • Requirements:
      • Valid basecoin account

Please add others as we keep discussing.

@mappum
Copy link
Contributor

mappum commented Jul 27, 2017

The API ideas from our discussion are can be found in this document: https://github.com/tendermint/basecoin/blob/feature/186-http-api/docs/rest/API_draft.md

@odeke-em
Copy link
Collaborator

Awesome, thank you @mappum let me take a look!

@nylira
Copy link
Contributor

nylira commented Jul 27, 2017

This is going to be awesome!

@ethanfrey ethanfrey added the 0.7 label Jul 27, 2017
@ethanfrey
Copy link
Contributor Author

Existing code to be reused and spiffed up:

https://github.com/tendermint/go-crypto/tree/master/keys/server
https://github.com/tendermint/basecoin/blob/unstable/client/commands/proxy/root.go

I would propose making a new directory in basecoin for this code, under client/rest, and moving the proxy logic there. The cli command to launch the server can be under commands, all http.Handlers and all helper methods should be there.

@odeke-em
Copy link
Collaborator

Iteration 1 delivered with https://github.com/tendermint/basecoin/pull/190.

Next steps will be to do some housekeeping, cleanups, restructuring the code. I had a video call with @ethanfrey on Saturday 29th July 2017 at around 8PM EST and he gave some suggestions that are also in an offline email. Watch this space

@odeke-em
Copy link
Collaborator

odeke-em commented Aug 2, 2017

Follow up issue https://github.com/tendermint/basecoin/issues/200.

@ethanfrey
Copy link
Contributor Author

This is on-going, but the basic needs for basecoin have been implemented. We will see further development in other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants