hyperledger-composer

Hyperledger composer javascript return value

坚强是说给别人听的谎言 提交于 2020-01-06 06:05:28
问题 I want to create smart contract for login. When users input username and password are correct its will return true and incorrect return false to my web application. Model participant SampleParticipant identified by participantId { o String participantId o String username o String password } transaction SampleLogin { --> SampleParticipant participant o String inputUsername o String inputPassword } Transaction function sampleLogin(tx) { var username = tx.participant.username; var password = tx

Saving data on Hyperledger-Composer network

大憨熊 提交于 2020-01-06 05:40:27
问题 I the last weeks I have completed the Principal Hyperledger-Composer tutorials and I have created a private network for testing some features. I have noticed that if you close your PC or stop the fabric ( ./stopFabric ), and restart the private-network, it will be empty. You lose every action you perform in the network using the rest-server (add client, transaction history, etc). Is there a way for saving my actions? Do I have to use a "multiple-organization-network" (https://hyperledger

Problem of querying the Hyperledger Historian

自作多情 提交于 2020-01-06 04:52:23
问题 I am developing Hyperledger composer application and I want to get all the transactions related data like transaction type,transaction Id and timestamp to a particular stakeholder who involved in. I created following query to get data from historian. query getFromHistorian { description:"get user transactions" statement: SELECT org.hyperledger.composer.system.HistorianRecord WHERE (participantInvoking == _$stakeholder) } But when I execute this query by giving a stakeholder id using REST API

I volume a directory in CouchDB, have error when I run `composer network start` at second time

一世执手 提交于 2020-01-06 04:34:07
问题 I add the following two lines in the CouchDB container of docker-compose file. volumes: - ./couchdb:/opt/couchdb/data My steps as follows: ./startFabric.sh composer network install -c PeerAdmin@hlfv1 -a tutorial-network.bna composer network start -n tutorial-network -A admin -S adminpw -c PeerAdmin@hlfv1 -V 0.0.2-deploy.10 -f admin@tutorial-network.card It's ok ,and some data will store my couchdb directory. Then I stop&remove all container: ./stopFabrics.sh ./startFabrics.sh composer network

Hyperledger Composer Rest Server connection with Cloudant NoSQL DB

会有一股神秘感。 提交于 2020-01-05 20:27:20
问题 i'm trying to set up the Hyperledger Composer Rest Server (https://hyperledger.github.io/composer/reference/rest-server) in order to work with Cloudant DB on IBM Cloud and store inside it the cards used to interact with the blockchain. In particular i would like to know how to configure the COMPOSER_DATASOURCES parameter of composer-rest-server. Thanks in advance for your availability. Best Regards 回答1: The Composer Rest Server uses loopback, and so the COMPOSER_DATASOURCES are lookback

Getting handshake error while creating profile in Local composer-playground

倖福魔咒の 提交于 2020-01-05 04:44:13
问题 While creating a profile to connect to a hyperledger fabric instance, I get the following error. 0|composer | HLFConnection :login() > admin 0|composer | E0508 11:50:42.311834619 75 ssl_transport_security.c:611] Could not load any root certificate. 0|composer | E0508 11:50:42.311850655 75 ssl_transport_security.c:1348] Cannot load server root certificates. 0|composer | E0508 11:50:42.312139228 75 security_connector.c:837] Handshaker factory creation failed with TSI_INVALID_ARGUMENT. 0

How to get timestamp when transaction is committed (or completed) in Hyperledger Fabric

☆樱花仙子☆ 提交于 2020-01-03 06:19:32
问题 I need to calculate the difference between "the timestamp when transaction is submitted" and "the timestamp when transaction is committed". Is it possible to get the tx committed (or completed) timestamp in fabric? I tried to use Hyperledger Explorer running on my composer channel. I can see tx timestamp inside the block. But I am not sure whether it is creation or committing timestamp. Also, can I convert explorer timestamp to ISO 8601 format? Please help me on this. 回答1: The timestamp you

measuring Hyperledger Composer performance using Hyperledger Caliper

怎甘沉沦 提交于 2020-01-02 01:09:36
问题 Is it possible to measure Hyperledger composer network performance which runs on Hyperledger fabric using Hyperledger Caliper framework? If yes can you guide me how can I change the configuration to connect Caliper to running Hyperledger composer network? 回答1: If you use composer rest server to enable rest api endpoints, you can always use apache meter to test out the latency of your system. 回答2: Hyperledger Caliper is a blockchain benchmark framework to measure performance of multiple

When to call getAssetRegistry to update assets (and the participants equivalent)

ぃ、小莉子 提交于 2019-12-31 04:38:06
问题 I'm able to write some simplistic smart contracts using my composer development environment but am confused about when to persist assets and participants into the registry. I've read the docs on composer-runtime.AssetRegistry and the getAssetRegistry function to return an asset registry object and to perform updates but am still not clear which assets/partipants to update. Here's an example (may not be fully working): participant Trader identified by userID { o String userID o String

Trying to deploy a business network onto hyperledger fabric 1.0 beta fails to install chaincode

孤人 提交于 2019-12-31 03:58:06
问题 I have v0.8.0 of hyperledger composer installed and when I try to deploy the business network using the following command I get an install chaincode error composer network deploy -a test.bna -p hlfv1 -i admin -s adminpw And the response is Error: error trying to deploy. Error: error trying install chaincode. Error What is the problem ? 回答1: The security model changed after hyperledger v1.0.0-alpha1. Now peers have the concept of Admin users. The userid 'admin' is a userid controlled and owned