ID of a given peer, typically described by a protocol. For example: - SPIFFE: "spiffe://example.org/service/foo" - JWT: "jwt:sub=alice,iss=https://issuer.example.com" - Tor: "onion:abcdefghijklmno.onion" - DID: "did:example:123456789abcdefghi" - IPFS: "ipfs:QmYwAPJzv5CZsnAzt8auVZRn2E6sD1c4x8pN5o6d5cW4D5"
Unique identifier of the publication operation to query.
GetPublicationResponse
GetPublicationResponse contains the full details of a specific publication request.
Includes status, progress information, and any error details if applicable.
Timestamp of the most recent status update for this publication in the RFC3339 format.
ListPublicationsItem
ListPublicationsItem represents a single publication request in the list response.
Contains publication details including ID, status, and creation timestamp.
PublicationStatus represents the current state of a publication request.
Publications progress from pending to processing to completed or failed states.
Name
Number
Description
PUBLICATION_STATUS_UNSPECIFIED
0
Default/unset status - should not be used in practice
PUBLICATION_STATUS_PENDING
1
Sync operation has been created but not yet started
PUBLICATION_STATUS_IN_PROGRESS
2
Sync operation is actively discovering and transferring objects
PUBLICATION_STATUS_COMPLETED
3
Sync operation has been successfully completed
PUBLICATION_STATUS_FAILED
4
Sync operation encountered an error and stopped
PublicationService
PublicationService manages publication requests for announcing records to the DHT.
Publications are stored in the database and processed by a worker that runs every hour.
The publication workflow:
1. Publications are created via routing's Publish RPC by specifying either a query, a list of CIDs, or all records
2. Publication requests are added to the database
3. PublicationWorker queries the data using the publication request from the database to get the list of CIDs to be published
4. PublicationWorker announces the records with these CIDs to the DHT
CreatePublication creates a new publication request that will be processed by the PublicationWorker. The publication request can specify either a query, a list of specific CIDs, or all records to be announced to the DHT.
ListPublications returns a stream of all publication requests in the system. This allows monitoring of pending, processing, and completed publication requests.
A query to match the record against during discovery.
For example:
{ type: RECORD_QUERY_TYPE_SKILL, value: "Natural Language Processing" }
{ type: RECORD_QUERY_TYPE_LOCATOR, value: "helm-chart" }
{ type: RECORD_QUERY_TYPE_DOMAIN, value: "research" }
{ type: RECORD_QUERY_TYPE_FEATURE, value: "runtime/language" }
Minimal target query match score. For example, if min_match_score=2, it will return records that match at least two of the queries. If not set, it will return records that match at least one query.
Limit the number of results returned. If not set, it will return all discovered records. Note that this is a soft limit, as the search may return more results than the limit if there are multiple peers providing the same record.
Announce to the network that this peer is providing a given record. This enables other peers to discover this record and retrieve it from this peer. Listeners can use this event to perform custom operations, for example by cloning the record.
Items need to be periodically republished (eg. 24h) to the network to avoid stale data. Republication should be done in the background. |
| Unpublish | UnpublishRequest | .google.protobuf.Empty | Stop serving this record to the network. If other peers try to retrieve this record, the peer will refuse the request. |
| Search | SearchRequest | SearchResponse stream | Search records based on the request across the network. This will search the network for the record with the given parameters.
It is possible that the records are stale or that they do not exist. Some records may be provided by multiple peers.
Results from the search can be used as an input to Pull operation to retrieve the records. |
| List | ListRequest | ListResponse stream | List all records that this peer is currently providing that match the given parameters. This operation does not interact with the network. |
Scalar Value Types
.proto Type
Notes
C++
Java
Python
Go
C#
PHP
Ruby
double
double
double
float
float64
double
float
Float
float
float
float
float
float32
float
float
Float
int32
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.
int32
int
int
int32
int
integer
Bignum or Fixnum (as required)
int64
Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.
int64
long
int/long
int64
long
integer/string
Bignum
uint32
Uses variable-length encoding.
uint32
int
int/long
uint32
uint
integer
Bignum or Fixnum (as required)
uint64
Uses variable-length encoding.
uint64
long
int/long
uint64
ulong
integer/string
Bignum or Fixnum (as required)
sint32
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.
int32
int
int
int32
int
integer
Bignum or Fixnum (as required)
sint64
Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.
int64
long
int/long
int64
long
integer/string
Bignum
fixed32
Always four bytes. More efficient than uint32 if values are often greater than 2^28.
uint32
int
int
uint32
uint
integer
Bignum or Fixnum (as required)
fixed64
Always eight bytes. More efficient than uint64 if values are often greater than 2^56.
uint64
long
int/long
uint64
ulong
integer/string
Bignum
sfixed32
Always four bytes.
int32
int
int
int32
int
integer
Bignum or Fixnum (as required)
sfixed64
Always eight bytes.
int64
long
int/long
int64
long
integer/string
Bignum
bool
bool
boolean
boolean
bool
bool
boolean
TrueClass/FalseClass
string
A string must always contain UTF-8 encoded or 7-bit ASCII text.