fix: c bindings docs

This commit is contained in:
Richard Ramos 2022-08-18 15:26:23 -04:00
parent 31f3ed83da
commit 205270924a
No known key found for this signature in database
GPG Key ID: BD36D48BC9FFC88C
3 changed files with 11 additions and 12 deletions

View File

@ -108,14 +108,14 @@ The criteria to create subscription to a light node in JSON Format:
```ts ```ts
{ {
contentFilters: ContentFilter[]; contentFilters: ContentFilter[];
topic: string?; pubsubTopic: string?;
} }
``` ```
Fields: Fields:
- `contentFilters`: Array of [`ContentFilter`](#contentfilter-type) being subscribed to / unsubscribed from. - `contentFilters`: Array of [`ContentFilter`](#contentfilter-type) being subscribed to / unsubscribed from.
- `topic`: Optional message topic. - `topic`: Optional pubsub topic.
### `ContentFilter` type ### `ContentFilter` type
@ -128,11 +128,11 @@ Fields:
Fields: Fields:
- `contentTopic`: The content topic of a waku message. - `contentTopic`: The content topic of a Waku message.
### `StoreQuery` type ### `StoreQuery` type
Criteria used to retreive historical messages Criteria used to retrieve historical messages
```ts ```ts
interface StoreQuery { interface StoreQuery {
@ -196,7 +196,7 @@ interface Index {
Fields: Fields:
- `digest`: Hash of the message at this [`Index`](#index-type). - `digest`: Hash of the message at this [`Index`](#index-type).
- `receiverTime`: UNIX timestamp in nanoseconds at which the message at this [`Index`](#index-type) was received - `receiverTime`: UNIX timestamp in nanoseconds at which the message at this [`Index`](#index-type) was received.
- `senderTime`: UNIX timestamp in nanoseconds at which the message is generated by its sender. - `senderTime`: UNIX timestamp in nanoseconds at which the message is generated by its sender.
- `pubsubTopic`: The pubsub topic of the message at this [`Index`](#index-type). - `pubsubTopic`: The pubsub topic of the message at this [`Index`](#index-type).
@ -782,13 +782,13 @@ For example:
## Waku Filter ## Waku Filter
### `extern char* waku_filter_subscribe(char* filterJSON, char* peerID, int ms)` ### `extern char* waku_filter_subscribe(char* filterJSON, char* peerID, int timeoutMs)`
Creates a subscription in a lightnode for messages that matches a content filter and optionally a [PubSub `topic`](https://github.com/libp2p/specs/blob/master/pubsub/README.md#the-topic-descriptor). Creates a subscription in a lightnode for messages that matches a content filter and optionally a [PubSub `topic`](https://github.com/libp2p/specs/blob/master/pubsub/README.md#the-topic-descriptor).
**Parameters** **Parameters**
1. `char* filterJSON`: JSON string containing the [`FilterSubscription`](#filtersubscription-type) to unsubscribe from 1. `char* filterJSON`: JSON string containing the [`FilterSubscription`](#filtersubscription-type) to subscribe to.
2. `char* peerID`: Peer ID to subscribe to. 2. `char* peerID`: Peer ID to subscribe to.
The peer must be already known. The peer must be already known.
It must have been added before with [`waku_add_peer`](#extern-char-waku_add_peerchar-address-char-protocolid) It must have been added before with [`waku_add_peer`](#extern-char-waku_add_peerchar-address-char-protocolid)
@ -1060,7 +1060,6 @@ Decode a base64 string (useful for reading the payload from Waku Messages).
A [`JsonResponse`](#jsonresponse-type). A [`JsonResponse`](#jsonresponse-type).
If the execution is successful, the `result` field contains the decoded payload. If the execution is successful, the `result` field contains the decoded payload.
# Copyright # Copyright
Copyright and related rights waived via Copyright and related rights waived via

View File

@ -15,7 +15,7 @@ import (
// "contentTopic": "the content topic" // "contentTopic": "the content topic"
// }, ... // }, ...
// ], // ],
// "topic": "the pubsub topic" // optional // "pubsubTopic": "the pubsub topic" // optional
// } // }
// peerID should contain the ID of a peer supporting the filter protocol. Use NULL to automatically select a node // peerID should contain the ID of a peer supporting the filter protocol. Use NULL to automatically select a node
// If ms is greater than 0, the subscription must happen before the timeout // If ms is greater than 0, the subscription must happen before the timeout
@ -34,7 +34,7 @@ func waku_filter_subscribe(filterJSON *C.char, peerID *C.char, ms C.int) *C.char
// "contentTopic": "the content topic" // "contentTopic": "the content topic"
// }, ... // }, ...
// ], // ],
// "topic": "the pubsub topic" // optional // "pubsubTopic": "the pubsub topic" // optional
// } // }
// If ms is greater than 0, the subscription must happen before the timeout // If ms is greater than 0, the subscription must happen before the timeout
// (in milliseconds) is reached, or an error will be returned // (in milliseconds) is reached, or an error will be returned

View File

@ -11,7 +11,7 @@ import (
) )
type FilterArgument struct { type FilterArgument struct {
Topic string `json:"topic,omitempty"` Topic string `json:"pubsubTopic,omitempty"`
ContentFilters []pb.ContentFilter `json:"contentFilters,omitempty"` ContentFilters []pb.ContentFilter `json:"contentFilters,omitempty"`
} }