how deploying importing busines network on hyperledger composer? - hyperledger-composer

how to deploy the business network on hyperledger composer through cli?
student-business-network#0.0.2-deploy.3 prepublish /home/user/Downloads/student-business-network.bna_FILES
mkdirp ./dist && composer archive create --sourceType dir --sourceName . -a ./dist/unnamed-network.bna
Creating Business Network Archive
Looking for package.json of Business Network Definition
Input directory: /home/user/Downloads/student-business-network.bna_FILES
Found:
Description: Start from scratch with a blank business network
Name: student-business-network
Identifier: student-business-network#0.0.2-deploy.3
Written Business Network Definition Archive file to
Output file: ./dist/unnamed-network.bna
Command succeeded
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN student-business-network#0.0.2-deploy.3 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 933 packages from 1011 contributors and audited 15581 packages in 47.456s
found 111 vulnerabilities (71 low, 26 moderate, 13 high, 1 critical)
run npm audit fix to fix them, or npm audit for details
user#finatel:~/Downloads/student-business-network.bna_FILES$ composer runtime install --card PeerAdmin#hlfv1 --businessNetworkName student-network && composer network start --card PeerAdmin#hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile student-business-network.bna --file networkadmin.card && composer card import --file networkadmin.cardcomposer hiveFile student-business-network.bna --file networkadmin.card

I would suggest you read the hyperledger composer documentation and specifically follow the tutorials in the documentation to help you get started.
documentation can be found here https://hyperledger.github.io/composer/latest/
tutorials are here https://hyperledger.github.io/composer/latest/tutorials/tutorials.html

Related

I have an issue which can't solve with npm laravel

I'm new at LARAVEL. I have an setup issue with NPM I can't solve it from a while.
this is the error comes for me
> > node-sass#4.10.0 install C:\xampp\htdocs\lsapp\node_modules\node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.10.0/win32-x64-67_binding.node
Download complete ] - :
Binary saved to C:\xampp\htdocs\lsapp\node_modules\node-sass\vendor\win32-x64-67\binding.node
Caching binary to C:\Users\Di7aa\AppData\Roaming\npm-cache\node-sass\4.10.0\win32-x64-67_binding.node
> uglifyjs-webpack-plugin#0.4.6 postinstall C:\xampp\htdocs\lsapp\node_modules\laravel-mix\node_modules\webpack\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js
> node-sass#4.10.0 postinstall C:\xampp\htdocs\lsapp\node_modules\node-sass
> node scripts/build.js
Binary found at C:\xampp\htdocs\lsapp\node_modules\node-sass\vendor\win32-x64-67\binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
added 1269 packages from 706 contributors and audited 17986 packages in 186.49s
found 1 high severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
anyOne can help please ?
Just run npm audit fix, everything is fine, you have no errors.

Failed at the # production script. Error running npm run production

I am facing issue while using the following command
npm run production
after execute following command i see following error
ERROR Failed to compile with 5 errors
error in ./resources/assets/sass/app.scss
Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot read property 'map' of undefined
at preparePluginsArray (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo\config.js:64:20)
at module.exports (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo\config.js:32:28)
at new module.exports (E:\wamp\www\smm.yasmalik.com\node_modules\svgo\lib\svgo.js:21:19)
at E:\wamp\www\smm.yasmalik.com\node_modules\postcss-svgo\dist\index.js:95:16
at Object.creator [as postcssSvgo] (E:\wamp\www\smm.yasmalik.com\node_modules\postcss-svgo\node_modules\postcss\lib\postcss.js:150:35)
at E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\dist\index.js:295:40
at Array.forEach (<anonymous>)
at E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\dist\index.js:282:29
at creator (E:\wamp\www\smm.yasmalik.com\node_modules\cssnano\node_modules\postcss\lib\postcss.js:150:35)
at processCss (E:\wamp\www\smm.yasmalik.com\node_modules\css-loader\lib\processCss.js:199:16)
It was issue with my node_modules folder. there were some extra useless packages so simply i just deleted node_modules and install it again with following commands
Step 1
Delete node_modules manually
Step 2
Install the node_modules folder again:
npm i
Step 3
Update existing packages
npm update
That's it!
Probably you have some conflicts with versions of some npm packages.
Try to reinstall npm:
rm -rf node_modules
npm install

Lerna fails with 404 when trying to link dependency

My structure is as follows:
package.json
lerna.json
packages
myproj-util
package.json
myproj-schema
package.json -- has dev-depenency on myproj-util
Neither project is published to npm yet.
When I run lerna boostrap I get:
❯ lerna bootstrap
lerna info version 2.4.0
lerna info versioning independent
lerna info Bootstrapping 2 packages
lerna info lifecycle preinstall
lerna info Installing external dependencies
lerna ERR! execute callback with error
lerna ERR! Error: Command failed: npm install
lerna ERR! npm ERR! code E404
lerna ERR! npm ERR! 404 Not Found: myproj-util#*
My understanding from the docs is that when running lerna bootstrap it should "check if each dependency is part of the Lerna repo" so it should just be symlinked.
So... why is it not just symlinking my internal dependency? The dependency is under packages/ and the folder name and package name match exactly.
This line from the docs provides a hint:
The version of babel-generator in the package.json of babel-core is satisfied by packages/babel-generator, passing for an internal dependency.
i.e., your internal packages have to match any version constraints otherwise they will be treated as external packages.
Even though my dependency was on "myproj-util": "*", I had forgotten to add a version (any version) to the package.json of myproj-util. Simply adding the version fixed the problem. i.e., the myproj-util package.json looks like:
{
"name": "myproj-util",
"version": "0.1.0"
}

Running the 'Getting-Started' Fabric Composer gets error with composer archive create; missing required options

Sequence of steps was
npm install -g composer-cli
Clone the getting started repository, and issue npm install
Lots of NPM errors are output, but some of the key ones are.
> composer archive create -m digitalproperty-network --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
composer archive create --archiveFile digitialPropertyNetwork.zip --sourceType module --sourceName digitalproperty-network
Options:
--help Show help [boolean]
-v, --version Show version number [boolean]
--archiveFile, -a Business network archive file name. Default is based on the Identifier of the BusinessNetwork [string]
--sourceType, -t The type of the input containg the files used to create the archive [ module | dir ] [required]
--sourceName, -n The Location to create the archive from e.g. NPM module directory or Name of the npm module to use [required]
Missing required arguments: sourceType, sourceName
npm ERR! Linux 4.8.0-39-generic
npm ERR! argv "/home/matthew/.nvm/versions/node/v6.10.0/bin/node" "/home/matthew/.nvm/versions/node/v6.10.0/bin/npm" "run" "deployNetwork"
npm ERR! node v6.10.0
npm ERR! npm v4.3.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! getting-started#1.0.0 deployNetwork: `composer archive create -m digitalproperty-network --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d`
npm ERR! Exit status 1
The machine is clean, with no caches. Some of the other sample networks are also failing with the same error?
When the npm install -g composer-cli was issued, it installed a version of the command line tools that was at v0.4.5 or later. composer --version outputs for example.
$ composer --version
composer-cli v0.4.5
composer-admin v0.4.5
composer-client v0.4.5
composer-common v0.4.5
composer-runtime-hlf v0.4.5
composer-connector-hlf v0.4.5
The composer archive create command needs to form up the Business Network Archive from the model files, transaction files etc. It can do this in two ways
by taking a source directory
by taking a module name
The new syntax of the command is
composer archive create --archiveFile digitialPropertyNetwork.zip --sourceType module --sourceName digitalproperty-network
Options:
--help Show help [boolean]
-v, --version Show version number [boolean]
--archiveFile, -a Business network archive file name. Default is based on the Identifier of the BusinessNetwork [string]
--sourceType, -t The type of the input containg the files used to create the archive [ module | dir ] [required]
--sourceName, -n The Location to create the archive from e.g. NPM module directory or Name of the npm module to use [required]
Previously there was a --moduleName and a --inputDir name.
Examples:
To create a business network archive from the current working directory previously would have used the --inputDir . the new command is:
composer archive create --sourceType dir --sourceName . --archiveFile digitialPropertyNetwork.bna
To create a business network archive by indicating the NPM Module containing the business network would have used the --moduleName digitalproperty-network the new command is:
composer archive create --sourceType module --sourceName digitialproperty-network --archiveFile digitialPropertyNetwork.bna
In both cases above the --archiveFile digitialPropertyNetwork.bna is optional. A default filename will be created from the name of the Business Network if needed.
Why?
The inputDir and moduleName options were mutually exclusive and the internal code design was not proving resilient to handling error cases. The new approach to the options simplifies (and increases the resilience of the code).
Depending on the development approach, the artifacts that make up the business network may be created in different ways. By moving to this new style of options means we aren't precluding any other 'sourceType'. In the previous model, we would have had to add more and more command line options.

With Node 0.12.2 and npm 2.7.4 ionic installation error on windows 7

I am downloaded the node installation file "node-v0.12.2-x64.msi" for 64 bit windows 7 OS. All node and npm commands are working fine. I checked both the node and npm versions.
But when I try to install ionic by the following command:
npm install -g cordova ionic
Its gives me the following error:
npm WARN engine cordova-js#3.9.0: wanted: {"node":"~0.10.x"} (current: {"node":"
0.12.2","npm":"2.7.4"})
npm WARN engine npm#1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":
"0.12.2","npm":"2.7.4"})
npm WARN engine xmlbuilder#2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {
"node":"0.12.2","npm":"2.7.4"})
npm WARN installMany normalize-package-data was bundled with npm#1.3.4, but bund
led package wasn't found in unpacked tree
npm ERR! tar.unpack untar error C:\Users\Biswarup\AppData\Local\Temp\npm-1484-8b
f97a1e\registry.npmjs.org\request\-\request-2.9.203.tgz
npm ERR! cb() never called!
Biswarup is my username in above all cases.
I check the following links for troubleshooting, but nothing works for me.
https://github.com/npm/npm/wiki/Troubleshooting#error-enoent-stat-cusersuserappdataroamingnpm-on-windows-7
https://github.com/diegonetto/generator-ionic/issues/42
Please guide me, I am totally stuck at that point. Try to removing node js and reinstalling it many times. But nothing goes right.
First of all packages warning you, that it requires nodejs 0.10.x and may be that is a reason.
Another try you can upgrade npm and try to found new version. So here steps to do it:
npm cache clean
npm update -g npm
npm cache clean
Please download Node 0.10.38
I was too having problem with newer version of node.
I have already aswered this in detail https://stackoverflow.com/a/31124491/1276616

Resources