mirror of https://github.com/waku-org/nwaku.git
Add current state for Node API
This commit is contained in:
parent
15364e2dd1
commit
b2c8e27c76
|
@ -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
|
||||
```
|
Loading…
Reference in New Issue