hyperledger

Instantiating Chaincode in Hyperledger Composer with local npm registry

▼魔方 西西 提交于 2019-12-06 00:03:36
I want to instantiate a chaincode in an environment without any Internet connection. As the chaincode container will issue npm install upon instantiation, I added a new container called npmregistry in the docker-composer.yml so that it is provisioned alongside the rest of the Fabric containers and belongs to the same docker network (composer_default). Note I'm using the fabric-tools downloaded from https://hyperledger.github.io/composer/latest/installing/development-tools.html ) npmregistry: container_name: npmregistry image: verdaccio/verdaccio volumes: - /home/user/repo/:/verdaccio/storage/

Error: Cannot find module './api' (Hyperledger composer)

☆樱花仙子☆ 提交于 2019-12-05 23:29:21
问题 After installing Hyperledger Composer cli from this page, I tried to call composer command but got this error: module.js:549 throw err; ^ Error: Cannot find module './api' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object.<anonymous> (/home/user/.nvm/versions/node/v8.11.1/lib/node_modules/composer-cli/node_modules/node-report/index.js:3:13) at Module._compile

Implement inter-channel security among the peers within the same channel in Hyperledger Fabric V1.0

。_饼干妹妹 提交于 2019-12-05 22:45:00
I have successfully create a Hyperledger Fabric v1.0 network locally by following the steps Building Your First Network and communicating to this network from my java application using fabric-sdk-java . Here it created the certificates using cryptogen tools and is able to invoke/query chaincode through each of the peers which participating in the same channel. My implementations is like: I have four organisations Org1, Org2, Org3 and Org4 each having one peer. When Org1 creating an asset A1 with quantity 100 using the chaincode C1, it has to share this asset among the peers like Org2.peer0 A1:

How to get all existing channels in Hyperledger 1.0 (Node SDK)

回眸只為那壹抹淺笑 提交于 2019-12-05 22:00:54
I am using the Node SDK with Hyperledger 1.0 and want to check if a channel with a specific name exists. Is there a way to query all existing channels? And is there a way to get a channel by name? You cannot see all available channels, while you can leverage CSCC (Configuration System Chaincode) GetChannels API to get a list of channels client eligible to. You just need to invoke chaincode named CSCC. The CSCC is the system chaincode, meaning it inherently built in into peer binary and loaded and "instantiate" during peer startup. You can find details here . Considering NodeJS the request will

Hyperledger fabric: No script

与世无争的帅哥 提交于 2019-12-05 20:29:42
I am following the tutorial on http://hyperledger-fabric.readthedocs.io to setup my own hyperledger. I am building the first network using "first-network" in the fabric-samples. The ./byfn -m generate is OK, but after using ./byfn -m up I receive the below error: /bin/bash: ./scripts/script.sh: No such file or directory The script.sh file is available in: \fabric-samples\first-network\scripts After running 'docker ps -a' I get: My OS is Windows 10. Does anyone know what is causing this and how to resolve this? Check out http://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html#windows

How to change Endorsement policies

走远了吗. 提交于 2019-12-05 19:37:58
I changed the endorsement policy from "OR" to "AND" with BYFN and instantiate the Chaincode. But, the data in the ledger is not changed even after the Invoke is executed. I confirmed "OR" condition is working.(data in the ledger is changed) Kindly let me know how I can solve it. peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n mycc -v 1.0 -c '{"Args":["init","a", "100",

Hyperledger Composer issue identity but missing business card

孤街浪徒 提交于 2019-12-05 19:33:09
I am working in a proof of concept with a Node.js application and 'composer-client' npm module. I have tried different commands such as adding a participant, adding an asset and performing a transaction and everything seems to work correctly. However, when I try to issue a new identity I do not get the results that I expect. I execute my Node.js application with the following code: var businessNetwork = new BusinessNetworkConnection(); return businessNetwork.connect('admin@tutorial-network') .then(() => { return businessNetwork.issueIdentity('org.acme.biznet.Trader#Trader_001', 'usr001') })

Difference between users created through cryptogen and enrolled through Fabric CA Server

末鹿安然 提交于 2019-12-05 18:51:10
While doing Hyperledger fabric setup, we create crypto material and mention users for organizations and and correspondingly user crypto material gets generated which is used to invoke chaincode while logging through CLI. Also, when we try to connect network through SDK we also need to enroll and register user to connect to network. So, what is the difference between these two users? Cryptogen utility used for generating Hyperledger Fabric key material is mainly meant to be used for testing environment only. It generates the CA certificate before the Fabric CA Server is up. {This won't be the

Chaincode (smart contract) interactions within and across channels in Hyperledger Fabric

纵然是瞬间 提交于 2019-12-05 17:39:37
Consider the Organization-Peer setup in a Hyperledger Fabric network as shown in the image. Org 1 has two peers, Org 2 has one peer - all of which exist inside the same channel - X. Org 3 has one peer which exist outside in a different channel. The peers have distinct chaincodes(c1, c2, c3 & c4) installed in each of them with the functions as explained. write() - put a key-value pair into the ledger update() - update a value for an existing key read() - query an existing key-value pair Now on to few questions. Can c3 invoke c2 to update a key's value (as c3 do not have update() function)? Can

Multiple Orderer redundancy in Kafka based network

可紊 提交于 2019-12-05 15:52:32
We're stuck configuring a fabric network based on 3 orgs with 1 peer each and 2 kafka-based orderers. For kafka ordering we use 4 kafka nodes with 3 zookeepers. It's deployed on some AWS ec2 instances as follows: 1: Org1 2: Org2 3: Org3 4: orderer0, orderer1, kafka0, kafka1, kafka2, kafka3, zookeeper0, zookeeper1, zookeeper2 The whole of the ordering nodes plus kafka cluster is located in the same machine for connectivity reasons (read somewhere they must be in the same machine to avoid these problems) During our test, we try taking down the first orderer (orderer0) for redundancy testing with