npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-fabric

v0.2.27

Published

Yeoman generator for Hyperledger Fabric

Downloads

109

Readme

generator-fabric

Yeoman generator for Hyperledger Fabric.

This Yeoman generator can be used to generate chaincodes, or smart contracts, for Hyperledger Fabric. Chaincodes can be generated that are written in either Go or JavaScript, with experimental TypeScript support available as well.

Installation

You must install Yeoman, which is easy:

npm install -g yo

Then you can install this Yeoman generator, which is also easy:

npm install -g generator-fabric

Done!

Usage

Create a new directory for the chaincode:

mkdir my-smart-contract

Change into the new directory for the chaincode:

cd my-smart-contract

Create an empty git repository for the chaincode (optional, but recommended):

git init

Run the Yeoman generator:

yo fabric

If everything is installed successfully, then you should see prompts similar to the following:

? Please specify the generator to run: Chaincode
This generator can also be run with: yo fabric:chaincode
? Please specify the chaincode language: JavaScript
? Please specify the chaincode name: my-smart-contract
? Please specify the chaincode version: 0.0.1
? Please specify the chaincode description: My Smart Contract
? Please specify the chaincode author: Simon Stone
? Please specify the chaincode license: Apache-2.0
create package.json
create .editorconfig
create .eslintrc.js
create .gitignore
create index.js
create start.js
create lib/chaincode.js
create test/chaincode.js

Alternatively, you can run the generator non-interactively, by specifying additional command line options:

yo fabric:chaincode -- --language javascript --name my-smart-contract --version 0.0.1 --description "My Smart Contract" --author "Simon Stone" --license Apache-2.0

If you are running the contract generator non-interactively, you will also need to specify the contractType (either default or private) and the asset command line options, in addition to the above options. Please note that if you decide on generating a contract which makes use of private data, you will also need to specify the mspId as a command line option. For example:

yo fabric:contract -- --contractType private --mspId Org1MSP --language javascript --name my-smart-contract --version 0.0.1 --description "My Smart Contract" --author "Simon Stone" --license Apache-2.0 --asset "MyPrivateAsset"