Coder Social home page Coder Social logo

decodeproject / sawtooth-tp-zenroom Goto Github PK

View Code? Open in Web Editor NEW
0.0 16.0 0.0 67 KB

Transaction processor using Zenroom for the Sawtooth Hyperledger blockchain

Dockerfile 1.34% Python 92.32% Shell 6.33%
blockchain sawtooth hyperledger dyne crypto

sawtooth-tp-zenroom's Introduction

Zenroom-TP (Transaction Processor) for the Hyperledger Sawtooth blockchain

This repository integrates the Zenroom VM to be used as a transaction processor in the Sawtooth blockchain distributed by the Linux Foundation's Hyperledger consortium.

To facilitate the creation of transaction families based on Zenroom and the Zencode human-friendly language for smart-contracts, this TP uses the Sawtooth SDK in Python and the zenroom-py bindings.

Getting started

After reading Sawtooth's documentation and understanding its architecture and operational underpinnings, one can start playing around with this transaction processor simply using Docker. ย 

There is a script xec.sh which can be used to operate docker compose. This will create a network with the following containers:

docker-compose service Container name purpose
validator sawtooth-validator Main "node" of the blockchain which executes and validates transactions
rest-api rest-api Provides a http / json adaptor over the zeromq protocol to allow clients to talk to the validator from within and also from the host machine
shell sawtooth-shell-default Provides a container with various commands in it which allows you to connect to the rest api from within the docker network
settings-tp settings-tp A standard transaction processor that allows settings to be configured in the blockchainsd

To start a local instance of Sawtooth using the devmode consensus engine, a single local Validator node and of course the Zenroom TP, run:

docker-compose up

To stop and remove the container images do:

docker-compose stop
docker-compose rm

To develop the tp on OSX

https://github.com/ludbb/secp256k1-py#installation-with-compilation

brew install automake pkg-config libtool libffi gmp
python3 ./setup.py install

You will need an osx build of the zenroom-py module.

. ./.sawtooth-tp.venv/bin/activate
pip uninstall zenroom
pip install ../zenroom-py/dist/zenroom-0.1.3.tar.gz 

cd zenroom_sawtooth
nosetests tests

To run a sawtooth command

To run a command processed by the Sawtooth blockchain one needs to be logged into one of the nodes that have access to the rest-api, or localhost when connecting from the host machine running docker, using the port 8090.

What is also needed is that a valid Sawtooth keypair is available for the client, to be generated with the command: sawtooth keygen. This command requires having sawtooth-core installed on the machine.

To verify the REST-API connectivity: curl http://rest-api:8090/peers

To use Sawtooth's CLI commands append the --url http://rest-api:8090

For instance:

sawtooth peer --url http://rest-api:8080 list 

ssh to one of the containers, e.g. rest-api

docker-compose exec rest-api bash

See https://sawtooth.hyperledger.org/docs/core/releases/1.0/app_developers_guide/docker.html#logging-into-the-client-container

To see something happening:

docker-compose exec -it sawtooth-validator bash

Acknowledgements

Copyright (C) 2019 by Dyne.org foundation, Amsterdam

Designed, written and maintained by Denis Roio [email protected] and Puria Nafisi Azizi [email protected]

Zenroom-TP is Licensed under the terms of the Affero GNU Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Small parts of Zenroom-TP are based upon example code that is Copyright (C) 2015-2017 by Intel Corporation and licensed under the Apache License, Version 2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License.

sawtooth-tp-zenroom's People

Contributors

jaromil avatar puria avatar

Watchers

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

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.