burrow

module
v0.12.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2016 License: GPL-3.0

README

GoDoc Linux
Master Circle CI
Develop Circle CI (develop)

Eris-DB (Alpha)

eris-db is Eris' blockchain-client. It consists of a Tendermint node wrapped by a simple server. The server allows requests to be made over HTTP - either using JSON-RPC 2.0 or a RESTlike web-api - and websocket (JSON-RPC 2.0). The web-APIs are documented in api.md. We also have javascript bindings for the RPC methods in eris-db.js.

Installation

There are no pre-built releases other than the docker images.

The recommended way of working with eris-db is through eris-cli. See the eris-db documentation for more information.

Building from source
Ubuntu 14.04 (OSX ?)

Make sure you have the proper Go distribution for your OS and architecture. The recommended version is 1.4.2. Follow the instructions on how to set up GOROOT and GOPATH.

You will also need the following libraries: git, libgmp3-dev

On Ubuntu: sudo apt-get install git libgmp3-dev

On Mac: brew install git gmp

Next you pull in the code:

go get github.com/eris-ltd/eris-db/cmd/erisdb

This will build and install the erisdb executable and put it in $GOPATH/bin, which should be on your PATH. If not, then add it.

To run erisdb, just type $ erisdb /path/to/working/folder

This will start the node using the provided folder as working dir. If the path is omitted it defaults to ~/.erisdb

Docker

It is best to use eris-cli which will help setting up and running eris-db (and individual chains) through docker.

Others

Tendermint officially supports only 64 bit Ubuntu.

Usage

####Native

The simplest way to get started is by simply running $ erisdb. That will start a fresh node with ~/.erisdb as the working directory, and the default settings. You will be asked to type in a hostname, which could be anything. anonymous is a commonly used one.

Once the server has started, it will begin syncing up with the network. At that point you may begin using it. The preferred way is through our javascript api, but it is possible to connect directly via HTTP or websocket. The JSON-RPC and web-api reference can be found here.

Configuration

There will be more info on how to set up a private net when this is added to Tendermint. That would include information about the various different fields in config.toml, genesis.json, and priv_validator.json.

server_conf.toml

The server configuration file looks like this:

[bind]
  address= <string>
  port= <number>
[TLS]
  tls= <boolean>
  cert_path= <string>
  key_path= <string>
[CORS]
  enable            <boolean>
  allow_origins     <[]string>
  allow_credentials <boolean>
  allow_methods     <[]string>
  allow_headers     <[]string>
  expose_headers    <[]string>
  max_age           <number>
[HTTP]
  json_rpc_endpoint= <string>
[web_socket]
  websocket_endpoint= <string>
  max_websocket_sessions= <number>
  read_buffer_size = <number>
  write_buffer_size = <number>
[logging]
  console_log_level= <string>
  file_log_level= <string>
  log_file= <string>

NOTE: CORS and TLS are not yet fully implemented, and cannot be used. CORS is implemented through gin middleware, and TLS through the standard Go http package via the graceful library.

Bind
  • address is the address.
  • port is the port number
TLS
  • tls is used to enable/disable TLS
  • cert_path is the absolute path to the certificate file.
  • key_path is the absolute path to the key file.
CORS
  • enable is whether or not the CORS middleware should be added at all.

Details about the other fields and how this is implemented can be found here.

HTTP
  • json_rpc_endpoint is the name of the endpoint used for JSON-RPC (2.0) over HTTP.
web_socket
  • websocket_endpoint is the name of the endpoint that is used to establish a websocket connection.
  • max_websocket_connections is the maximum number of websocket connections that is allowed at the same time.
  • read_buffer_size is the size of the read buffer for each socket in bytes.
  • read_buffer_size is the size of the write buffer for each socket in bytes.
logging
  • console_log_level is the logging level used for the console.
  • file_log_level is the logging level used for the log file.
  • log_file is the path to the log file. Leaving this empty means file logging will not be used.

The possible log levels are these: crit, error, warn, info, debug.

The server log level will override the log level set in the Tendermint config.toml.

example server_conf.toml file
[bind]
address="0.0.0.0"
port=1337
[TLS]
tls=false
cert_path=""
key_path=""
[CORS]
enable=false
allow_origins=[]
allow_credentials=false
allow_methods=[]
allow_headers=[]
expose_headers=[]
max_age=0
[HTTP]
json_rpc_endpoint="/rpc"
[web_socket]
websocket_endpoint="/socketrpc"
max_websocket_sessions=50
read_buffer_size = 4096
write_buffer_size = 4096
[logging]
console_log_level="info"
file_log_level="warn"
log_file=""
Server-server

NOTE: This feature is being deprecated in favor of eris-cli generation of configurable throw-away chains.

The library includes a "server-server". This server accepts POST requests with some chain data (such as priv_validator.json and genesis.json), and will use that to create a new working directory in the temp folder, write the data, deploy a new node in that folder, generate a port, use it to serve that node and then pass the url back in the response. It will also manage all the servers and shut them down as they become inactive.

NOTE: This is not safe in production, as it requires private keys to be passed over a network, but it is useful when doing tests. If the same chain data is used, then each node is guaranteed to give the same output (for the same input) when calling the methods.

To start one up, just run go install in the erisdb/cmd/erisdbss directory, then run erisdbss. It takes no parameters. There are many examples on how to call it in the javascript library, and if people find it useful there will be a tutorial.

Testing

In root: go test ./...

Benchmarking

As of 0.11.0, there are no benchmarks. We aim to have a framework built before 1.0.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/Sirupsen/logrus
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
_workspace/src/github.com/agl/ed25519/edwards25519
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519.
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519.
_workspace/src/github.com/gorilla/websocket
Package websocket implements the WebSocket protocol defined in RFC 6455.
Package websocket implements the WebSocket protocol defined in RFC 6455.
_workspace/src/github.com/gorilla/websocket/examples/autobahn
Command server is a test server for the Autobahn WebSockets Test Suite.
Command server is a test server for the Autobahn WebSockets Test Suite.
_workspace/src/github.com/inconshreveable/log15/stack
Package stack implements utilities to capture, manipulate, and format call stacks.
Package stack implements utilities to capture, manipulate, and format call stacks.
_workspace/src/github.com/mattn/go-isatty
Package isatty implements interface to isatty
Package isatty implements interface to isatty
_workspace/src/github.com/sfreiberg/gotwilio
Package gotwilio is a library for interacting with http://www.twilio.com/ API.
Package gotwilio is a library for interacting with http://www.twilio.com/ API.
_workspace/src/github.com/stretchr/testify/assert
A set of comprehensive testing tools for use with the normal Go testing system.
A set of comprehensive testing tools for use with the normal Go testing system.
_workspace/src/github.com/stretchr/testify/suite
The suite package contains logic for creating testing suite structs and running the methods on those structs as tests.
The suite package contains logic for creating testing suite structs and running the methods on those structs as tests.
_workspace/src/github.com/syndtr/goleveldb/leveldb
Package leveldb provides implementation of LevelDB key/value database.
Package leveldb provides implementation of LevelDB key/value database.
_workspace/src/github.com/syndtr/goleveldb/leveldb/cache
Package cache provides interface and implementation of a cache algorithms.
Package cache provides interface and implementation of a cache algorithms.
_workspace/src/github.com/syndtr/goleveldb/leveldb/comparer
Package comparer provides interface and implementation for ordering sets of data.
Package comparer provides interface and implementation for ordering sets of data.
_workspace/src/github.com/syndtr/goleveldb/leveldb/errors
Package errors provides common error types used throughout leveldb.
Package errors provides common error types used throughout leveldb.
_workspace/src/github.com/syndtr/goleveldb/leveldb/filter
Package filter provides interface and implementation of probabilistic data structure.
Package filter provides interface and implementation of probabilistic data structure.
_workspace/src/github.com/syndtr/goleveldb/leveldb/iterator
Package iterator provides interface and implementation to traverse over contents of a database.
Package iterator provides interface and implementation to traverse over contents of a database.
_workspace/src/github.com/syndtr/goleveldb/leveldb/journal
Package journal reads and writes sequences of journals.
Package journal reads and writes sequences of journals.
_workspace/src/github.com/syndtr/goleveldb/leveldb/memdb
Package memdb provides in-memory key/value database implementation.
Package memdb provides in-memory key/value database implementation.
_workspace/src/github.com/syndtr/goleveldb/leveldb/opt
Package opt provides sets of options used by LevelDB.
Package opt provides sets of options used by LevelDB.
_workspace/src/github.com/syndtr/goleveldb/leveldb/storage
Package storage provides storage abstraction for LevelDB.
Package storage provides storage abstraction for LevelDB.
_workspace/src/github.com/syndtr/goleveldb/leveldb/table
Package table allows read and write sorted key/value.
Package table allows read and write sorted key/value.
_workspace/src/github.com/syndtr/goleveldb/leveldb/util
Package util provides utilities used throughout leveldb.
Package util provides utilities used throughout leveldb.
_workspace/src/github.com/syndtr/gosnappy/snappy
Package snappy implements the snappy block-based compression format.
Package snappy implements the snappy block-based compression format.
_workspace/src/github.com/tendermint/ed25519
Package ed25519 implements the Ed25519 signature algorithm.
Package ed25519 implements the Ed25519 signature algorithm.
_workspace/src/github.com/tendermint/ed25519/edwards25519
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519.
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519.
_workspace/src/github.com/tendermint/flowcontrol
Package flowcontrol provides the tools for monitoring and limiting the transfer rate of an arbitrary data stream.
Package flowcontrol provides the tools for monitoring and limiting the transfer rate of an arbitrary data stream.
Commons for HTTP handling
_workspace/src/github.com/tendermint/log15
Package log15 provides an opinionated, simple toolkit for best-practice logging that is both human and machine readable.
Package log15 provides an opinionated, simple toolkit for best-practice logging that is both human and machine readable.
_workspace/src/github.com/tendermint/log15/stack
Package stack implements utilities to capture, manipulate, and format call stacks.
Package stack implements utilities to capture, manipulate, and format call stacks.
_workspace/src/github.com/tendermint/tendermint/alert
Forked from github.com/SlyMarbo/gmail
Forked from github.com/SlyMarbo/gmail
_workspace/src/github.com/tendermint/tendermint/common
Classical-inheritance-style service declarations.
Classical-inheritance-style service declarations.
_workspace/src/github.com/tendermint/tendermint/p2p
Uses nacl's secret_box to encrypt a net.Conn.
Uses nacl's secret_box to encrypt a net.Conn.
_workspace/src/github.com/tendermint/tendermint/p2p/upnp
Taken from taipei-torrent Just enough UPnP to be able to forward ports
Taken from taipei-torrent Just enough UPnP to be able to forward ports
Commons for HTTP handling
_workspace/src/github.com/tendermint/tendermint/vm/sha3
Package sha3 implements the SHA3 hash algorithm (formerly called Keccak) chosen by NIST in 2012.
Package sha3 implements the SHA3 hash algorithm (formerly called Keccak) chosen by NIST in 2012.
_workspace/src/golang.org/x/crypto/curve25519
Package curve25519 provides an implementation of scalar multiplication on the elliptic curve known as curve25519.
Package curve25519 provides an implementation of scalar multiplication on the elliptic curve known as curve25519.
_workspace/src/golang.org/x/crypto/nacl/box
Package box authenticates and encrypts messages using public-key cryptography.
Package box authenticates and encrypts messages using public-key cryptography.
_workspace/src/golang.org/x/crypto/nacl/secretbox
Package secretbox encrypts and authenticates small messages.
Package secretbox encrypts and authenticates small messages.
_workspace/src/golang.org/x/crypto/poly1305
Package poly1305 implements Poly1305 one-time message authentication code as specified in http://cr.yp.to/mac/poly1305-20050329.pdf.
Package poly1305 implements Poly1305 one-time message authentication code as specified in http://cr.yp.to/mac/poly1305-20050329.pdf.
_workspace/src/golang.org/x/crypto/ripemd160
Package ripemd160 implements the RIPEMD-160 hash algorithm.
Package ripemd160 implements the RIPEMD-160 hash algorithm.
_workspace/src/golang.org/x/crypto/salsa20/salsa
Package salsa provides low-level access to functions in the Salsa family.
Package salsa provides low-level access to functions in the Salsa family.
_workspace/src/golang.org/x/net/context
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
_workspace/src/golang.org/x/net/context/ctxhttp
Package ctxhttp provides helper functions for performing context-aware HTTP requests.
Package ctxhttp provides helper functions for performing context-aware HTTP requests.
_workspace/src/golang.org/x/net/netutil
Package netutil provides network utility functions, complementing the more common ones in the net package.
Package netutil provides network utility functions, complementing the more common ones in the net package.
_workspace/src/golang.org/x/sys/unix
Package unix contains an interface to the low-level operating system primitives.
Package unix contains an interface to the low-level operating system primitives.
_workspace/src/gopkg.in/bluesuncorp/validator.v5
Package validator implements value validations for structs and individual fields based on tags.
Package validator implements value validations for structs and individual fields based on tags.
_workspace/src/gopkg.in/fatih/set.v0
Package set provides both threadsafe and non-threadsafe implementations of a generic set data structure.
Package set provides both threadsafe and non-threadsafe implementations of a generic set data structure.
Websocket client implementation.
Websocket client implementation.
cmd
The erisdb package contains tendermint-specific services that goes with the server.
The erisdb package contains tendermint-specific services that goes with the server.
pipe
The pipe is used to call methods on the Tendermint node.
The pipe is used to call methods on the Tendermint node.
Cross-platform file utils.
Cross-platform file utils.
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL