Create a Business Network Definition
A business network definition has the following layout:
models/ (optional) lib/ permissions.acl (optional) package.json README.md (optional)
The easiest way to create a new business network definition is to either
git clone an example, or to use the Hyperledger Composer Yeoman generator to create a skeleton business network.
A description of the purpose of the business network using the Markdown mark-up language.
A Business Network Definition has a name (limited to basic ASCII alphanumeric characters and
-), a human-readable description and a version number. The version number for the network should take the form Major.Minor.Micro and
Semantic Versioning principles should be used when incrementing the version number.
The identifier of the network is formed from its name, the
- character and its version number. A valid identifier (and example) is therefore
The metadata for a business network definition is read from
package.json, meaning that business network definitions may also be valid
The set of domain models for a business network definition define the types that are valid within the network and outside the network when it is integrated with external systems (for example systems that submit transactions to the network).
A domain model may either be packaged within the business network definition (typically stored under the
models directory), or may be declared in
package.json as an external dependency. You refer to models via an npm dependency if you wanted to share them across business network definitions.
The scripts for a business network definition are typically stored under the
The permissions for the business network expressed are expressed in an optional
Cloning an Example Business Network Definition
The sample business network definitions are stored on GitHub at
https://github.com/hyperledger/composer-sample-networks. You can
git clone this repository to pull down all the sample networks. Each sample network is stored under the
Generating a Business Network Definition
? Please select the type of project: (Use arrow keys) ❯ Angular Business Network Model
- Answer all of the questions
Welcome to the Hyperledger Composer project generator ? Please select the type of project: Business Network You can run this generator using: 'yo hyperledger-composer:businessnetwork' Welcome to the business network generator ? Business network name: mynetwork ? Description: This is my test network ? Author name: Mr Conga ? Author email: email@example.com ? License: Apache-2 ? Namespace: org.conga create package.json create permissions.acl create README.md create models/org.conga.cto create .eslintrc.yml create features/sample.feature create features/support/index.js create test/logic.js create lib/logic.js
This generates a skeleton business network with an
transaction defined, as well as a
mocha unit test.
Also included, is a 'best practice' eslint config file which defines sample linting rules for JS code.