Ethan Buchman 83920a1c37 | 8 years ago | |
---|---|---|
client | 8 years ago | |
cmd | 8 years ago | |
example | 8 years ago | |
server | 8 years ago | |
tests | 8 years ago | |
testutil | 9 years ago | |
types | 9 years ago | |
.gitignore | 9 years ago | |
LICENSE | 9 years ago | |
Makefile | 8 years ago | |
README.md | 8 years ago | |
circle.yml | 8 years ago |
Blockchains are a system for creating shared multi-master application state. TMSP is a socket protocol enabling a blockchain consensus engine, running in one process, to manage a blockchain application state, running in another.
For more information on TMSP, motivations, and tutorials, please visit our blog post.
Other implementations:
This repository holds a number of important pieces:
types/types.proto
protoc --go_out=plugins=grpc:. types.proto
in the types
dir to generate the types/types.pb.go
fileprotoc --help
and the grpc docs for examples and details of other languagesgolang implementation of TMSP client and server
cmd/tmsp-cli
tmsp-cli --version
to get the TMSP versionexamples:
cmd/counter
application, which illustrates nonce checking in txscmd/dummy
application, which illustrates a simple key-value merkle treeSince this is a streaming protocol, all messages are encoded with a length-prefix followed by the message encoded in Protobuf3. Protobuf3 doesn't have an official length-prefix standard, so we use our own. The first byte represents the length of the big-endian encoded length.
For example, if the Protobuf3 encoded TMSP message is 0xDEADBEEF
(4 bytes), the length-prefixed message is 0x0104DEADBEEF
. If the Protobuf3 encoded TMSP message is 65535 bytes long, the length-prefixed message would be like 0x02FFFF...
.
Note this prefixing does not apply for grpc.
TMSP requests/responses are simple Protobuf messages. Check out the schema file.
Data ([]byte)
: The request transaction bytesCode (uint32)
: Response codeData ([]byte)
: Result bytes, if anyLog (string)
: Debug or error messageData ([]byte)
: The request transaction bytesCode (uint32)
: Response codeData ([]byte)
: Result bytes, if anyLog (string)
: Debug or error messageCommit
or BeginBlock
,
to allow for dependent sequences of transactions in the same block.Data ([]byte)
: The Merkle root hashLog (string)
: Debug or error messageData ([]byte)
: The query request bytesCode (uint32)
: Response codeData ([]byte)
: The query response bytesLog (string)
: Debug or error messagetypes.Application
need not implement this message -- it's handled by the project.Data ([]byte)
: The info bytesKey (string)
: Key to setValue (string)
: Value to set for keyLog (string)
: Debug or error messageValidators ([]Validator)
: Initial genesis validatorsHeight (uint64)
: The block height that is startingHeight (uint64)
: The block height that endedValidators ([]Validator)
: Changed validators with new voting powers (0 to remove)