Technology · SDK

Protocol definition libraries

GProtocol maintains one protocol definition in five languages: action constants, message structures, error keys and version numbers. Go is the primary source, and the other languages are aligned with it item by item.

LanguagePackageContentsStatus
Gogather-gprotocol/goConstants, message structures, version checks and helper functions such as assembling the text to signUsed by nodes
Dartgather_protocolConstants and types, with JSON serializationUsed by the app
Javatop.gather.protocolConstants and typesDefinitions only
JavaScript@gather-network/gather-protocolConstants, types and message factory functionsDefinitions only
Pythongather_protocolActions and constants, generated automatically from the Go versionDefinitions only

How the five languages stay consistent

  • Before each commit, the action lists, route type annotations and version numbers of all languages are compared automatically.
  • The Python bindings are generated from Go by a script, and a check confirms the generated output has not been edited by hand.
  • Encryption-related formats (mailbox, groups, file credentials, backup, node directory) have shared test vectors, compared byte by byte across Go, Dart and Python.

Reference implementation

The encryption formats for mailbox, groups, file credentials and backup also have a Python reference implementation, used to generate and verify test vectors. The protocol libraries themselves contain no encryption, networking or client implementation.

Open to developers

The protocol definition libraries and third-party developer documentation have not been publicly released yet. Once the plan for opening them is set, we will publish how to get them, and the documentation, here.