swarm-protocol

1.2.1 • Public • Published

Swarm protocol primitives

This package implements the Swarm protocol primitives according to the specification https://gritzko.gitbooks.io/swarm-the-protocol/content/

  • Base64x64 - 64-bit numbers in Base64
  • Stamp - hybrid logical time stamps ([timeStamp, replicaId] pairs)
  • Clock - hybrid clocks (Stamp factory, one replica has one Clock only)
  • Spec - specifiers (compound event/op identifiers)
  • Op - immutable ops (operations, events) that express all mutations
  • VV - version vectors (practically, {replicaId: maxTimeStamp} maps)
  • ImmutableVV - immutable version vector

All classes but VV are immutable. Everything is parsed from a string, serialized to a string (all constructors accept toString() output).

see test/ for API use examples.

Readme

Keywords

none

Package Sidebar

Install

npm i swarm-protocol

Weekly Downloads

6

Version

1.2.1

License

MIT

Last publish

Collaborators

  • gritzko