TxPB

TemporalX gRPC and Documentation Resources

View on GitHub

Protocol Documentation

Table of Contents

Top

admin.proto

ManageGCRequest

ManageGCRequest is a message used to control TemporalX garbage collection

Field Type Label Description
type GCREQTYPE   type is the type of gc request being performed

ManageGCResponse

ManageGCResponse is a message used as a response to gc control requests

Field Type Label Description
status string   status contains a status message

RefCountRequest

RefCountRequest is used to analyze the reference counter store, and retrieve usage information

Field Type Label Description
cids string repeated cids are optional cids to filter our requests by
limit int64   can be used to apply limits to the number of store requests made, search limits, etc..

RefCountResponse

RefCountResponse is used to return the information gathered by a RefCount rpc call.

Field Type Label Description
cids RefCountResponse.CidsEntry repeated cids is a mapping of the cid to its reference count

RefCountResponse.CidsEntry

Field Type Label Description
key string    
value int64    

GCREQTYPE

GCREQTYPE specifies the type of GC management call being performed

Name Number Description
GC_START 0 GC_START is used to start gc
GC_STOP 1 C_STOP is used to stop GC
GC_STATUS 2 GC_STATUS is used to retrieve gc status

REFREQOPTS

REFREQOPTS are options for fine-tuning ref count requests

Name Number Description
REF_FORCE 0  

REFREQTYPE

REFREQTYPE is used to indicate the type of ref count request being made

Name Number Description
REF_GET_COUNT 0 REF_GET_COUNT is used to get the reference count of a particular cid
REF_DELETE 1  

AdminAPI

AdminAPI facilitates administrative management of TemporalX via a localhost gRPC API

Method Name Request Type Response Type Description
ManageGC ManageGCRequest ManageGCResponse ManageGC is used to manage TemporalX's garbage collection process
RefCount RefCountRequest RefCountResponse RefCount is used to analyze the counter store and pull reference count information

Top

file.proto

Blob

Blob is a chunk of binary data

Field Type Label Description
content bytes   content is the actual binary data contained in this message
rangeStart uint64   Range start and end mirrors developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range. If both is zero, the blobs streams contents of the file from start to finish. The unit of range is alway in bytes. Currently, DownloadResponse support blob range.
rangeEnd uint64    

DownloadRequest

DownloadRequest is used to download a UnixFS object although it can in theory be used with other type of objects there may be some undefined behavior

Field Type Label Description
hash string   hash is the ipfs hash/cid (content identifier) of the data to download
chunkSize int32   chunkSize specifies the size of chunks to be sent to the client it allows us to efficiently control incoming data amounts which is useful on machines with low-memory
rangeStart uint64   Range start and end mirrors developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range. If both is none zero, only data within range is requested. The unit of range is alway in bytes. If used, please check the returned range values in blobs to make sure this feature is supported.
rangeEnd uint64    

DownloadResponse

DownloadResponse contains the response to a download request which allows the gRPC server to stream blobs to the client

Field Type Label Description
blob Blob   blob is a single chunk of data

UploadOptions

UploadOptions allows controlling the parameters of a file upload

Field Type Label Description
multiHash string   specifes the multihash function to use
layout string   specifies the dag layout (balanced, tricklet)
chunker string   specifies the chunker type (rabin, default, etc…)

UploadRequest

UploadRequest is used to upload data as a UnixFS object

Field Type Label Description
blob Blob   blob is a single chunk of data
options UploadOptions   options allows setting the optoins for this upload

FileAPI

FileAPI provides a gRPC api to upload/download files as UnixFS objects

Method Name Request Type Response Type Description
UploadFile UploadRequest stream PutResponse UploadFile allows uploading a file as a UnixFS object (equivalent to ipfs add)
DownloadFile DownloadRequest DownloadResponse stream DownloadFile allows downloading a UnixFS object (equivalent to ipfs get)

Top

namesys.proto

NameSysPublishRequest

NameSysPublishRequest is used to publish a value

Field Type Label Description
privateKey bytes   the private key (name) for this record
value string   the value of this record
eol int32   the eol for this publish, if 0 implies as NameSys::Publish call, if non 0 implies a NameSys:PublishWithEOL call
ttl int32   if set, allows us to override default ttl value of ipns records

NameSysResolveRequest

NameSysResolveRequest is used to resolve an IPNS name

Field Type Label Description
name string   the name to resolve
depth uint32   recursion depth limit
dhtRecordCount uint32   number of ipns records to retrieve before selecting the best record
dhtTimeout int32   the amount of time to wait for records to be fetched and verified

NameSysResolveResult

NameSysResolveRequest is an answer to a resolve request

Field Type Label Description
path string   the path that was resolved
error string   an error if any

NameSysAPI

NameSysAPI provides a generic name resolution API

Method Name Request Type Response Type Description
NameSysResolve NameSysResolveRequest NameSysResolveResult NameSysResolve is used to resolve a name, waiting for the request to complete
NameSysResolveAsync NameSysResolveRequest NameSysResolveResult stream NameSysResolveAsync is like Resolve, except instead of waiting for the request to complete, we send back a stream which we will send the result on
NameSysPublish NameSysPublishRequest Empty NameSysPublish is used to publish an IPNS record, with/with-out an EOL

Top

node.proto

Block

Field Type Label Description
cid string   cid is the identifier of the block
data bytes   data is the actual contents of the block
size int64   size of the block, only filled out by BS_GET_STATS since if we just want stats, we dont want to retrieve all the data.

BlockstoreRequest

BlockstoreRequest is a message used to control blockstores

Field Type Label Description
requestType BSREQTYPE   indicates the particular request type being made
reqOpts BSREQOPTS repeated optional request settings
cids string repeated cids of blocks sent by: BS_DELETE, BS_GET, BS_GET_MANY, BS_GET_STATS
data bytes repeated the data we are putting sent by: BS_PUT, BS_PUT_MANY
cidVersion string   the cid version to use when constructing blocks, default is v1 sent by: BS_PUT, BS_PUT_MANY
hashFunc string   the hash function to use when constructing blocks, default is sha2-256 sent by: BS_PUT, BS_PUT_MANY

BlockstoreResponse

BlockstoreResponse is a response to a BlockstoreqRequest

Field Type Label Description
requestType BSREQTYPE   indicates the particular request type being made
blocks Block repeated a copy of blocks from the blockstore sent by: BS_PUT, BS_PUT_MANY, BS_GET, BS_GET_MANY, BS_GET_STATS, BS_GET_ALL

in the case of BS_PUT, and BS_PUT_MANY requests the data field will be empty as this is only populated by get requests

in the case of BS_GET_STATS only the cid, and size params will be filled out, since we are just interested in the size

ConnMgmtRequest

Field Type Label Description
requestType CONNMGMTREQTYPE   indicates the particular connection management request being performed
multiAddrs string repeated a list of multiaddrs sent by: CM_CONNECT
peerIDs string repeated a list of peer IDs sent by: CM_DISCONNECT, CM_STATUS, CM_GET_PEERS

ConnMgmtResponse

Field Type Label Description
requestType CONNMGMTREQTYPE   indicates the particular connection management request being performed
connected ConnMgmtResponse.ConnectedEntry repeated  
status ConnMgmtResponse.StatusEntry repeated a map of the peer id, and a custom message indicating success, or why there was a failure
peerIDs string repeated  

ConnMgmtResponse.ConnectedEntry

Field Type Label Description
key string    
value bool    

ConnMgmtResponse.StatusEntry

Field Type Label Description
key string    
value ConnMgmtStatus    

ConnMgmtStatus

Contains status information about a particular disconnect attempt

Field Type Label Description
disconnected bool   indicate whether or not we actually disconnected
reason string   if disconnected is false, the reason why it is false

DagRequest

Used to submit a request to Dag or DagStream RPCs

Field Type Label Description
requestType DAGREQTYPE   indicates the request being performed sent by: all request types
data bytes   data that we will be storing sent by: DAG_PUT, DAG_NEW_NODE
objectEncoding string   the object encoding type (raw, cbor, protobuf, etc…) sent by: DAG_PUT
serializationFormat string   the serialization format (raw, cbor, protobuf, etc…) sent by: DAG_PUT
hashFunc string   the hash function to to use (sha2-256, sha3-512, etc…) sent by: DAG_PUT, DAG_NEW_NODE, DAG_ADD_LINKS
cidVersion int64   the cid version to use (0, 1) sent by: DAG_PUT, DAG_NEW_NODE
hash string   the hash of the object we are processing sent by: DAG_GET, DAG_NEW_NODe, DAG_ADD_LINKS, DAG_GET_LINKS
links DagRequest.LinksEntry repeated indicates links and their names. key = name, value = link hash sent by: DAG_NEW_NODE, DAG_ADD_LINKS

DagRequest.LinksEntry

Field Type Label Description
key string    
value string    

DagResponse

Used in response to a Dag or DagStream RPC

Field Type Label Description
requestType DAGREQTYPE   indicates the request being performed sent by: all request types
hashes string repeated returns the hashes of newly generated IPLD objects sent by: DAG_PUT, DAG_NEW_NODE, DAG_ADD_LINKS, DAG_GET_LINKS
rawData bytes   the actual data contained by the IPLD object sent by: DAG_GET
links IPLDLink repeated the links contained within an IPLD node object sent by: DAG_GET_LINKS
nodeStats DagResponse.NodeStatsEntry repeated maps ipld cids to a ipld.NodeStat object equivalent sent by: DAG_STAT

DagResponse.NodeStatsEntry

Field Type Label Description
key string    
value IPLDStat    

ExtrasRequest

Field Type Label Description
requestType EXTRASREQTYPE   indicates the request being performed
extrasFeature EXTRASTYPE   indicates the extras feature this request applies to

GetPeersResponse

GetPeersResponse is a response to GetPeers containing a slice of peer IDs

Field Type Label Description
peerIDs string repeated a slice of peer IDs

An IPFS MerkleDAG Link

Field Type Label Description
hash bytes   multihash of the target object
name string   utf string name. should be unique per object
size uint64   cumulative size of target object

IPLDNode

An IPFS MerkleDAG Node

Field Type Label Description
links IPLDLink repeated refs to other objects
data bytes   opaque user data

IPLDStat

IPLDStat is statistics about an individual dag node it is a protocol buffer wrapper around ipld.NodeStat

Field Type Label Description
numLinks int64   number of links in link table
blockSize int64   size of the raw, encoded data
linkSize int64   size of the links segment
cumulativeSize int64   cumulative size of object and its references
dataSize int64   size of the data segment

KeystoreRequest

Used to submit a request to Keystore RPC

Field Type Label Description
requestType KSREQTYPE   indicates the request type being performed
name string   name of the key the request is for sent by: KS_HAS, KS_GET, KS_PUT, KS_DELETE
privateKey bytes   the actual private key bytes sent by: KS_PUT

KeystoreResponse

Used in response to a Keystore RPC

Field Type Label Description
requestType KSREQTYPE   indicates the request type being performed
privateKey bytes   the private key bytes sent by: KS_GET
keyNames string repeated contains all known key names sent by: KS_LIST
has bool   indicates if we have the key in our keystore sent by: KS_HAS

P2PLsInfo

P2PLsInfo contains information about a single p2p stream

Field Type Label Description
protocolName string    
listenAddress string    
targetAddress string    
local bool   indicates whether or not this is a p2p listener or local listener

P2PRequest

P2PRequest is a request message holding the details of a particular P2P rpc call

Field Type Label Description
requestType P2PREQTYPE   indicates the request type
all bool   used by: P2PREQTYPE.CLOSE
verbose bool   used by: P2PREQTYPE.LS
protocolName string   used by: P2PREQTYPE.CLOSE, P2PREQTYPE.FORWARD, P2PREQTYPE.LISTEN
listenAddress string   used by: P2PREQTYPE.CLOSE, P2PREQTYPE.FORWARD must be specified as a multiaddr
targetAddress string   used by: P2PREQTYPE.CLOSE, P2PREQTYPE.FORWARD must be specified as a multiaddr
remoteAddress string   used by: P2PREQTYPE.LISTEN must be specified as a multiaddr
allowCustomProtocols bool   used by: P2PREQTYPE.LISTEN, P2PREQTYPE.FORWARD
reportPeerID bool   used by: P2PREQTYPE.LISTEN

P2PResponse

P2PResponse is a response message sent in response to a P2PRequest message

Field Type Label Description
requestType P2PREQTYPE    
names string repeated sent by: P2PREQTYPE.LISTEN
connsClosed int32   sent by: P2PREQTYPE.CLOSE to indicate the number of connections closed
streamInfos P2PLsInfo repeated sent by: P2PREQTYPE.LS and contains all known stream information

PersistRequest

Field Type Label Description
cids string repeated cids to persist locally

PersistResponse

Field Type Label Description
status PersistResponse.StatusEntry repeated key = cid, value = whether or not it was persisted
errors PersistResponse.ErrorsEntry repeated key = cid, value = error if not persisted

PersistResponse.ErrorsEntry

Field Type Label Description
key string    
value string    

PersistResponse.StatusEntry

Field Type Label Description
key string    
value bool    

BSREQOPTS

BSREQOPTS are options for blockstore requests

Name Number Description
DEFAULT 0 DEFAULT indicates to use the default settings
BS_FORCE 1 BS_FORCE indicates to force the request regardless of any possible issues

BSREQTYPE

BSREQTYPE is a particular blockstore request type

Name Number Description
BS_DELETE 0 BS_DELETE is used to delete a block from the store
BS_PUT 1 BS_PUT is used to put a single block in the store
BS_PUT_MANY 2 BS_PUT_MANY is used to put many blocks in the store
BS_GET 3 BS_GET is used to get a block from the store
BS_GET_MANY 4 BS_GET_MANY is used to get many blocks from the store
BS_GET_ALL 5 BS_GET_ALL is used to retrieve all blocks from the store It is the gRPC equivalent of Blockstore::AllKeysChan
BS_GET_STATS 6 BS_GET_STATS is used to retrieve statistics about individual blocks
BS_HAS 7 BS_HAS is used to retrieve whether or not we have the block
BS_HASH_ON_READ_ENABLE 8 BS_HASH_ON_READ_ENABLE is used to enable hash on read
BS_HASH_ON_READ_DISABLE 9 BS_HASH_ON_READ_DISABLE is used to disable hash on read

CONNMGMTREQTYPE

CONNMGMTREQTYPE indicates the particular ConnMgmt request being performed

Name Number Description
CM_CONNECT 0 CM_CONNECT is used to connect to a libp2p peer
CM_DISCONNECT 1 CM_DISCONNECT is used to disconnect from a libp2p peer
CM_STATUS 2 CM_STATUS is used to return status information about libp2p peer connections useful for determining whether or not we are connected to someone
CM_GET_PEERS 3 CM_GET_PEERS is used to return all known peers

DAGREQTYPE

DAGREQTYPE indicates the particular DagAPI request being performed

Name Number Description
DAG_PUT 0 DAG_PUT is used to add new IPLD objects
DAG_GET 1 DAG_GET is used to retrieve IPLD object data
DAG_NEW_NODE 2 DAG_NEW_NODE is used to create a new IPLD node object
DAG_ADD_LINKS 3 DAG_ADD_LINKS is used to add links to an IPLD node object
DAG_GET_LINKS 4 DAG_GET_LINKS is used to retrieve all links contained in an IPLD node object
DAG_STAT 5 DAG_STAT is used to retrieve ipld.NodeStats information

EXTRASREQTYPE

EXTRASREQTYPE indicates the particular Extras request being performed

Name Number Description
EX_ENABLE 0 EX_ENABLE is used to enable a particular node extras feature
EX_DISABLE 1 EX_DISABLE is used to disable a particular node extras feature

EXTRASTYPE

EXTRASTYPE denotes a particular extras type

Name Number Description
IDENTIFY 0 IDENTIFY is the identify service
PUBSUB 1 PUBSUB is the libp2p pubsub system
DISCOVERY 2 DISCOVERY is a libp2p discovery service
MDNS 3 MDNS is used to discover libp2p hosts over mdns

KSREQTYPE

KSREQTYPE indicates the particular KeystoreAPI request being performed

Name Number Description
KS_HAS 0 KS_HAS is used to check if the key exists in our keystore
KS_GET 1 KS_GET is used to retrieve private key bytes from our keystore
KS_PUT 2 KS_PUT is used to store private key bytes in our keystore
KS_DELETE 3 KS_DELETE is used to delete private keys from our keystore
KS_LIST 4 KS_LIST is used to list all keys in our keystore by their name

P2PREQTYPE

P2PREQTYPE denotes the particular type of request being used in the p2p rpc

Name Number Description
CLOSE 0 equivalent of ipfs p2p close
FORWARD 1 equivalent of ipfs p2p forward
LISTEN 2 equivalent of ipfs p2p listen
LS 3 equivalent of ipfs p2p ls

NodeAPI

NodeAPI provide an API to control the underlying custom ipfs node

Method Name Request Type Response Type Description
ConnMgmt ConnMgmtRequest ConnMgmtResponse ConnMgmt provides control over libp2p connections
Extras ExtrasRequest Empty Extras provide control over node extras capabilities
P2P P2PRequest P2PResponse P2P allows control of generalized p2p streams for tcp/udp based protocol. By using this RPC, we can tunnel traffic similar to ssh tunneling except using libp2p as the transport layer, and and tcp/udp port.
Blockstore BlockstoreRequest BlockstoreResponse Blockstore allows low-level management of the underlying blockstore
BlockstoreStream BlockstoreRequest stream BlockstoreResponse stream BlockstoreStream is akin to Blockstore, except streamable Once v4 is out, condense this + blockstore into a single call
Dag DagRequest DagResponse Dag is a unidirectional rpc allowing manipulation of low-level ipld objects
Keystore KeystoreRequest KeystoreResponse Keystore is a unidirectional RPC allowing management of ipfs keystores
Persist PersistRequest PersistResponse Persist is used to retrieve data from the network and make it available locally

Top

pubsub.proto

PubSubMessage

Field Type Label Description
from bytes   who this message is from
data bytes   the data of this message
seqno bytes   the sequence number of this message
topicIDs string repeated the topic IDs this message is sent to
signature bytes   the signature of the sender
key bytes   the key of the sender

PubSubPeer

represents an individual pubsub peer

Field Type Label Description
topic string   the topic this peer belongs to
peerID string   the id of this peer

PubSubRequest

Field Type Label Description
requestType PSREQTYPE   indicates the particular PubSubAPI request being performed
topics string repeated topics to request peers from, or publish data to sent by: PS_LIST_PEERS, PS_SUBSCRIBE, PS_PUBLISH
data bytes   data to sent to topics sent by: PS_PUBLISH

PubSubResponse

Field Type Label Description
requestType PSREQTYPE   indicates the particular PubSubAPI request being performed
message PubSubMessage repeated messages we have received from a topic sent by: PS_SUBSCRIBE
topics string repeated topic names sent by: PS_GET_TOPICS
peers PubSubPeer repeated pubsub peers sent by: PS_LIST_PEERS

PSREQTYPE

PSREQTYPE indicates the particular PubSubAPI request being performed

Name Number Description
PS_GET_TOPICS 0 PS_GET_TOPICS is used to return a list of subscribed pubsub topics
PS_LIST_PEERS 1 PS_LIST_PEERS is used to return a list of peers subscribed to topics we are subscribed to
PS_SUBSCRIBE 2 PS_SUBSCRIBE is used to establish a persistent subscription to a pubsub topic
PS_PUBLISH 3 PS_PUBLISH is used to publisbh a message to a pubsub topic

PubSubAPI

PubSubAPI provides a libp2p pubsub API and is equivalent to go-ipfs ipfs pubsub subset of commands.

Method Name Request Type Response Type Description
PubSub PubSubRequest stream PubSubResponse stream PubSub allows controlling libp2p pubsub topics and subscriptions using a bidirectional streaming API

Top

replication.proto

AddrInfo

AddrInfo can be used to ID and locate a server (see also libp2p/go-libp2p-core/peer#AddrInfo)

Field Type Label Description
id_bytes bytes   id_bytes is a libp2p peer identity. It is used to verity the Peer's public key. Please use helper functions GetID and SetID for this field
addrs_bytes bytes repeated addrBytes are bytes of Multiaddr for locating this peer. Please use helper functions GetMultiAddrs, and SetMultiAddrs for this field.
grpc_port int32   grpc port for replication protocol. will be optional once grpc is integrated into multistream.

Replication

Replication message is a signable data structure to represent a replication scheme

Field Type Label Description
header string   Header must be "rtrade-replication v0…" for development stage, this is a required security header. - Avoid collision from other signed data. - Allow future versions to require different validation rules. Any signer must understand every header tag to sign documents.
cids_bytes bytes repeated CIDs is the list of contents to replicate. Please use helper functions GetCIDs and AddCIDs for this field
servers ServerSource repeated Servers list the candidate severs to replicate to, in the order of preference.
replication_factor int32   replication_factor is the number of replications desired.
refresh_interval_seconds int32   refresh_interval_seconds is the suggested number of seconds to wait before checking if a remote server is up. The first check should be random from 0 to refresh_interval_seconds. Each replicator can have it's own max_interval. A sensible default value should be used if it is 0.
server_down_delay_seconds int32   server_down_delay_seconds is the number of seconds to wait after a server is down before the next reserved server is requested to be active. A sensible default value should be used if it is 0.

ReplicationStatus

Field Type Label Description
ok bool   ok report success for action submitted
is_active bool   is_active report if the replication is currently active on this server
current_version int64   current_version is the highest version this replicator/server has locally.
target_version int64   target_version is the highest version this replicator/server knows about and can verify to exist.

ServerSource

ServerSource is a list of one or more servers. TODO: add field to allow referring to a list of servers from another file.

Field Type Label Description
addr_info AddrInfo    

SignedSubscription

Field Type Label Description
sub_part Subscription    
update_part SubscriptionUpdate    

Subscription

Field Type Label Description
topic string    
author_id_bytes bytes    
remove bool   if true, remove this Subscription. For replicator.Add, deactive this replication. For replicator.WaitForUpdates, stop reporting updates.

SubscriptionUpdate

Field Type Label Description      
version int64   strictly increasing version number      
replication_bytes bytes   replication file is in bytes for signing      
signature bytes   signature signs the Subscription and above data in length delimited form in the order topic author version replication

replicator

The replicator provides replication services.

Method Name Request Type Response Type Description
Add Subscription ReplicationStatus stream Add is used to add a replication to this server, changing it's status from reserved to active.
Status Subscription ReplicationStatus stream Status returns an updating stream of the replication status on the server.
GetSubscriptionUpdate Subscription SubscriptionUpdate GetSubscriptionUpdate returns the latest version of subscribed replication
SubmitReplication SignedSubscription ReplicationStatus stream SubmitReplication is used by client agents to start replications, after they have uploaded the files and retrieved the cid, and collected servers to replicate too.

Top

status.proto

StatusResponse

StatusResponse is used to return API status information

Field Type Label Description
host string   host is an identifier for the host of the system responding to the request. it may or may not be the hostname, it is up to the implementer of the service to choose what is here
status APISTATUS   status contains a status enum indicating the state of the system

VersionResponse

VersionResponse is used to return API version information

Field Type Label Description
version string   version denotes the github version that was present when the api was built

APISTATUS

APISTATUS is an enum to return a concise description of api status

Name Number Description
ONLINE 0 ONLINE indicates everything is working as expected
PURGING 1 PURGING indicates the system is undergoing data removal a purging system is not available for use unless all other nodes are unavailable
DEGRADED_PERFORMANCE 2 DEGRADED_PERFORMANCE indicates the system is currently under heavy load
ERROR 3 ERROR indicates that the system is currently experiencing an error and should not be used

StatusAPI

provides utilities to retrieve api status information from

Method Name Request Type Response Type Description
Version Empty VersionResponse Version is used to retrieve api version information
Status Empty StatusResponse Status is used to retrieve api status information.

Top

util.proto

Empty

Empty is an empty message

PutResponse

PutResponse is a response to any data storage (put) requests

Field Type Label Description
hash string   hash is hash/cid (content identifier) of the data that was stored

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. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)