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 more rest handlers for basecoin #200

Closed
ethanfrey opened this issue Aug 2, 2017 · 2 comments
Closed

Add more rest handlers for basecoin #200

ethanfrey opened this issue Aug 2, 2017 · 2 comments

Comments

@ethanfrey
Copy link
Contributor

ethanfrey commented Aug 2, 2017

The current setup is nice for sendtx and querying accounts. Ideally, every tx and query that is available in the cli is also available in the rest api.

Minimally, this means:

Also, please allow me to configure which endpoints are present in main.go, without having to cut and paste the ServeCmd into my sub-repo. This is designed to be imported (not forked) and used to build many different commands for each app. So a third party should easily be able to write a new tx or query endpoint, as well as register it with the server. (Or also remove eg. all endpoints except /query/*)

@odeke-em
Copy link
Collaborator

odeke-em commented Aug 8, 2017

Next up would be to implement a route for:

ethanfrey pushed a commit that referenced this issue Aug 18, 2017
* Note: Role must be a hex string, as enforced in tests/rest/cli.sh

```shell
$ curl -X POST http://localhost:8998/build/create_role --data \
'{
  "role":"DEADBEEF", "seq": 1,
  "min_sigs": 1,
  "signers": [{
    "addr": "4FF759D47C81754D8F553DCCAC8651D0AF74C7F9", "app": "role"
  }]
}'
```

```HTTP
HTTP/1.1 200 OK
Content-Type: application/json
Date: Tue, 08 Aug 2017 19:15:13 GMT
Content-Length: 387

{
  "type": "chain/tx",
  "data": {
    "chain_id": "test_chain_id",
    "expires_at": 0,
    "tx": {
      "type": "role/create",
      "data": {
        "role": "DEADBEEF",
        "min_sigs": 1,
        "signers": [
          {
            "chain": "",
            "app": "role",
            "addr": "4FF759D47C81754D8F553DCCAC8651D0AF74C7F9"
          }
        ]
      }
    }
  }
}
```

Updates #200
@ethanfrey ethanfrey added the API label Aug 20, 2017
@ebuchman
Copy link
Member

stale. but related to #324

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

3 participants