Giter Site home page Giter Site logo

hu19891110 / iroha Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyperledger-archives/iroha

0.0 1.0 0.0 19.33 MB

Iroha - A simple, decentralized ledger

Home Page: http://iroha.tech

License: Other

CMake 12.76% C++ 85.69% Makefile 0.83% Java 0.61% Shell 0.11%

iroha's Introduction

いろは(iroha)

CircleCI Codacy Badge Documentation Status

いろは(iroha) is ...
alt tag

Pull Requests

Please include a developer certificate with pull requests: http://developercertificate.org/

Architecture (Draft)

Directory tree

.
├── build (for cmake)
├── config
├── peer
├── core
│   ├── connection
│   ├── consensus
│   ├── crypto
│   ├── model
│   │   └── transactions
│   ├── infra
│   │   ├── connection
│   │   ├── crypto
│   │   ├── repository
│   │   ├── server
│   │   └── smart_contract
│   ├── repository
│   ├── server
│   ├── smart_contract
│   ├── util
│   ├── validation
│   └── vendor
├── doc
├── smart_contract
│   └── SampleCurrency_java
└── test
    ├── crypto
    └── smart_contract

config/

It contains config file. currently we use yaml, but JSON is good like as yaml.

peer/

It contains main.cpp

smart_contract/

It contains smart_contract logic what user defines.
Currently use java virtual machine.

test/

There's few tests for iroha. 🙇 We accept pull requests.

core/

It contains main.

├── connection
├── consensus
├── crypto
├── domain
│   └── transactions
├── infra
│   ├── connection
│   ├── crypto
│   ├── repository
│   ├── server
│   └── smart_contract
│       └── jvm
├── repository
├── server
├── smart_contract
├── util
└── validation

We adopt a Domain-Driven Development structure as much as possible.

+--------------+
| web rest api |
+--------------+
      | 
+--------------+
|  controller  |--------+-----------------------------------------+
+--------------+        |                                         |
      |          +-------------+  +----------------+   +----------------------+
      |          | repository  |  | domain model   |   | service              |
      |          | (interface) |--|                |   |+---------++---------+|
      |          +-------------+  |+--------------+|   || crypto  ||validate ||
      |                 |         || transaction  ||   || base64  |+---------+|
      |                 |         |+--------------+|   || hash    |           |
      |                 |         || asset        ||   |+---------+           |
      |                 |         |+--------------+|   +----------------------+
      |                 |         |+--------------+|             
      |                 |         ||smart contract||              
+--------------+        |         |+--------------+|
|   consensus  |--------+         +----------------+
|              |
|+------------+|
|| messaging  ||
|+------------+|
+--------------+

+----------------------------------------------------------------------------+
|infrastructure                                                              |
|                                                                            |
|+------------++--------------++-------------++----------------++---------+  |
|| messaging  || web rest api || repository  || smart contract || crypto  |  |
||(use aeron )||  (use crow)  ||(use leveldb)|| (use java vm)  || ed25519 |  |
|+------------++--------------++-------------++----------------++---------+  |
+----------------------------------------------------------------------------+

core/connection (consensus layer)

It contains the P2P messaging function interface.

  void initialize_peer( std::unordered_map<std::string, std::string> config);

  bool sendAll(std::string message);
  bool send(std::string to,std::string message);
  bool receive(std::function<void(std::string from,std::string message)> callback);

core/consensus (consensus layer)

It contains the consensus algorithm(s).

core/crypto (service)

It contains digital signature algorithms, base64, hash function interfaces, etc.

core/model (domain)

It contains asset model, transaction logic. independent of infra knowledge.

core/infra (infra layer)

It contains some source depend on vendor (third party) libraries. If any source depends on vendor libraries, it should be in infra.

filename

basically, filename is "function"_with_"lib name".cpp

connection
 └── connection_with_aeron.cpp
repository
 └── world_state_repository_with_level_db.cpp

core/server (UI layer)

It contains the server interface, currently.

void server();

core/smart_contract (service)

It contains the Java virtual machine interface.

void initializeVM(std::string contractName);
void finishVM();    
void invokeFunction(
    std::string functionName,
      std::unordered_map<std::string, std::string> params);

core/util (other)

It contains logger, random, datetime, exception...

Environment

JAVA_HOME  := java's home
IROHA_HOME := iroha's root

Requirement

cmake(3.5.2)

Recommended

fabric3 (python library, not hyperledger/fabric)

Installation

$ mkdir build
$ cmake ..
$ make

(in server) or

$ fab deploy

(in local)

Authors

MakotoTakemiya
MizukiSonoko

License

Copyright 2016 Soramitsu Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-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 for the specific language governing permissions and limitations under the License.

iroha's People

Contributors

mizukisonoko avatar takemiyamakoto avatar

Watchers

 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.