• This repository has been archived on 15/Jul/2018
  • Stars
    star
    254
  • Rank 160,264 (Top 4 %)
  • Language
    Go
  • License
    Other
  • Created about 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DEPRECATED: Merged into https://github.com/tendermint/tendermint under `abci`

Application BlockChain Interface (ABCI)

CircleCI

Blockchains are systems for multi-master state machine replication. ABCI is an interface that defines the boundary between the replication engine (the blockchain), and the state machine (the application). Using a socket protocol, a consensus engine running in one process can manage an application state running in another.

Previously, the ABCI was referred to as TMSP.

The community has provided a number of addtional implementations, see the Tendermint Ecosystem

Specification

A detailed description of the ABCI methods and message types is contained in:

For more background information on ABCI, motivations, and tendermint, please visit the documentation. The two guides to focus on are the Application Development Guide and Using ABCI-CLI.

Protocl Buffers

To compile the protobuf file, run:

make protoc

See protoc --help and the Protocol Buffers site for details on compiling for other languages. Note we also include a GRPC service definition.

Install ABCI-CLI

The abci-cli is a simple tool for debugging ABCI servers and running some example apps. To install it:

go get github.com/tendermint/abci
cd $GOPATH/src/github.com/tendermint/abci
make get_vendor_deps
make install

Implementation

We provide three implementations of the ABCI in Go:

  • Golang in-process
  • ABCI-socket
  • GRPC

Note the GRPC version is maintained primarily to simplify onboarding and prototyping and is not receiving the same attention to security and performance as the others

In Process

The simplest implementation just uses function calls within Go. This means ABCI applications written in Golang can be compiled with TendermintCore and run as a single binary.

See the examples below for more information.

Socket (TSP)

ABCI is best implemented as a streaming protocol. The socket implementation provides for asynchronous, ordered message passing over unix or tcp. Messages are serialized using Protobuf3 and length-prefixed with a signed Varint

For example, if the Protobuf3 encoded ABCI message is 0xDEADBEEF (4 bytes), the length-prefixed message is 0x08DEADBEEF, since 0x08 is the signed varint encoding of 4. If the Protobuf3 encoded ABCI message is 65535 bytes long, the length-prefixed message would be like 0xFEFF07....

Note the benefit of using this varint encoding over the old version (where integers were encoded as <len of len><big endian len> is that it is the standard way to encode integers in Protobuf. It is also generally shorter.

GRPC

GRPC is an rpc framework native to Protocol Buffers with support in many languages. Implementing the ABCI using GRPC can allow for faster prototyping, but is expected to be much slower than the ordered, asynchronous socket protocol. The implementation has also not received as much testing or review.

Note the length-prefixing used in the socket implementation does not apply for GRPC.

Usage

The abci-cli tool wraps an ABCI client and can be used for probing/testing an ABCI server. For instance, abci-cli test will run a test sequence against a listening server running the Counter application (see below). It can also be used to run some example applications. See the documentation for more details.

Examples

Check out the variety of example applications in the example directory. It also contains the code refered to by the counter and kvstore apps; these apps come built into the abci-cli binary.

Counter

The abci-cli counter application illustrates nonce checking in transactions. It's code looks like:

func cmdCounter(cmd *cobra.Command, args []string) error {

	app := counter.NewCounterApplication(flagSerial)

	logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))

	// Start the listener
	srv, err := server.NewServer(flagAddrC, flagAbci, app)
	if err != nil {
		return err
	}
	srv.SetLogger(logger.With("module", "abci-server"))
	if err := srv.Start(); err != nil {
		return err
	}

	// Wait forever
	cmn.TrapSignal(func() {
		// Cleanup
		srv.Stop()
	})
	return nil
}

and can be found in this file.

kvstore

The abci-cli kvstore application, which illustrates a simple key-value Merkle tree

func cmdKVStore(cmd *cobra.Command, args []string) error {
	logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))

	// Create the application - in memory or persisted to disk
	var app types.Application
	if flagPersist == "" {
		app = kvstore.NewKVStoreApplication()
	} else {
		app = kvstore.NewPersistentKVStoreApplication(flagPersist)
		app.(*kvstore.PersistentKVStoreApplication).SetLogger(logger.With("module", "kvstore"))
	}

	// Start the listener
	srv, err := server.NewServer(flagAddrD, flagAbci, app)
	if err != nil {
		return err
	}
	srv.SetLogger(logger.With("module", "abci-server"))
	if err := srv.Start(); err != nil {
		return err
	}

	// Wait forever
	cmn.TrapSignal(func() {
		// Cleanup
		srv.Stop()
	})
	return nil
}

More Repositories

1

tendermint

⟁ Tendermint Core (BFT Consensus) in Go
Go
5,705
star
2

go-amino

Protobuf3 with Interface support - Designed for blockchains (deterministic, upgradeable, fast, and compact)
Go
259
star
3

signatory

Multi-provider digital signature library for Rust
Rust
141
star
4

tmkms

Key Management service for Tendermint Validator nodes
Rust
140
star
5

liquidity

Cosmos SDK Liquidity module
Go
136
star
6

spec

TeX
130
star
7

go-p2p

DEPRECATED (moved to tendermint/tendermint): Golang P2P library
Go
121
star
8

rust-abci

A rust implementation of the ABCI protocol for tendermint core
Rust
116
star
9

spn

A blockchain to launch blockchains.
Go
112
star
10

awesome

Collection of resources for all things Tendermint
97
star
11

tm-db

Common database interface for various database backends for Tendermint Core and Cosmos SDK
Go
89
star
12

js-abci

Javascript ABCI libraries
JavaScript
87
star
13

yubihsm-rs

Pure Rust client for YubiHSM2 devices
70
star
14

dex-demo

DeX Demo
HTML
48
star
15

clearchain

Cosmos app for clearing and settlements
Go
47
star
16

merkleeyes

DEPRECATED: Merkle-ized data store
Go
46
star
17

tmlibs

DEPRECATED: Merged into https://github.com/tendermint/tendermint under `libs`
Go
45
star
18

basecoin

DEPRECATED: see https://github.com/cosmos/cosmos-sdk
Go
44
star
19

go-crypto

DEPRECATED: Merged into https://github.com/tendermint/tendermint under `crypto`
Go
44
star
20

cns

Chain Name System
Go
39
star
21

tools

DEPRECATED: Merged into https://github.com/tendermint/tendermint under `tools`
Go
38
star
22

faucet

A faucet for cosmos-sdk apps that uses the app binary only
Go
30
star
23

sig

A signing library for Cosmos.
TypeScript
29
star
24

tendermint2

Tendermint2
Go
29
star
25

atom_one

ATOM ONE CONSTITUTION
27
star
26

amino_rs

Rust implementation of Amino
Rust
26
star
27

cosmos-rosetta-gateway

Rosetta Libraries for Cosmos SDK apps
Go
24
star
28

flutter

Dart
23
star
29

fundraising

Go
22
star
30

budget

Budget is a Cosmos SDK module that implements budget functionality.
Go
21
star
31

farming

Farming is a Cosmos SDK module that implements farming functionality
Go
20
star
32

cosmos-ui

UI component library
Vue
18
star
33

testnets

Config files for connecting to testnets
Python
17
star
34

governmint

DEPRECATED: TMSP Governance App
Go
17
star
35

light-client

DEPRECATED: A light client for tendermint, supporting signatures, proofs, and validation (see github.com/tendermint/tendermint/lite)
Go
17
star
36

coding

Shell
14
star
37

interchange

Interchain Exchange Module
TypeScript
14
star
38

basecoin-examples

DEPRECATED: Example code, showing how you can build your own cryptocurrency on top of basecoin
Go
10
star
39

nomnomcoin

DEPRECATED: A TMSP cryptocurrency in NodeJS
JavaScript
9
star
40

ecosystem

Tendermint forks geneology and directory
9
star
41

classic

canonical blockchain infrastructure
Go
8
star
42

dither

Decentralized messaging for all Cosmos blockchains
7
star
43

alpha

Tiny web app to help you form a genesis file
Go
6
star
44

networks

Deploying and testing Tendermint networks
Go
6
star
45

network_testing

DEPRECATED: Benchmarking tendermint networks
Shell
6
star
46

ledger-validator-app

C
5
star
47

fault-tolerance-demo

DEPRECATED: A demo of tendermint's fault tolerance
Shell
4
star
48

homebrew-tendermint

Homebrew Tap for Tendermint, Ethermint, Basecoin and all related projects.
Ruby
4
star
49

images

Shell
4
star
50

docs

Docs deployment
3
star
51

spm

Go
3
star
52

devdoc

Docker environment for development
Makefile
3
star
53

backend

Backend stuff for design
JavaScript
3
star
54

go-amino-x

Go
3
star
55

js-wire

Javascript library for go-wire codec
JavaScript
2
star
56

go-process

DEPRECATED (moved to tendermint/tmlibs): Process libraries for Golang
Go
2
star
57

identity

Identity and authentication for the blockchain. Public domain work.
2
star
58

js-merkleeyes

DEPRECATED: Javascript library for MerkleEyes
JavaScript
1
star
59

go-alert

DEPRECATED (moved to tendermint/tmlibs)
Go
1
star
60

belt

A utility belt for TypeScript + JavaScript.
TypeScript
1
star
61

mintkey

DEPRECATED: Tendermint key management
Go
1
star
62

lunie-ng

Lunie Next Generation
Vue
1
star
63

spm-extras

Additional packages that we can not keep under tendermint/spm because of incompatibilities.
Go
1
star
64

fuzz

Go
1
star
65

homebrew-tap

Homebrew tap for Cosmos
Ruby
1
star
66

go-keys

DEPRECATED (moved to tendermint/go-crypto and tendermint/basecoin): Key manager for tendermint clients
Go
1
star