forked from hyperledger-archives/composer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of /Users/sstone1/git/Concerto-Runtime into de…
…velop
- Loading branch information
Showing
67 changed files
with
10,018 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
coverage | ||
node_modules | ||
out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
env: | ||
es6: true | ||
node: true | ||
mocha: true | ||
extends: 'eslint:recommended' | ||
parserOptions: | ||
ecmaVersion: 2015 | ||
sourceType: | ||
- script | ||
rules: | ||
indent: | ||
- error | ||
- 4 | ||
linebreak-style: | ||
- error | ||
- unix | ||
quotes: | ||
- error | ||
- single | ||
semi: | ||
- error | ||
- always | ||
no-unused-vars: | ||
- error | ||
- args: none | ||
no-console: off | ||
curly: error | ||
eqeqeq: error | ||
no-throw-literal: error | ||
strict: error | ||
no-var: error | ||
dot-notation: error | ||
no-tabs: error | ||
no-trailing-spaces: error | ||
no-use-before-define: error | ||
no-useless-call: error | ||
no-with: error | ||
operator-linebreak: error | ||
require-jsdoc: | ||
- error | ||
- require: | ||
ClassDeclaration: true | ||
MethodDefinition: true | ||
FunctionDeclaration: true | ||
valid-jsdoc: | ||
- error | ||
- requireReturn: false | ||
yoda: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# JSDoc | ||
out | ||
|
||
# Mac files. | ||
**/.DS_Store | ||
|
||
*.swp | ||
|
||
# Build generated files should be ignored by git, but not by npm. | ||
index.d.ts |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
instrumentation: | ||
excludes: | ||
- out/** | ||
- scripts/** | ||
check: | ||
global: | ||
statements: 95 | ||
branches: 95 | ||
lines: 95 | ||
functions: 95 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# JSDoc | ||
out | ||
|
||
# Mac files. | ||
**/.DS_Store | ||
|
||
*.swp | ||
|
||
# Build generated files should be ignored by git, but not by npm. | ||
# index.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"ecmaVersion": 6, | ||
"libs": [ | ||
"chai" | ||
], | ||
"plugins": { | ||
"node": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
language: node_js | ||
node_js: | ||
- '4' | ||
- '6' | ||
before_install: | | ||
set -ev | ||
npm install -g npm | ||
npm config set @ibm:registry https://npm-registry.whitewater.ibm.com | ||
npm config set //npm-registry.whitewater.ibm.com/:_authToken ${NPM_TOKEN} | ||
deploy: | ||
provider: script | ||
script: ./scripts/deploy.sh | ||
skip_cleanup: true | ||
on: | ||
all_branches: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Concerto-Runtime | ||
|
||
`npm install @ibm/ibm-concerto-runtime --save` | ||
|
||
## Introduction | ||
|
||
This repository contains the core runtime code for the IBM Blockchain Framework. | ||
The runtime code is deployed to the Blockchain, and provides the support for managing | ||
business networks, registries and resources, and execution of transaction processor | ||
functions. | ||
|
||
The runtime code is designed so that it can be executed on both a real Blockchain | ||
implementation (Hyperledger Fabric) and also standalone in a web browser for rapid | ||
development and testing purposes. To ensure that this is possible, the code in | ||
this repository must be kept isolated from the underlying Blockchain technology. | ||
|
||
## Runtime Components | ||
|
||
The IBM Blockchain Framework runtime is split into several components to allow | ||
the runtime code to execute in multiple environments. Those components are as follows: | ||
|
||
![Runtime overview](./images/overview.png) | ||
|
||
### Container | ||
|
||
The runtime code in this repository is hosted in a **Container**. The **Container** | ||
is responsible for starting the **Engine**, routing calls from the client and | ||
administrative APIs into the **Engine**, and exposing the Blockchain to the **Engine** | ||
via a set of **Services**. | ||
|
||
Two **Container** implementations currently exist: | ||
|
||
* Hyperledger Fabric (Go): [Concerto-Runtime-Hyperledger-Fabric](https://github.ibm.com/Blockchain-WW-Labs/Concerto-Runtime-Hyperledger-Fabric) | ||
* Web/in-browser (JavaScript): [Concerto-Runtime-Web](https://github.ibm.com/Blockchain-WW-Labs/Concerto-Runtime-Web) | ||
|
||
The **Container** interface is defined in [lib/container.js](./lib/container.js). | ||
|
||
### Engine | ||
|
||
The **Engine** provides all of the core code for managing business networks, | ||
registries and resources, and execution of transaction processor functions. Calls | ||
from the client and administrative APIs are handled by the generic `Engine.init`, `Engine.invoke`, or `Engine.query` functions in [lib/engine.js](./lib/engine.js) | ||
which then forward the call onto the specific handler functions. | ||
|
||
The specific handler functions are organised into separate files: | ||
|
||
* Business Network management: [lib/engine.businessnetworks.js](./lib/engine.businessnetworks.js) | ||
* Registry management: [lib/engine.registries.js](./lib/engine.registries.js) | ||
* Resource management: [lib/engine.resources.js](./lib/engine.resources.js) | ||
* Transaction execution: [lib/engine.transactions.js](./lib/engine.transactions.js) | ||
|
||
The **Container** will start a single instance of the **Engine** and make multiple | ||
calls to it. The **Engine** code must also support multiple *in-flight* requests, and this is made possible by the **Context** which is passed into the **Engine** by the **Container**. | ||
|
||
### Services | ||
|
||
A set of **Services** are provided by the **Container** for use by the **Engine**. | ||
The current set of **Services** that must be provided by the **Container** are: | ||
|
||
* The *logging service*, for writing log entries: [lib/loggingservice.js](./lib/loggingservice.js) | ||
* The *data service*, for interacting with the world state: [lib/dataservice.js](./lib/dataservice.js) | ||
|
||
There are two different types of **Services**: | ||
|
||
* **Container** level services, available from the **Container** interface. | ||
* **Context** level services, available from the **Context** interface. | ||
|
||
The **Container** level services are not linked to the request, such as the logging | ||
service. The **Context** level services are linked to the request, such as the data service. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* IBM Confidential | ||
* OCO Source Materials | ||
* IBM Concerto - Blockchain Solution Framework | ||
* Copyright IBM Corp. 2016 | ||
* The source code for this program is not published or otherwise | ||
* divested of its trade secrets, irrespective of what has | ||
* been deposited with the U.S. Copyright Office. | ||
*/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* IBM Confidential | ||
* OCO Source Materials | ||
* IBM Concerto - Blockchain Solution Framework | ||
* Copyright IBM Corp. 2016 | ||
* The source code for this program is not published or otherwise | ||
* divested of its trade secrets, irrespective of what has | ||
* been deposited with the U.S. Copyright Office. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/** | ||
* The runtime module provides the API that is made available to transaction | ||
* processing functions. | ||
* @module ibm-concerto-runtime | ||
*/ | ||
|
||
module.exports.Container = require('./lib/container'); | ||
module.exports.Context = require('./lib/context'); | ||
module.exports.DataCollection = require('./lib/datacollection'); | ||
module.exports.DataService = require('./lib/dataservice'); | ||
module.exports.Engine = require('./lib/engine'); | ||
module.exports.IdentityService = require('./lib/identityservice'); | ||
module.exports.JSTransactionExecutor = require('./lib/jstransactionexecutor'); | ||
module.exports.LoggingService = require('./lib/loggingservice'); | ||
module.exports.TransactionExecutor = require('./lib/transactionexecutor'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"tags": { | ||
"allowUnknownTags": true, | ||
"dictionaries": ["jsdoc","closure"] | ||
}, | ||
"source": { | ||
"includePattern": ".+\\.js(doc|x)?$", | ||
"include": [ | ||
"./lib" | ||
] | ||
}, | ||
"plugins": [], | ||
"templates": { | ||
"logoFile": "", | ||
"cleverLinks": false, | ||
"monospaceLinks": false, | ||
"dateFormat": "ddd MMM Do YYYY", | ||
"outputSourceFiles": true, | ||
"outputSourcePath": true, | ||
"systemName": "IBM Concerto", | ||
"footer": "", | ||
"copyright": "Copyright IBM Corp. 2016", | ||
"navType": "vertical", | ||
"theme": "spacelab", | ||
"linenums": true, | ||
"collapseSymbols": false, | ||
"inverseNav": true, | ||
"protocol": "html://", | ||
"methodHeadingReturns": false | ||
}, | ||
"markdown": { | ||
"parser": "gfm", | ||
"hardwrap": true | ||
} | ||
} |
Oops, something went wrong.