Date   

Where's the logic of deserialization of transaction? #fabric-endorser

BigBang019
 

Hi,

In fabric v1.4, contract function params are all strings, but in fabric v2.2, different type of prototype in function params are available. So I wonder:

- how fabric deserialize the transaction payload? For example, if the second function argument is int32, how fabric know the second one is int32?

I failed to find any relevant logic in fabric source code(v2.2).

Thanks in advance.


Re: Finding transaction originator (creator) and endorsers mspids.

StAv
 

Thank you very very much for your perfect answer! It is a pity that getHistoryForKey does not work for private data, as far as I know. Anyway, thank you so much!
Best regards,
StAv


Re: Finding transaction originator (creator) and endorsers mspids.

David F. D. Reis
 

Hello Stav. How are you?

Yes, there is. I will provide some snippets that may help (Javascript / Typescript):

1 - First you have to code a chaincode capable of querying the asset history and getting the Transaction Ids for each asset history:

    /**
    * Get Asset History
    * @param {Context} ctx Contexto da transação.
    * @param {String} key the CP issuer
    */
    async getAssetHistory(ctx, key) {

        let resultsIterator = await ctx.stub.getHistoryForKey(key);
        let results = await GetAllResults(resultsIterator, true);
        //results = JSON.stringify(results);
        const eventPayload =  Buffer.from(`Hist for key -> Key: ${key} (${results})`);
        ctx.stub.setEvent('getAssetHistory', eventPayload);
        return results;
    }

/**
 * Functio helper GetAllResults from the ledger
 * @param {*} iterator
 * @param {*} isHistory
 * @returns {}[]
 */
module.exports.GetAllResults = async (iterator, isHistory) => {
        let allResults = [];
        let res = await iterator.next();
        while (!res.done) {
            if (res.value && res.value.value.toString()) {
                let jsonRes = {};
                console.log(res.value.value.toString('utf8'));
                if (isHistory && isHistory === true) {
                    jsonRes.TxId = res.value.txId;
                    jsonRes.Timestamp = res.value.timestamp;
                    try {
                        jsonRes.Value = JSON.parse(res.value.value.toString('utf8'));
                    } catch (err) {
                        console.log(err);
                        jsonRes.Value = res.value.value.toString('utf8');
                    }
                } else {
                    jsonRes.Key = res.value.key;
                    try {
                        jsonRes.Record = JSON.parse(res.value.value.toString('utf8'));
                    } catch (err) {
                        console.log(err);
                        jsonRes.Record = res.value.value.toString('utf8');
                    }
                }
                allResults.push(jsonRes);
            }
            res = await iterator.next();
        }
        iterator.close();
        return allResults;
    }
--

2 - Query Asset History chaincode and get the Transaction ID (TxID):
    await gateway.connect(connectionProfile, connectionOptions);
    // Get the network (channel) our contract is deployed to.
    const network = await gateway.getNetwork('mychannel');
    // Get the contract from the network.
    const asset = network.getContract('somechaincode');
    // Submit the specified transaction.

    const asset = {
      key: 'key001',
    };
    const currentTimeBefore = new Date().getMilliseconds();
    const result = await contract.submitTransaction('getAssetHistory', asset.key);
    const historyJson: History[] = JSON.parse(result.toString());
    const currentTimeAfter = new Date().getMilliseconds();

    for (const hist of historyJson) {
      console.log(`# TxId: ${hist.TxId} \n `);
      const historyDate = new Date(hist.Timestamp.seconds.low * 1000);
      console.log(`# Data hist: ${historyDate.toLocaleString()} \n `);
    }

(The History obj I created using http://json2ts.com/, but the result is a JSON)

3 - With the Transaction ID, you will use the qscc chaincode to query the ledger:
a - To decode qscc results you have to use the fabric-protos package and some classes like BlockDecoder.
b - With qscc you be able to do the following operations:


const (
GetChainInfo string = "GetChainInfo"
GetBlockByNumber string = "GetBlockByNumber"
GetBlockByHash string = "GetBlockByHash"
GetTransactionByID string = "GetTransactionByID"
GetBlockByTxID string = "GetBlockByTxID"
)

c - and snippets querying some of the qscc cc:
 --- GetChainInfo:

    await gateway.connect(connectionProfile, connectionOptions);
    // Get the network (channel) our contract is deployed to.
    const network = await gateway.getNetwork('mychannel');
    // Get the contract from the network.
    const contract = network.getContract('qscc');
    // Submit the specified transaction.
    const currentTimeBefore = new Date().getMilliseconds();
    // get chain info
    const result = await contract.evaluateTransaction('GetChainInfo', 'mychannel');
    // chaininfo buf decoded
    const blockProto = JSON.stringify(fabproto6.common.BlockchainInfo.decode(result));

    console.log(`# GetChainInfo: ${blockProto} \n`);

-- GetBlockByNumber or GetBlockByTxID are almost the same (you just need to pass the retrieved txid from asset history):
    const resultGetByTxID = await contract.evaluateTransaction(
      'GetBlockByTxID',
      'mychannel',
      '1c910d812a594815592354d576a2f433cb22e0329d72c825d34ce14ca94fb957', // TransactionID
    );

    //const resultDecoded = JSON.stringify(BlockDecoder.decode(resultGetBlockByNumber));

    const resultDecodedByBlockDecoder: fabproto6.common.Block = BlockDecoder.decode(resultGetByTxID);

    //if (resultDecodedByBlockDecoder instanceof Block) {
    console.log(`# data: ${JSON.stringify(resultDecodedByBlockDecoder.data?.data?.toString())} \n`);
    console.log(`# number: ${resultDecodedByBlockDecoder.header?.number} \n`);
    console.log(`# metadata: ${JSON.stringify(resultDecodedByBlockDecoder.metadata?.metadata?.toString())} \n`);
    // }
    const resultDecoded = JSON.stringify(fabproto6.common.Block.decode(resultGetByTxID));

    console.log(`# GetBlockByTxID: ${resultDecoded} \n`);

-- GetTransactionByID and decoding the transaction:

    const transactionByTxID = await contract.evaluateTransaction(
      'GetTransactionByID',
      'mychannel',
      '1c910d812a594815592354d576a2f433cb22e0329d72c825d34ce14ca94fb957', // TransactionID
    );

    const processedTransaction = BlockDecoder.decodeTransaction(transactionByTxID);

    // Iterate over actions
    const actions = processedTransaction.transactionEnvelope.payload.data.actions;
    for (const action of actions) {
      console.log(`Creator mspid: ${action.header.creator.mspid}`);
      const endorsers = processedTransaction.transactionEnvelope.payload.data.actions[0].payload.action.endorsements;
      for (let i = 0; i < endorsers.length; i++) {
        console.log(`Endorser ${i} mspid: ${endorsers[i].endorser.mspid}`);
      }
    }

You may retrieve transaction / block information from events too.

I will provide some links that helped me:


import * as common from 'fabric-common';
const BlockDecoder = (common as any).BlockDecoder;

Because there is no type definition yet in the API.

PS2: I don´t know if those snippets are the more elegant way.

My best regards.

David

Em dom., 7 de nov. de 2021 às 05:26, StAv <stefano.avola@...> escreveu:

Sorry, I would like to add another question to this. Are there any way to get a transaction/block from an asset value/id? If so, how?
Thank you in advance.
StAv



--
David Reis
@davidfaulstich (Instagram)
@davidfdr (Github)



Re: Finding transaction originator (creator) and endorsers mspids.

StAv
 

Sorry, I would like to add another question to this. Are there any way to get a transaction/block from an asset value/id? If so, how?
Thank you in advance.
StAv


Finding transaction originator (creator) and endorsers mspids.

David F. D. Reis
 

Hello!

To find the tx creator and endorsers organizations (mspids) I am using the following snippet in typescript / javascript (test purposes):

    const transactionByTxID = await contract.evaluateTransaction(
      'GetTransactionByID',
      'mychannel',
      '1c910d812a594815592354d576a2f433cb22e0329d72c825d34ce14ca94fb957',
    );

    const processedTransaction = BlockDecoder.decodeTransaction(transactionByTxID);

    // Iterate over actions
    const actions = processedTransaction.transactionEnvelope.payload.data.actions;
    for (const action of actions) {
      console.log(`Creator mspid: ${action.header.creator.mspid}`);
      const endorsers = processedTransaction.transactionEnvelope.payload.data.actions[0].payload.action.endorsements;
      for (let i = 0; i < endorsers.length; i++) {
        console.log(`Endorser ${i} mspid: ${endorsers[i].endorser.mspid}`);
      }
    }

Is this the only way? There is another API capable of doing it easier?

Thank you in advance.

David



v

--
David Reis
@davidfaulstich (Instagram)
@davidfdr (Github)



Re: Anchor peer update failed, Consortium config value missing #fabric-orderer #fabric-peer #orderer #organizations #channel

Kavin Arumugam
 

Hi Gonzalo,

     I think, Anchor Peer Update Transaction has errors in it.

     Please refer the following link for sample Anchor Peer Update: 


     Note: Modify the MSP ID, Peer Address & Port, etc according to your needs.



On Thu, 4 Nov, 2021, 12:26 am gonzalo.bustos via lists.hyperledger.org, <gonzalo.bustos=wearepsh.com@...> wrote:

Hello!

I wanted to create an easy-to-start local environment for my hyperledger-fabric network, so I created a script that only kills the network containers (all configuration, transaction and cert files remain) and then another script that re-starts the containers. When I restart them, I have to rejoin the organization peers to the channel, and I believe I should also update the anchor peers again for each organization.

I managed to rejoin the organization peers to the channel with little effort, but I'm getting an error when trying to update the Anchor Peers.

The error: Error: got unexpected status: BAD_REQUEST -- Consortium config value missing

That error pops up right after trying to update the anchor peers on the channel with the following command:
+ peer channel update -o localhost:7050 --ordererTLSHostnameOverride orderer.com -c prescriptionschannel -f ./channel-artifacts/MedicOrgMSPanchors.tx --tls --cafile /var/www/psh/medical-chain/medchain-network/organizations/ordererOrganizations/orderer.com/orderers/orderer.com/msp/tlscacerts/tlsca.orderer.com-cert.pem
resulting error code => 1
 
Thank you in advance!


Adding a Custom Organizational Unit

mhdalkhaldibc@...
 

Hello all,

I've been researching this topic for a minute, and found many unanswered questions. I'm trying to implement a custom organizational unit to make use of it  in my policies, but according to the documentation at:

https://hyperledger-fabric.readthedocs.io/en/release-1.4/policies.html#msp-principals

"The ORGANIZATIONAL_UNIT is at the time of this writing not implemented."

This statement is there since 1.x versions until the latest, even though I've seen some discussions here and there on how to successfully add a new Organizational Unit.

So my question is, is it implemented or not?

Just to know if the problems I'm facing are a result of my doing, or because the functionality is not yet supported.

 

Thanks


#fabric-sdk-node #fabric-sdk-node

pham.qtpham@...
 

Hi,

I can run and test my Smart Contract manually using command like this without any error:

peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls true --cafile /Users/phamquoctrung/PLN.V1.5/pharma-ledger-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C plnchannel -n pharmaLedgerContract --peerAddresses localhost:7051 --tlsRootCertFiles /Users/phamquoctrung/PLN.V1.5/pharma-ledger-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles /Users/phamquoctrung/PLN.V1.5/pharma-ledger-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt --peerAddresses localhost:11051 --tlsRootCertFiles /Users/phamquoctrung/PLN.V1.5/pharma-ledger-network/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt -c '{"function":"makeOrder","Args":["100", "Test"]}'

But when using SDK (node) to deploy, there is error when calling function in JavaScript, e.g.:

const response = await contract.submitTransaction('makeOrder', orderNumber, ownerName);

How to troubleshoot the error in fabric-sdk-node ?

Thx in advance.

 


Re: Same organizations to different channels

David F. D. Reis
 

Hello Nikos. How are you?

I´ll try to help you with something. Sorry if I get something wrong.

Let's say I have three organization with 3 peers each one (org1, org2, 
org3), also there is one more organization with 2 orderers (org 4). Can
these 4 orgs belong to 10 different channels with different chaincode
for each channel?

          a - Yes. Org4 is the orderer organization? Only two orderers instances you will not be able to achieve HA with raft. I think that you will need a minimum of 3 instances. 10 channels may be an unusual use case for 3 peer organizations and one orderer organization.

i) I understand that one issue is the lack of privacy (all orgs can see
the data from the other channel). Correct? (this is not an issue for my
application)

         b - Org´s will access the ledger using the chaincodes in a channel. If all orgs have access to all channels and chaincodes, all orgs will have access to the ledger in all channels. You still make use of private data collections (PDC) with specific access policies (https://hyperledger-fabric.readthedocs.io/en/release-2.2/private_data_tutorial.html#)

ii) The peers will have to keep the ledger of each channel. Is this bad?
I understand that this increase the memory needs of the peers

         c - Each peer instance joined to a channel will have the ledger of that channel. Adding channels may increase the resources needed.

iii) Can the same org1's client application (based on the gateway sdk
api) used for transactions in all of the channels? (given that the user
of the client i.e Isabella can invoke transactions i.e in all chaincodes
there is something like getMSPID() equals "org1".)

          d - You can code anything on your rest server to encapsulate the channel's access. You may control which peers you will submit the transaction or evaluate it as well. It depends on your business rules or use case.


To target specific peers, you may implement a queryHandler and pass it at the connection options:

    const connectionOptions = {
      wallet,
      identity: 'Org1 Admin',
      discovery: { enabled: true, asLocalhost: true },
      queryHandlerOptions: {
        timeout: 10, // timeout in seconds
        strategy: createQueryHandler,
      },
    };


// Sample query handler that will use all queryable peers within the network to evaluate transactions, with preference
// given to peers within the same organization.

import { QueryHandler, QueryHandlerFactory, Query, QueryResults } from 'fabric-network';
import { Endorser } from 'fabric-common';
import * as util from 'util';

/**
 * Query handler implementation
 */
class SameOrgQueryHandler implements QueryHandler {
  private readonly peers: Endorser[];

  constructor(peers: Endorser[]) {
    this.peers = peers;
  }

  public async evaluate(query: Query): Promise<Buffer> {
    const errorMessages: string[] = [];

    for (const peer of this.peers) {
      const results: QueryResults = await query.evaluate([peer]);
      const result = results[peer.name];
      if (result instanceof Error) {
        errorMessages.push(result.toString());
      } else {
        if (result.isEndorsed) {
          console.log(`QueryHandler: ${result.payload}`);
          return result.payload;
        }
        throw new Error(result.message);
      }
    }

    const message = util.format('Query failed. Errors: %j', errorMessages);
    throw new Error(message);
  }
}

/**
 * Factory function for creating sample query handlers.
 * @param {Network} network The network where transactions are to be evaluated.
 * @returns {QueryHandler} A query handler implementation.
 */
export const createQueryHandler: QueryHandlerFactory = network => {
  const mspId = network.getGateway().getIdentity().mspId;
  //const mspIdOrg2 = 'Org2MSP';
  const channel = network.getChannel();
  const orgPeers = channel.getEndorsers(mspId);
  const otherPeers = channel.getEndorsers().filter(peer => !orgPeers.includes(peer));
  const allPeers = orgPeers.concat(otherPeers);
  return new SameOrgQueryHandler(allPeers);
};



iv) Is this scalable? How many channels can maintained by the same org?

         e- I do not have this answer. I prefer to solve this kind of problem when I have it. None of my current working scenarios has more than 5 channels. But yes, hyperledger fabric is scalable.


v) How easy it to create a new channel and add these orgs each time is
needed? (live without affecting the other channels or the operation of
the orgs i.e peers). The only difference will be the chaincode. The
policies of the channel will remain the same


         f- Well. All of the necessities to create and maintain peers are described in the documentation. It Gets sometimes a little confusing but is not so hard to maintain a hyperledger network. With bigger networks, you will have the need to automate some operations using devops and this could be done in a lot of ways. I prefer using git actions, kubernetes operators and  some shell script.

1) To use only one gateway client application (belonging to one of these N orgs) in order to have read and write access and read & update the ledger of each channel based on chaincodes. Can I do that? If yes, how I define inside the client in which channel do I want to invoke the transaction?

         g - Yes. Using API depending on your business rules you may code anything:

if(somerule) {
...
    await gateway.connect(connectionProfile, connectionOptions);
    // Get the network (channel) our contract is deployed to.
    const network = await gateway.getNetwork('mychannel');
...
}

    

2) To make some simple management operation using the low level SDK. Such as operations are: i) create channel, ii) join the peers of orgs to the new channel, iii) delete channel (and remove the ledger from peers), iv)update chaincode of the channel. In the same ways are previous can I do that from one low level SDK client (which will operate as admin of the network)?

f - Some links that could help you to manage your network:

PS1: As I have seen I can join only a part of the totals peers of the org to the channel. What can I gain doing that?

  g - I do not understand the question. You may join channels accordingly with the policies of your network. 

PS2: Should the structure of the network (i.e number of channels) to be defined from the start? How easy is to extend the network using the same orgs?

   h - The network starts from the beginning. And it evolves as needed. Some upgrade operations are more difficult while others are simpler. However, the hyperledger fabric is extremely versatile. Changing some settings using the download current configuration process and using configtxlator to append new configuration changes is somewhat manual, however, it can be automated. 





Best regards,


David



Em qui., 4 de nov. de 2021 às 07:39, Nikos Karamolegkos <nkaram@...> escreveu:

Hello, due to the fact that I didn't get any response, I will be more specific.
My idea is to have N orgs which will participate (with all of there peers) in a new channel each time there is a request. The new channel will have a different chainode but the policies will remain the same. Ideally, I would like to achieve two things:
1) To use only one gateway client application (belonging to one of these N orgs) in order to have read and write access and read & update the ledger of each channel based on chaincodes. Can I do that? If yes, how I define inside the client in which channel do I want to invoke the transaction?
2) To make some simple management operation using the low level SDK. Such as operations are: i) create channel, ii) join the peers of orgs to the new channel, iii) delete channel (and remove the ledger from peers), iv)update chaincode of the channel. In the same ways are previous can I do that from one low level SDK client (which will operate as admin of the network)?

PS1: As I have seen I can join only a part of the totals peers of the org to the channel. What can I gain doing that?
PS2: Should the structure of the network (i.e number of channels) to be defined from the start? How easy is to extend the network using the same orgs?

Any advice is welcome!



--
David Reis
@davidfaulstich (Instagram)
@davidfdr (Github)



Re: Issues with Using the Fabric test network tutorial

Belk, Taylor
 

Yep.
All CORE_VM_ENDPOINT’s needed to be unix:///var/run/docker.sockand all the peer volumes needed to be /var/run/docker.sock:/var/run/docker.sock

 

From: Chris Gabriel <alaskadd@...>
Sent: Thursday, November 4, 2021 11:55 AM
To: Belk, Taylor <Taylor.Belk@...>
Cc: J K <jsjkj434@...>; gqqnb2005@...; fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial

 

Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Taylor - Can you share you solution so others may learn who have the same problem in the future?  Thanks!



On Nov 4, 2021, at 11:37 AM, Belk, Taylor <taylor.belk@...> wrote:

 

I’ve figured it out now thanks

 

From: J K <jsjkj434@...> 
Sent: Thursday, November 4, 2021 11:37 AM
To: gqqnb2005@...; Belk, Taylor <Taylor.Belk@...>
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial

 

Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.

In that case you may try to run a VM on your windows machine and use ubuntu or any linux flavours inside of your virtualbox.

 

Cheers.

 

On Wednesday, 3 November, 2021, 09:58:39 pm IST, Belk, Taylor <taylor.belk@...> wrote:

 

 

Yea the problem with that is that our company does not support Linux so I don’t see that as a possibility.

 

From: fabric@... <fabric@...> On Behalf Of gqqnb2005 via lists.hyperledger.org
Sent: Wednesday, November 3, 2021 11:26 AM
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial

 

Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.

It looks like a docker issue. 

 

I have been using the test network on Ubuntu many times and have built Java and Go chaincodes.

 

Could you try on Ubuntu (Linux) and/or Java/Go?

 

 

On Wed, Nov 3, 2021 at 11:01 AM Belk, Taylor <Taylor.Belk@...> wrote:

Hello,

I am having issues with the tutorial, hoping you can help me out.

 

I am able to get through these sections:
Bring up the test network
The components of the test network
Creating a channel

just fine. I run into an issue here:
Starting a chaincode on the channel

 

I have tried just running
./network.sh deployCC

 

I’ve also tried running:
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript

AND

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

 

Both of which give this error:
<image001.png>

 

I am unable to find ANYTHING helpful for WINDOWS 10.

 

As you can see below I have installed all the pre-requisites:
<image002.png>

 

Please help as soon as possible.

 

Taylor Belk

Consultant

717 Texas Ave, Suite 1600 | Houston, TX 77002

M: 832-425-0496

<image003.png>     <image004.png>      <image005.png>     <image006.png>     <image007.png>   

<image008.png>

 

 


Re: Issues with Using the Fabric test network tutorial

Chris Gabriel <alaskadd@...>
 

Taylor - Can you share you solution so others may learn who have the same problem in the future?  Thanks!

On Nov 4, 2021, at 11:37 AM, Belk, Taylor <taylor.belk@...> wrote:

I’ve figured it out now thanks
 
From: J K <jsjkj434@...> 
Sent: Thursday, November 4, 2021 11:37 AM
To: gqqnb2005@...; Belk, Taylor <Taylor.Belk@...>
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial
 
Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.
In that case you may try to run a VM on your windows machine and use ubuntu or any linux flavours inside of your virtualbox.
 
Cheers.
 
On Wednesday, 3 November, 2021, 09:58:39 pm IST, Belk, Taylor <taylor.belk@...> wrote:
 
 

Yea the problem with that is that our company does not support Linux so I don’t see that as a possibility.

 

From: fabric@... <fabric@...> On Behalf Of gqqnb2005 via lists.hyperledger.org
Sent: Wednesday, November 3, 2021 11:26 AM
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial

 

Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.

It looks like a docker issue. 

 

I have been using the test network on Ubuntu many times and have built Java and Go chaincodes.

 

Could you try on Ubuntu (Linux) and/or Java/Go?

 

 

On Wed, Nov 3, 2021 at 11:01 AM Belk, Taylor <Taylor.Belk@...> wrote:

Hello,

I am having issues with the tutorial, hoping you can help me out.

 

I am able to get through these sections:
Bring up the test network
The components of the test network
Creating a channel

just fine. I run into an issue here:
Starting a chaincode on the channel

 

I have tried just running
./network.sh deployCC

 

I’ve also tried running:
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript

AND

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

 

Both of which give this error:
<image001.png>

 

I am unable to find ANYTHING helpful for WINDOWS 10.

 

As you can see below I have installed all the pre-requisites:
<image002.png>

 

Please help as soon as possible.

 

Taylor Belk

Consultant

717 Texas Ave, Suite 1600 | Houston, TX 77002

M: 832-425-0496

<image003.png>     <image004.png>      <image005.png>     <image006.png>     <image007.png>   

<image008.png>

 



Re: Issues with Using the Fabric test network tutorial

Belk, Taylor
 

I’ve figured it out now thanks

 

From: J K <jsjkj434@...>
Sent: Thursday, November 4, 2021 11:37 AM
To: gqqnb2005@...; Belk, Taylor <Taylor.Belk@...>
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial

 

Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.

In that case you may try to run a VM on your windows machine and use ubuntu or any linux flavours inside of your virtualbox.

 

Cheers.

 

On Wednesday, 3 November, 2021, 09:58:39 pm IST, Belk, Taylor <taylor.belk@...> wrote:

 

 

Yea the problem with that is that our company does not support Linux so I don’t see that as a possibility.

 

From: fabric@... <fabric@...> On Behalf Of gqqnb2005 via lists.hyperledger.org
Sent: Wednesday, November 3, 2021 11:26 AM
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial

 

Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.

It looks like a docker issue. 

 

I have been using the test network on Ubuntu many times and have built Java and Go chaincodes.

 

Could you try on Ubuntu (Linux) and/or Java/Go?

 

 

On Wed, Nov 3, 2021 at 11:01 AM Belk, Taylor <Taylor.Belk@...> wrote:

Hello,

I am having issues with the tutorial, hoping you can help me out.

 

I am able to get through these sections:
Bring up the test network
The components of the test network
Creating a channel

just fine. I run into an issue here:
Starting a chaincode on the channel

 

I have tried just running
./network.sh deployCC

 

I’ve also tried running:
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript

AND

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

 

Both of which give this error:

 

I am unable to find ANYTHING helpful for WINDOWS 10.

 

As you can see below I have installed all the pre-requisites:

 

Please help as soon as possible.

 

Taylor Belk

Consultant

717 Texas Ave, Suite 1600 | Houston, TX 77002

M: 832-425-0496

                        

 


Re: Issues with Using the Fabric test network tutorial

J K
 

In that case you may try to run a VM on your windows machine and use ubuntu or any linux flavours inside of your virtualbox.

Cheers.

On Wednesday, 3 November, 2021, 09:58:39 pm IST, Belk, Taylor <taylor.belk@...> wrote:


Yea the problem with that is that our company does not support Linux so I don’t see that as a possibility.

 

From: fabric@... <fabric@...> On Behalf Of gqqnb2005 via lists.hyperledger.org
Sent: Wednesday, November 3, 2021 11:26 AM
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial

 

Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.

It looks like a docker issue. 

 

I have been using the test network on Ubuntu many times and have built Java and Go chaincodes.

 

Could you try on Ubuntu (Linux) and/or Java/Go?

 

 

On Wed, Nov 3, 2021 at 11:01 AM Belk, Taylor <Taylor.Belk@...> wrote:

Hello,

I am having issues with the tutorial, hoping you can help me out.

 

I am able to get through these sections:
Bring up the test network
The components of the test network
Creating a channel

just fine. I run into an issue here:
Starting a chaincode on the channel

 

I have tried just running
./network.sh deployCC

 

I’ve also tried running:
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript

AND

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

 

Both of which give this error:

 

I am unable to find ANYTHING helpful for WINDOWS 10.

 

As you can see below I have installed all the pre-requisites:

 

Please help as soon as possible.

 

Taylor Belk

Consultant

717 Texas Ave, Suite 1600 | Houston, TX 77002

M: 832-425-0496

                        

 


Re: Same organizations to different channels

Nikos Karamolegkos
 

Hello, due to the fact that I didn't get any response, I will be more specific.
My idea is to have N orgs which will participate (with all of there peers) in a new channel each time there is a request. The new channel will have a different chainode but the policies will remain the same. Ideally, I would like to achieve two things:
1) To use only one gateway client application (belonging to one of these N orgs) in order to have read and write access and read & update the ledger of each channel based on chaincodes. Can I do that? If yes, how I define inside the client in which channel do I want to invoke the transaction?
2) To make some simple management operation using the low level SDK. Such as operations are: i) create channel, ii) join the peers of orgs to the new channel, iii) delete channel (and remove the ledger from peers), iv)update chaincode of the channel. In the same ways are previous can I do that from one low level SDK client (which will operate as admin of the network)?

PS1: As I have seen I can join only a part of the totals peers of the org to the channel. What can I gain doing that?
PS2: Should the structure of the network (i.e number of channels) to be defined from the start? How easy is to extend the network using the same orgs?

Any advice is welcome!


Re: Issues with Using the Fabric test network tutorial

Dave
 

 
As you are on windows I would recommend you use WSL2 as your environment with docker installed in WSL2, I use this script to start it as WSL2 doesn't have systemd
 
# Start Docker daemon automatically when logging in if not running.
RUNNING=`ps aux | grep dockerd | grep -v grep`
if [ -z "$RUNNING" ]; then
    sudo dockerd > /dev/null 2>&1 &
    disown
fi


- Dave 
 
----- Original message -----
From: "Belk, Taylor" <taylor.belk@...>
Sent by: fabric@...
To: "gqqnb2005@..." <gqqnb2005@...>
Cc: "fabric@..." <fabric@...>
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial
Date: Wed, Nov 3, 2021 4:28 PM
 
Yea the problem with that is that our company does not support Linux so I don’t see that as a possibility. From: fabric@... <fabric@...> On Behalf Of gqqnb2005 via lists.hyperledger.org ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd

Yea the problem with that is that our company does not support Linux so I don’t see that as a possibility.

 

From: fabric@... <fabric@...> On Behalf Of gqqnb2005 via lists.hyperledger.org
Sent: Wednesday, November 3, 2021 11:26 AM
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial

 

Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.

It looks like a docker issue. 

 

I have been using the test network on Ubuntu many times and have built Java and Go chaincodes.

 

Could you try on Ubuntu (Linux) and/or Java/Go?

 

 

On Wed, Nov 3, 2021 at 11:01 AM Belk, Taylor <Taylor.Belk@...> wrote:

Hello,

I am having issues with the tutorial, hoping you can help me out.

 

I am able to get through these sections:
Bring up the test network
The components of the test network
Creating a channel

just fine. I run into an issue here:
Starting a chaincode on the channel

 

I have tried just running
./network.sh deployCC

 

I’ve also tried running:
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript

AND

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

 

Both of which give this error:

 

I am unable to find ANYTHING helpful for WINDOWS 10.

 

As you can see below I have installed all the pre-requisites:

 

Please help as soon as possible.

 

Taylor Belk

Consultant

717 Texas Ave, Suite 1600 | Houston, TX 77002

M: 832-425-0496

                        

 

 

 

Unless stated otherwise above:

IBM United Kingdom Limited - Registered in England and Wales with number 741598.

Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU



Re: #fabric-chaincode #fabric-chaincode

David Enyeart
 

Many people utilize JSON format for assets stored on the ledger, the order items can therefore be a JSON array. Just be careful to utilize deterministic JSON marshaling in your chaincode, as described here:
https://hyperledger-fabric.readthedocs.io/en/latest/chaincode4ade.html#json-determinism


Dave Enyeart


pham.qtpham---11/03/2021 08:04:04 AM---Hi , I am trying to map assets from Hyperledger composer to Hyperledger fabric V2. In Hyperledger co

From: pham.qtpham@...
To: fabric@...
Date: 11/03/2021 08:04 AM
Subject: [EXTERNAL] [Hyperledger Fabric] #fabric-chaincode
Sent by: fabric@...





Hi , I am trying to map assets from Hyperledger composer to Hyperledger fabric V2. In Hyperledger composer, there is model defined in .cto file, where I can have, e.g. asset Order identified by orderNumber { o String orderNumber ‍‍‍‍‍‍‍‍‍‍‍‍ZjQcmQRYFpfptBannerStart 
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Hi ,

I am trying to map assets from Hyperledger composer to Hyperledger fabric V2. In Hyperledger composer, there is model defined in .cto file, where I can have, e.g.


asset Order identified by orderNumber {

 
o String orderNumber
o String[] items
}

So the Order has items as an array. How can I achieve this in
Hyperledger fabric V2 ?

Thx in advance.

Trung
 





Anchor peer update failed, Consortium config value missing #fabric-orderer #fabric-peer #orderer #organizations #channel

gonzalo.bustos@...
 

Hello!

I wanted to create an easy-to-start local environment for my hyperledger-fabric network, so I created a script that only kills the network containers (all configuration, transaction and cert files remain) and then another script that re-starts the containers. When I restart them, I have to rejoin the organization peers to the channel, and I believe I should also update the anchor peers again for each organization.

I managed to rejoin the organization peers to the channel with little effort, but I'm getting an error when trying to update the Anchor Peers.

The error: Error: got unexpected status: BAD_REQUEST -- Consortium config value missing

That error pops up right after trying to update the anchor peers on the channel with the following command:
+ peer channel update -o localhost:7050 --ordererTLSHostnameOverride orderer.com -c prescriptionschannel -f ./channel-artifacts/MedicOrgMSPanchors.tx --tls --cafile /var/www/psh/medical-chain/medchain-network/organizations/ordererOrganizations/orderer.com/orderers/orderer.com/msp/tlscacerts/tlsca.orderer.com-cert.pem
resulting error code => 1
 
Thank you in advance!


Re: Issues with Using the Fabric test network tutorial

David F. D. Reis
 

Hi!

A good setup is to use vagrant with VSCode remote plugin for local dev env.

Best regards.


David

Em qua., 3 de nov. de 2021 às 13:28, Belk, Taylor <taylor.belk@...> escreveu:

Yea the problem with that is that our company does not support Linux so I don’t see that as a possibility.

 

From: fabric@... <fabric@...> On Behalf Of gqqnb2005 via lists.hyperledger.org
Sent: Wednesday, November 3, 2021 11:26 AM
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial

 

Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.

It looks like a docker issue. 

 

I have been using the test network on Ubuntu many times and have built Java and Go chaincodes.

 

Could you try on Ubuntu (Linux) and/or Java/Go?

 

 

On Wed, Nov 3, 2021 at 11:01 AM Belk, Taylor <Taylor.Belk@...> wrote:

Hello,

I am having issues with the tutorial, hoping you can help me out.

 

I am able to get through these sections:
Bring up the test network
The components of the test network
Creating a channel

just fine. I run into an issue here:
Starting a chaincode on the channel

 

I have tried just running
./network.sh deployCC

 

I’ve also tried running:
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript

AND

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

 

Both of which give this error:

 

I am unable to find ANYTHING helpful for WINDOWS 10.

 

As you can see below I have installed all the pre-requisites:

 

Please help as soon as possible.

 

Taylor Belk

Consultant

717 Texas Ave, Suite 1600 | Houston, TX 77002

M: 832-425-0496

                        

 



--
David Reis
@davidfaulstich (Instagram)
@davidfdr (Github)



Re: Issues with Using the Fabric test network tutorial

Chris Gabriel <alaskadd@...>
 

I'll try to replicate on my Windows 10 box and let you know.  For normal dev I use MacOSx.

On Nov 3, 2021, at 11:28 AM, Belk, Taylor <taylor.belk@...> wrote:

Yea the problem with that is that our company does not support Linux so I don’t see that as a possibility.
 
From: fabric@... <fabric@...> On Behalf Of gqqnb2005 via lists.hyperledger.org
Sent: Wednesday, November 3, 2021 11:26 AM
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial
 
Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.
It looks like a docker issue.  
 
I have been using the test network on Ubuntu many times and have built Java and Go chaincodes.
 
Could you try on Ubuntu (Linux) and/or Java/Go?
 
 
On Wed, Nov 3, 2021 at 11:01 AM Belk, Taylor <Taylor.Belk@...> wrote:
Hello,
I am having issues with the tutorial, hoping you can help me out.
 
I am able to get through these sections:
Bring up the test network
The components of the test network
Creating a channel

just fine. I run into an issue here:
Starting a chaincode on the channel
 
I have tried just running
./network.sh deployCC
 
I’ve also tried running:
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript
AND
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go
 
Both of which give this error:
<image001.png>
 
I am unable to find ANYTHING helpful for WINDOWS 10.
 
As you can see below I have installed all the pre-requisites:
<image002.png>
 
Please help as soon as possible.
 
Taylor Belk
Consultant
717 Texas Ave, Suite 1600 | Houston, TX 77002
M: 832-425-0496

<image003.png>     <image004.png>      <image005.png>     <image006.png>     <image007.png>   

<image008.png>

 



Re: Issues with Using the Fabric test network tutorial

Belk, Taylor
 

Yea the problem with that is that our company does not support Linux so I don’t see that as a possibility.

 

From: fabric@... <fabric@...> On Behalf Of gqqnb2005 via lists.hyperledger.org
Sent: Wednesday, November 3, 2021 11:26 AM
Cc: fabric@...
Subject: Re: [Hyperledger Fabric] Issues with Using the Fabric test network tutorial

 

Caution: This email originated from outside Capco. Do not click links or open attachments unless you recognize the sender and know the content is safe.

It looks like a docker issue. 

 

I have been using the test network on Ubuntu many times and have built Java and Go chaincodes.

 

Could you try on Ubuntu (Linux) and/or Java/Go?

 

 

On Wed, Nov 3, 2021 at 11:01 AM Belk, Taylor <Taylor.Belk@...> wrote:

Hello,

I am having issues with the tutorial, hoping you can help me out.

 

I am able to get through these sections:
Bring up the test network
The components of the test network
Creating a channel

just fine. I run into an issue here:
Starting a chaincode on the channel

 

I have tried just running
./network.sh deployCC

 

I’ve also tried running:
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript -ccl javascript

AND

./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go -ccl go

 

Both of which give this error:

 

I am unable to find ANYTHING helpful for WINDOWS 10.

 

As you can see below I have installed all the pre-requisites:

 

Please help as soon as possible.

 

Taylor Belk

Consultant

717 Texas Ave, Suite 1600 | Houston, TX 77002

M: 832-425-0496