Add current state for Node API

This commit is contained in:
Oskar Thoren 2020-07-07 12:54:31 +08:00
parent 15364e2dd1
commit b2c8e27c76
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
# Node API
TBD.
*NOTE: Below is a scratch of what the API currently looks like. This will likely change. See https://github.com/status-im/nim-waku/issues/39*
## Nim API
*NOTE: Some of these are currently at the protocol layer rather than than the Node itself.*
```
method publish*(w: WakuSub, topic: string, data: seq[byte]) {.async.}
method subscribe*(w: WakuSub, topic: string, handler: TopicHandler) {.async.}
```
## JSON RPC
**TODO: Data should be RPC Messages / bytes**
**TODO: Enable topic handler**
Call sigs:
```
proc waku_version(): string
proc waku_publish(topic: string, message: string): bool
proc waku_subscribe(topic: string): bool
```