Giter VIP home page Giter VIP logo

sawtooth-app-js's Introduction

sawtooth-app-js

Sawtooth example network using JavaScript SDK: transaction processor and client

Introduction

This is a minimal example of a sawtooth 1.0 application. This example demonstrates, a common usecase, where a customer deposits/withdraws/transfers money from a wallet account.

A customer can:

  1. deposit money into his/her wallet account
  2. withdraw money from his/her wallet account
  3. check the balance in the wallet account
  4. transfer money from his/her wallet account to another

The customer is identified by a customer name and a corresponding public key. The wallet account balance, is stored at an address, derived from SHA 512 hash of customer's public key and the simplewallet transaction family namespace.

Components

The application is built in two parts:

  1. The client application written in nodeJS. The app.js is the main javascript file from where the main function call occurs. Handlebars are used for templating, client related CSS and JavaScript code is written in public folder and server related files are written in router/ folder. It is accessible via browser at localhost:3000.
  2. The Transaction Processor, that uses the JS Sawtooth SDK.

JAVASCRIPT CLIENT USAGE

How to use the simplewallet UI:

  1. Build and start the Docker containers:

docker-compose -f docker-compose.yaml up

  1. Open bash shell in simplewallet-client-js container:

docker exec -it simplewallet-client-js bash

  1. Create user accounts for jack and jill:

sawtooth keygen jack && sawtooth keygen jill

  1. Open two new browser tabs and go to http://localhost:3000 on each tab

  2. Login in one tab as jack and in other as jill

  3. Start with an initial deposit for each user - jack and jill via the Deposit tab in the UI homepage

sawtooth-app-js's People

Contributors

alejandrolr avatar

Stargazers

 avatar Mahavirsinh Chhasatiya avatar  avatar Rubén Chavarri 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.