hyperledger-fabric

Hyperledger composer javascript return value

给你一囗甜甜゛ 提交于 2020-01-06 06:05:48
问题 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

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

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 Fabric : Register and enroll new peer identity using fabric-ca-client (Javascript)

痞子三分冷 提交于 2020-01-06 04:18:16
问题 In the documentation of fabric-ca there is only CLI description of identities creation, using the nodejs module "fabric-ca-client" we can register and enroll new user using: fabric_ca_client.register({enrollmentID: 'user1', affiliation: 'org1.department2', role: ''}, admin_user); fabric_ca_client.enroll({enrollmentID: 'user1', enrollmentSecret: secret}); but what about peers and order ? I can't find any documentation about that. 来源: https://stackoverflow.com/questions/52890307/hyperledger

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

Hyperledger Fabric chaincode instantiation returns timeout expired

北城以北 提交于 2020-01-05 09:01:15
问题 I've been working around with Fabric for a a few months now, and I've been trying to run a somewhat complex virtual machine, the Ethereum Virtual Machine within a chaincode. It is written in JavaScript so I worked with the nodeJS chaincode version. I packed the the VM with my chaincode in a directory that i install and instantiate onto the peer. The install completes and exits with no errors, however the instantiation after hanging for a few minutes returns me an error: Error: Error endorsing

How to code own consensus in Hyperledger Fabric?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-05 07:12:17
问题 I want to use Hyperledger Fabric. But I need a special consensus algorithm. I have the concept ready but no idea how to get it implemented in Fabric. The documentation says: A consensus plugin needs to implement the Consenter and Chain interfaces defined in the consensus package. There are two plugins built against these interfaces already: solo and kafka. You can study them to take cues for your own implementation. The ordering service code can be found under the orderer package. First

How to get the parameters passed to the transaction for the historical states

旧街凉风 提交于 2020-01-05 04:18:35
问题 I am trying to get the operation which is responsible for the new state. In simple words, I want to get the function name passed to the invoke method. When I am looking into the historical states I am able to fetch its value, timestamp, transaction ID, etc. but not the parameters which are responsible for that transaction. I know we can get the parameters from the block history, but I need it for the states. Is there any way to achieve this from the chaincode side? 回答1: Yes, from the

Getting error “Get http://localhost:9443/metrics: dial tcp 127.0.0.1:9443: connect: connection refused”

懵懂的女人 提交于 2020-01-04 05:39:29
问题 I'm trying to configure Prometheus and Grafana with my Hyperledger fabric v1.4 network to analyze the peer and chaincode mertics. I've mapped peer container's port 9443 to my host machine's port 9443 after following this documentation. I've also changed the provider entry to prometheus under metrics section in core.yml of peer. I've configured prometheus and grafana in docker-compose.yml in the following way. prometheus: image: prom/prometheus:v2.6.1 container_name: prometheus volumes: - .