Coder Social home page Coder Social logo

nexledger / accelerator Goto Github PK

View Code? Open in Web Editor NEW
66.0 13.0 24.0 8.88 MB

Accelerating the transaction processing performance of the enterprise blockchain.

License: Apache License 2.0

Shell 1.23% JavaScript 76.10% Dockerfile 0.26% Go 18.07% Python 1.59% PHP 0.48% HTML 2.26%
nexledger accelerator sds samsung hyperledger caliper fabric blockchain

accelerator's Introduction

Nexledger Accelerator

Nexledger Accelerator is a software component designed to improve the performance of a blockchain network, e.g. Hyperledger Fabric, in terms of transaction throughput. Accelerator enables the blockchain network to deal with explosive transaction requests from applications.

Accelerator receives transactions from clients on behalf of blockchain nodes and provides transaction acceleration in terms of TPS (Transaction Per Second) by classifying, aggregating, and routing the transactions to blockchain network. The current version of Accelerator is compatible with Hyperledger Fabric v1.4.

Getting Started

Prerequisites

  • Go (1.11.0 or greater)
  • Docker (17.06.2-ce or greater)
  • Docker-compose (1.14.0 or greater)

Building Accelerator

Accelerator supports go module for dependency management. To build the executable, please simply execute go build.

$ go build cmd/accelerator.go

Running ping example

The ping example shows how to configure and run Accelerator. The example is placed in In examples/ping.

To bootstrap Fabric network, please run start.sh script. It boots up the Hyperledger Fabric network including install/instantiation of the example chaincode.

$ ./examples/ping/start.sh

To serve requests from clients, Accelerator should be up and running with proper configuration.

$ ./accelerator -f examples/ping/configs/accelerator.yaml

Accelerator is a gRPC server, and the gRPC services are described in protos/accelerator.proto. You may send transactions using examples/ping/ping_test.go that has gRPC client for the ping example.

$  cd examples/ping
$  go test

You can terminate and remove the network by run stop.sh script.

(change dicrectory to root)
$ ./examples/ping/stop.sh

Under the hood

Modifying chaincode

Accelerator aggregates multiple transactions into a batched transaction and submits the batched transaction to the endorsers. Therefore, chaincodes operating with Accelerator should be modified to individually execute aggregated transactions.

contracts/src/ping/ping.go is the example chaincode with simple KV write/read operations. ping.go imports batchutil.go for segregating batched transactions from Accelerator and delegates the invocations to Invoke() in batchutil.go.

func (t *PingPongChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
	fnc := string(stub.GetArgs()[0])
	switch fnc {
	case "ping":
		return Invoke(stub, t.ping)
	case "pong":
		return Invoke(stub, t.pong)
	}
	return shim.Error("Unknown action, check the first argument, must be one of 'insert', 'query'")
}

Configuring Accelerator

Accelerator should be configured with target chaincode functions and corresponding batch configs. The configuration file for ping example is placed at configs/accelerator.yaml

sdk: "examples/ping/configs/accelerator-sdk.yaml"
host: "localhost"
port: 8090
userName: "Admin"
organization: "peerorg1"
batch:
  - type: "execute"
    channelId: "accelerator"
    chaincodeName: "ping"
    fcn: "ping"
    queueSize: 1000
    maxWaitTimeSeconds: 5
    maxBatchItems: 10
  - type: "query"
    channelId: "accelerator"
    chaincodeName: "ping"
    fcn: "pong"
    queueSize: 1000
    maxWaitTimeSeconds: 5
    maxBatchItems: 10
  • sdk: Path to the fabric SDK configuration File
  • host: Host address of Accelerator
  • port: Port number of Accelerator
  • queueSize: The size of the in-memory queue that kept requested transactions until processing.
  • maxWaitTimeSeconds: Maximum waiting time in seconds to create a new batch transaction.
  • maxBatchItems: Maximum number of items for a new batch transaction.

Whitepaper

Whitepaper includes:

  • The key design features of Accelerator enabling high performance enterprise-wide blockchain technology
  • The evaluation results that show the performance improvement of Hyperledger Fabric by Accelerator in practical scenarios
  • The use cases that provide an insight for understanding industrial blockchain platforms

Further Information

For further information please contact Samsung SDS([email protected]).

accelerator's People

Contributors

kslee82 avatar kslee8224 avatar nexledger avatar programingking avatar yoondo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

accelerator's Issues

Error after ./start.sh

After running start.sh in /examples/ping
i struck with this below error:
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode with name 'ping' already exists
/home/dinesh/Desktop/accelerator

I even tried restarting (./stop.sh and then ./start.sh ) but facing the same error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.