lotus/docs/API.md

33 lines
830 B
Markdown
Raw Normal View History

2019-07-18 16:51:21 +00:00
TODO: make this into a nicer doc
### Endpoints
By default `127.0.0.1:1234` - daemon stores the api endpoint multiaddr in `~/.lotus/api`
2019-10-23 09:18:22 +00:00
* `http://[api:port]/rpc/v0` - JsonRPC http endpoint
* `ws://[api:port]/rpc/v0` - JsonRPC websocket endpoint
* `PUT http://[api:port]/rest/v0/import` - import file to the node repo
* Requires write permission
For JsonRPC interface definition see `api/api.go`. Required permissions are
defined in `api/struct.go`
2019-07-18 16:51:21 +00:00
### Auth:
JWT in the `Authorization: Bearer <token>` http header
Permissions:
2019-07-23 20:15:29 +00:00
* `read` - Read node state, no private data
* `write` - Write to local store / chain, read private data
* `sign` - Use private keys stored in wallet for signing
* `admin` - Manage permissions
2019-07-18 16:51:21 +00:00
Payload:
```json
{
"Allow": ["read", "write", ...]
}
```
2019-10-23 09:18:22 +00:00
Admin token is stored in `~/.lotus/token`