["createHistoryStream"]
Table of contents
Description
This request is used for replicating messages from different clients. Clients can perform ["createHistoryStream"]
requests to get new messages from feeds which they are interested in. This mechanism is sometimes referred to as “legacy replication” as new replication mechanism based on ["ebt", "replicate"]
is now available.
The primary documentation for this request is the Scuttlebutt Protocol Guide.
Specification
Requests
Name | ["createHistoryStream"] |
Type | "source" |
Args | Must be an array containing exactly one object. |
Args
The object within the args
array must have the following schema:
Field name | Required | Type | Description |
---|---|---|---|
id | true | string | Id of the feed. All observed requests used the at-sign feed id format. |
sequence | false | number | If specified then messages with a sequence number greater than the provided sequence number will be returned. If Some clients pass Warning! In the past the name of this argument was Warning! The protocol guide specifies that messages greater than the provided sequence number should be returned. Some clients appear to return messages with a sequence number greater or equal to the provided sequence number. See this issue. |
limit | false | number | Maximum number of messages to be returned. If this argument is not set then the number of returned messages is not limited. |
live | false | boolean | If this argument is set to If this argument is not set then it must be considered to be |
old | false | boolean | If this argument is set to If this argument is not set then it must be considered to be |
keys | false | boolean | This argument controls the format of responses. See the section about responses below. If this argument is not set then it must be considered to be |
Notes:
- Setting
live
tofalse
andold
tofalse
seems to imply that no messages will ever be returned and the stream will be closed right away.
Responses
The messages in responses must be sent sorted by the sequence number in an ascending way. The sequence numbers must come one-by-one without gaps. Each response contains one message. The format of all responses in the stream depends on the keys
parameter.
Without keys
If keys
is set to false
then messages are directly returned in each response.
With keys
If keys
is set to true
then messages are wrapped with an additional object.
The object must have the following schema:
Field name | Required | Type | Description |
---|---|---|---|
key | true | string | Id of the message. All observed requests used the percent-sign feed id format. |
value | false | Raw JSON | Raw JSON of the returned message. |
timestamp | false | number | Unix timestamp in number of milliseconds which specifies when this message was returned by the client responding to the request. |
Support table
Sends | Accepts | |
---|---|---|
go-ssb | v0.2.1 Yes. | v0.2.1 Yes. |
Patchwork | 3.18.1 Yes. | 3.18.1 Yes. See protocol-guide/#65 for information about the sequence argument. |
Manyverse | v0.2203.21-beta Unknown. | v0.2203.21-beta Unknown. |