Date   

Re: two channels with the same chaincode

Matthew White
 

Hello,

 

The label is packaged with the chaincode, and is used to prefix a sha hash  of the packaged file this makes the “packageid” (aka “chaincodeid”).

 

The chaincode name isn’t in the packaged code, and is associated with the package id at approval time.

More than one chaincode name can be associated with the same packageid/chaincodeid.

 

Within the context a single peer, it will have/expect running chaincode ‘images’ on a 1:1 basis with the chaincodeids.

 

The same chaincode name *should* be usable on different channels irrespective of peer… have you seen differently?

 

Thanks Matthew

From: fabric@... <fabric@...> On Behalf Of Nikos Karamolegkos
Sent: 07 September 2022 09:34
To: fabric@...
Subject: [EXTERNAL] Re: [Hyperledger Fabric] two channels with the same chaincode

 

Also, If I have already packaged my chaincode to tar. gz file with PACKAGE_ID= abcdf and I would like to use the same chaincode to a new channel (same chaincode functionality but different chaincode name and label - given that I can not use the

ZjQcmQRYFpfptBannerStart

This Message Is From an External Sender

This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

Also, If I have already packaged my chaincode to tar.gz file with PACKAGE_ID= abcdf and I would like to use the same chaincode to a new channel (same chaincode functionality but different chaincode name and label - given that I can not use the same chaincode name to different channels where the same peers are joined -) I have to package it again (i.e create new tar.gz file). Correct?

Unless otherwise stated above:

IBM United Kingdom Limited
Registered in England and Wales with number 741598
Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU


Re: two channels with the same chaincode

Nikos Karamolegkos
 

Also, If I have already packaged my chaincode to tar.gz file with PACKAGE_ID= abcdf and I would like to use the same chaincode to a new channel (same chaincode functionality but different chaincode name and label - given that I can not use the same chaincode name to different channels where the same peers are joined -) I have to package it again (i.e create new tar.gz file). Correct?


Now: Private Chaincode Lab - 09/06/2022 #cal-notice

Group Notification <noreply@...>
 

Private Chaincode Lab

When:
09/06/2022
8:00am to 9:00am
(UTC-07:00) America/Los Angeles

Where:
https://zoom.us/my/hyperledger.community.3?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09

Organizer: Marcus Brandenburger bur@...

View Event

Description:
Two of the Hyperleger Labs projects (private data objects and private chain code) are collaborating to develop a "private smart contracts" capability.

Join Zoom Meeting https://zoom.us/j/5184947650?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09 Meeting ID: 518 494 7650 Passcode: 475869


Re: two channels with the same chaincode

Nikos Karamolegkos
 

I think it is better to get the second option. I don't know which builder I am using. I deploy the chaincode as a service


Re: two channels with the same chaincode

Matthew White
 

Hello;

 

Could you just confirm which chaincode builder you are using?  There are a few different ones 😊

 

Essentially I think you’ve two options

 

  • Use the same chaincode docker image, but when it’s launched in K8S set an environment variable on the deployment. That could be used to switch the logic inside the code
  • When transactions are sent to the, add another argument to the transactions you call. Thereby switching your logic (using the new value

 

 

Cheers, Matthew

From: fabric@... <fabric@...> On Behalf Of Nikos Karamolegkos
Sent: 05 September 2022 10:47
To: fabric@...
Subject: [EXTERNAL] Re: [Hyperledger Fabric] two channels with the same chaincode

 

function or parameter? Can you give me an example? _. _,_. _,_ Links: You receive all messages sent to this group. View/Reply Online (#11449) | Reply To Sender | Reply To Group | Mute This Topic | New Topic Your Subscription ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍

ZjQcmQRYFpfptBannerStart

This Message Is From an External Sender

This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

function or parameter? Can you give me an example?

Unless otherwise stated above:

IBM United Kingdom Limited
Registered in England and Wales with number 741598
Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU


Re: two channels with the same chaincode

Nikos Karamolegkos
 

function or parameter? Can you give me an example?


Re: two channels with the same chaincode

Yacov
 

why not just pass the parameter as a function into the same chaincode?

From: fabric@... <fabric@...> on behalf of Nikos Karamolegkos <nkaram@...>
Sent: Monday, September 5, 2022 11:42 AM
To: fabric@... <fabric@...>
Subject: [EXTERNAL] Re: [Hyperledger Fabric] two channels with the same chaincode
 
I am using hlf-operator with the chaincode builder. Thank you for your proposals. So I have to keep one chaincode pod per channel although the functionality of the chaincodes are the same. Correct? Let me extend my question. Let's say that I
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd
I am using hlf-operator with the chaincode builder. Thank you for your proposals. So I have to keep one chaincode pod per channel although the functionality of the chaincodes are the same. Correct? Let me extend my question. Let's say that I have two channels that use exactly the same chaincode code (i.e same functionality) but there is a small difference to a value of the code (e.g chaincode 1 has threshold value=10, chaincode 2 has threshold value=20), thus can I have  a docker image in order to create two different pods where the threshold value can be set by a ENV? In order to avoid build the same image again again just because one variable changed


Re: two channels with the same chaincode

Nikos Karamolegkos
 

I am using hlf-operator with the chaincode builder. Thank you for your proposals. So I have to keep one chaincode pod per channel although the functionality of the chaincodes are the same. Correct? Let me extend my question. Let's say that I have two channels that use exactly the same chaincode code (i.e same functionality) but there is a small difference to a value of the code (e.g chaincode 1 has threshold value=10, chaincode 2 has threshold value=20), thus can I have  a docker image in order to create two different pods where the threshold value can be set by a ENV? In order to avoid build the same image again again just because one variable changed


Hyperledger Fabric Offline Private Key Transaction Signing Flow #fabric #fabric-sdk-node #fabric-offline-tx-signing #hyperledger-fabric

Kavin Arumugam
 

Hi Fabric Community,

I'm exploring the offline transaction signing flow in hyperledger fabric by using Fabric Node SDK.
I came across the following official tutorial. 
https://hyperledger.github.io/fabric-sdk-node/release-2.2/tutorial-sign-transaction-offline.html
In my view, the above tutorial explains the process in a abstract manner.
Also, I'm not able to find the resource/code which will be helpful for me to see the demo of offline private key Tx Signing.
I'm sharing my learnings here. so that, it will be helpful for the fabric community.

Following is the sample code to start with Offline Transaction Signing in Fabric:
Note: Before running the following code, test-network must be up and also the Private Key & CSR must be created (see below for detailed steps)

Fabric Network BringUp, CreateChannel, Deploy Chaincode and Invoke & Query Chaincode in CLI:
Navigate to test-network folder in your fabric-samples repository. Then Execute the following commands in a CLI.

. env.sh

./network.sh up createChannel -ca

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

export PATH=${PWD}/../bin:$PATH

export FABRIC_CFG_PATH=$PWD/../config/

export CORE_PEER_TLS_ENABLED=true

export CORE_PEER_LOCALMSPID="Org1MSP"

export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt

export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/Admin@.../msp

export CORE_PEER_ADDRESS=localhost:7051

peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n basic --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" -c '{"function":"InitLedger","Args":[]}'

peer chaincode query -C mychannel -n basic -c '{"Args":["GetAllAssets"]}'



Generating Private Key and Creating CSR:

IMP: CSR must contain the information "common name" and the "common name" must be same as the "enrollmentID" at the register step with CA

openssl ecparam -name prime256v1 -genkey -noout -out private-key.pem

 

openssl req -new -sha256 -key private-key.pem -out csr.pem



Dependencies:

"dependencies": {
"elliptic": "^6.5.4",
"fabric-ca-client": "^2.2.14",
"fabric-common": "^2.2.14",
"fabric-network": "^2.2.14",
"jsrsasign": "^10.5.27"
}




Steps for Offline Private Key Tx Signing Flow:

1) Registering an Identity with CA

2) Creating Private Key and CSR for an Identity

3) Enrolling an Identity with CA but with "csr" parameter. 

4) Storing the identity in the Wallet

5) Prepare Key for Signing

6) Create Client, Channel, User, Identity Context

7) Creating Endorsement Proposal (Build Proposal for a specific Chaincode with IdentityContext and BuildOptions)

8) Hashing the Proposal Bytes with "sha256" Algorithm and with "hex" encoding

9) Creating Signature by signing the "hash" with "key"

10) Form Endorserer Objects

11) Finally, Sign the endorsement with "Signature" we created in step-9, and send to Target Endorsers

12) Form Committer Objects

13) Create new commit using endorsement, build, sign and send to Targets for "committing"



SAMPLE CODE:

/*
* Copyright IBM Corp. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/

'use strict';

const FabricCAServices = require('fabric-ca-client');
const { Wallets } = require('fabric-network');
const {Client, User, Endorser, DiscoveryService, Discoverer, Committer} = require('fabric-common');
const fs = require('fs');
const path = require('path');

const elliptic = require('elliptic');
const { KEYUTIL } = require('jsrsasign');
const crypto = require('crypto');

async function main() {
try {


const enrollmentID = 'testUser'
var userEnrollmentSecret = 'testUserpw';
var userEnrollment;


// load the network configuration
const ccpPath = path.resolve(__dirname, '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');
const ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));

// Create a new CA client for interacting with the CA.
const caInfo = ccp.certificateAuthorities['ca.org1.example.com'];
const caTLSCACerts = caInfo.tlsCACerts.pem;
const ca = new FabricCAServices(caInfo.url, { trustedRoots: caTLSCACerts, verify: false }, caInfo.caName);

// Create a new file system based wallet for managing identities.
const walletPath = path.join(process.cwd(), 'wallet');
const wallet = await Wallets.newFileSystemWallet(walletPath);
console.log(`Wallet path: ${walletPath}`);

// Check to see if we've already enrolled an user.
const userIdentity = await wallet.get(enrollmentID);
if(userIdentity){
console.log('An identity for an user already exists in the wallet');
// Need to do: userEnrollment = userIdentity.getEnrollmentCertificate;

} else {

// Check to see if we've already enrolled the admin user.
const adminIdentity = await wallet.get('admin');
if (!adminIdentity) {
console.log('An identity for the admin user "admin" does not exists in the wallet. Enrolling Now...');
// Enroll the admin user, and import the new identity into the wallet.
const enrollment = await ca.enroll({ enrollmentID: 'admin', enrollmentSecret: 'adminpw' });
const x509Identity = {
credentials: {
certificate: enrollment.certificate,
privateKey: enrollment.key.toBytes(),
},
mspId: 'Org1MSP',
type: 'X.509',
};
await wallet.put('admin', x509Identity);
console.log('Successfully enrolled admin user "admin" and imported it into the wallet');
}

const adminId = await wallet.get('admin');
// build a user object for authenticating with the CA
const provider = wallet.getProviderRegistry().getProvider(adminId.type);
const adminUser = await provider.getUserContext(adminId, 'admin');

// Register the user
const userEnrollSecret = await ca.register({
affiliation: 'org1.department1',
enrollmentID: enrollmentID,
enrollmentSecret: userEnrollmentSecret,
role: 'client'
}, adminUser);

// Read CSR from File system
const csr = fs.readFileSync('csr.pem', 'utf8');
const req = {
enrollmentID: enrollmentID,
enrollmentSecret: userEnrollmentSecret,
csr: csr,
};
// Enroll the user with CSR, and import the new identity into the wallet.
userEnrollment = await ca.enroll(req);
const x509Identity = {
credentials: {
certificate: userEnrollment.certificate
},
mspId: 'Org1MSP',
type: 'X.509',
};


await wallet.put(enrollmentID, x509Identity);
console.log('Successfully enrolled an User and imported it into the wallet');
console.log(userEnrollment.certificate)
console.log(userEnrollment.key)

}

 
// This is a sample code for signing the digest from step 2 with EC.
// Different signature algorithm may have different interfaces
// ECDSA -- ASN1 OID: prime256v1 -- NIST CURVE: P-256 -- Signature Algorithm: ecdsa-with-SHA256 --

const privateKeyPEM = fs.readFileSync("private-key.pem", "utf8");
console.log("My key is: ", privateKeyPEM);
const { prvKeyHex } = KEYUTIL.getKey(privateKeyPEM); // convert the pem encoded key to hex encoded private key

const EC = elliptic.ec;
const ecdsaCurve = elliptic.curves['p256'];

const ecdsa = new EC(ecdsaCurve);
const signKey = ecdsa.keyFromPrivate(prvKeyHex, 'hex');


// Creating Client, Identity Context, etc
const client = new Client('myclient');
const channel = client.newChannel('mychannel');
const user = User.createUser(enrollmentID, userEnrollmentSecret, 'Org1MSP', userEnrollment.certificate, privateKeyPEM);
const idx = client.newIdentityContext(user);

// To get Service Discovery Results if suppose we need to get dynamic Peer and Orderer Info
// Right now - static peer and orderer objects were used
const discoverer = new Discoverer("peer0", client, "Org1MSP");
const endpoint = client.newEndpoint({
url: 'grpcs://localhost:7051',
pem : '-----BEGIN CERTIFICATE-----\n' +
'MIICJzCCAc2gAwIBAgIUa10ti6LkZFxoLszlnVvzkNdS3OAwCgYIKoZIzj0EAwIw\n' +
'cDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\n' +
'EwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\n' +
'Lm9yZzEuZXhhbXBsZS5jb20wHhcNMjIwOTA0MDExOTAwWhcNMzcwODMxMDExOTAw\n' +
'WjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\n' +
'BAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\n' +
'Y2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFrx\n' +
'H9SZ/D8HKPDbrg3YY2Q+qyj5Dw/kHKcH4PErUNUNssLEi1SkovkgWda1sxcNpBCi\n' +
'NgnykaU3tMuMcvBm3MyjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\n' +
'AQH/AgEBMB0GA1UdDgQWBBTtq/lyW3VgSOAsty21Q5/4f/k4OTAKBggqhkjOPQQD\n' +
'AgNIADBFAiEA7PFPsmyplE991kF25h+UmscOA1xqDPsYxIAL4QEjXK4CIHxDyUjG\n' +
'RCtIvuZbtg80j2Rtchn+shF5afcIJqCzbcqI\n' +
'-----END CERTIFICATE-----\n',
"ssl-target-name-override" : 'peer0.org1.example.com',
requestTimeout: 3000
});
discoverer.setEndpoint(endpoint);
// await discoverer.connect()


const discovery = new DiscoveryService("basic", channel);
// const endorsement1 = channel.newEndorsement("basic");
// discovery.build(idx, {endorsement: endorsement1});
discovery.build(idx);
discovery.sign(idx);

const discovery_results = await discovery.send({targets: [discoverer], asLocalhost: true});
console.log(JSON.stringify(discovery_results))

 

// Creating Proposal
const endorsement = channel.newEndorsement("basic");
const build_options = {fcn: 'TransferAsset', args: ['asset2', 'Kavin']};
const proposalBytes = endorsement.build(idx, build_options);


// Calculate Hash for transaction Proposal Bytes
const hash = crypto.createHash('sha256').update(proposalBytes).digest('hex');


// Creating Signature
const sig = ecdsa.sign(Buffer.from(hash, 'hex'), signKey, { canonical: true });
const signature = Buffer.from(sig.toDER());
console.log('signature:', signature)

// Endorserer Objects
const peer0Org1Endorser = new Endorser("peer0Org1", client, "Org1MSP");
const peer0Org1Endpoint = client.newEndpoint({
url: 'grpcs://localhost:7051',
pem : '-----BEGIN CERTIFICATE-----\n' +
'MIICJzCCAc2gAwIBAgIUa10ti6LkZFxoLszlnVvzkNdS3OAwCgYIKoZIzj0EAwIw\n' +
'cDELMAkGA1UEBhMCVVMxFzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMQ8wDQYDVQQH\n' +
'EwZEdXJoYW0xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\n' +
'Lm9yZzEuZXhhbXBsZS5jb20wHhcNMjIwOTA0MDExOTAwWhcNMzcwODMxMDExOTAw\n' +
'WjBwMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xpbmExDzANBgNV\n' +
'BAcTBkR1cmhhbTEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMT\n' +
'Y2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFrx\n' +
'H9SZ/D8HKPDbrg3YY2Q+qyj5Dw/kHKcH4PErUNUNssLEi1SkovkgWda1sxcNpBCi\n' +
'NgnykaU3tMuMcvBm3MyjRTBDMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAG\n' +
'AQH/AgEBMB0GA1UdDgQWBBTtq/lyW3VgSOAsty21Q5/4f/k4OTAKBggqhkjOPQQD\n' +
'AgNIADBFAiEA7PFPsmyplE991kF25h+UmscOA1xqDPsYxIAL4QEjXK4CIHxDyUjG\n' +
'RCtIvuZbtg80j2Rtchn+shF5afcIJqCzbcqI\n' +
'-----END CERTIFICATE-----\n',
"ssl-target-name-override" : 'peer0.org1.example.com',
requestTimeout: 3000
});

peer0Org1Endorser.setEndpoint(peer0Org1Endpoint);
await peer0Org1Endorser.connect();
console.log("peer0Org1Endorser status: ", await peer0Org1Endorser.checkConnection())


const peer0Org2Endorser = new Endorser("peer0Org2", client, "Org2MSP");
const peer0Org2Endpoint = client.newEndpoint({
url: 'grpcs://localhost:9051',
pem : '-----BEGIN CERTIFICATE-----\n' +
'MIICHzCCAcWgAwIBAgIUHcDOiu0zeZoOuyE20TgmAIAeahEwCgYIKoZIzj0EAwIw\n' +
'bDELMAkGA1UEBhMCVUsxEjAQBgNVBAgTCUhhbXBzaGlyZTEQMA4GA1UEBxMHSHVy\n' +
'c2xleTEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eub3Jn\n' +
'Mi5leGFtcGxlLmNvbTAeFw0yMjA5MDQwMTE5MDBaFw0zNzA4MzEwMTE5MDBaMGwx\n' +
'CzAJBgNVBAYTAlVLMRIwEAYDVQQIEwlIYW1wc2hpcmUxEDAOBgNVBAcTB0h1cnNs\n' +
'ZXkxGTAXBgNVBAoTEG9yZzIuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2NhLm9yZzIu\n' +
'ZXhhbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASuc9tSZ1VhaGCL\n' +
'Z6msge/UIo4jcn1vwpvgQ7Ih8h9FpypQeYqY5DNWLIzgMRD13wSQK8smvfcWQuW1\n' +
'SqNzQu9Po0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBATAd\n' +
'BgNVHQ4EFgQUzIcp1SbKBNLz3owIypQlg4Z5QdwwCgYIKoZIzj0EAwIDSAAwRQIh\n' +
'AILfLS4GgZYWVtR+MF25xrYRtkAkDhsNKZgsBzKlmHn0AiAmGDRBQ+JhcrOuiORn\n' +
'ghA0uKRpUa/JQbihG85bbXm1Kw==\n' +
'-----END CERTIFICATE-----\n',
"ssl-target-name-override" : 'peer0.org2.example.com',
requestTimeout: 3000
});

peer0Org2Endorser.setEndpoint(peer0Org2Endpoint);
await peer0Org2Endorser.connect();
console.log("peer0Org2Endorser status: ", await peer0Org2Endorser.checkConnection())


// Final - Sending Proposal Request
endorsement.sign(signature);
const proposalResponses = await endorsement.send({targets : [peer0Org1Endorser, peer0Org2Endorser]});
console.log(proposalResponses.responses);
 
 
// Committer Objects
const newCommitter = new Committer("orderer.example.com", client, "OrdererMSP");
const newCommitterEndpoint = client.newEndpoint({
url: 'grpcs://localhost:7050',
pem : '-----BEGIN CERTIFICATE-----\n' +
'MIICCzCCAbGgAwIBAgIUDI2rLaEJAyTPibHGw4xk3gXALnYwCgYIKoZIzj0EAwIw\n' +
'YjELMAkGA1UEBhMCVVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcg\n' +
'WW9yazEUMBIGA1UEChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUu\n' +
'Y29tMB4XDTIyMDkwNDAxMTkwMFoXDTM3MDgzMTAxMTkwMFowYjELMAkGA1UEBhMC\n' +
'VVMxETAPBgNVBAgTCE5ldyBZb3JrMREwDwYDVQQHEwhOZXcgWW9yazEUMBIGA1UE\n' +
'ChMLZXhhbXBsZS5jb20xFzAVBgNVBAMTDmNhLmV4YW1wbGUuY29tMFkwEwYHKoZI\n' +
'zj0CAQYIKoZIzj0DAQcDQgAEUneOJ/VC/2dZkkVJqtrHo+8hBkLnRnxoCQI0y+Sh\n' +
'yrFErNiL7XHCbHRglIoULixoGdcLCo2COOhQrHfMjyc7TqNFMEMwDgYDVR0PAQH/\n' +
'BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFK7gKwF7q/ByOeyr\n' +
'd/qev66CN8OfMAoGCCqGSM49BAMCA0gAMEUCIQDulgwk7Nt/U92BB2QSEdDx6hG+\n' +
'SBypZMmV7o5RWUugMAIgUaQuk9g9g+s1BtbFvlRTfmBP2oaZZiKPp2+iKVfzE+4=\n' +
'-----END CERTIFICATE-----\n',
"ssl-target-name-override" : 'orderer.example.com',
requestTimeout: 3000
});

newCommitter.setEndpoint(newCommitterEndpoint);
await newCommitter.connect();
console.log("Committer Connection Status: ", await newCommitter.checkConnection())


// Commit the Transaction
const commitReq = endorsement.newCommit();
commitReq.build(idx);
commitReq.sign(idx);
const res = await commitReq.send({targets : [newCommitter]});

console.log("Commit Result: ", res)



} catch (error) {
console.error(`Failed to enroll admin user "admin": ${error}`);
process.exit(1);
}
}

main();


Re: Archival solution in hyperledger fabric #fabric-peer #fabric

Chandramohan Jagtap
 

Hi Shweta,

Yes, The solution works with fabric 2.4+, be careful, There should be at least one peer who has access to the full ledger. Also, go through the limitation. The major limitation is that you won't be able to query the previous assets, and the History functionality won't work with the older blocks(Not present in the snapshot) peer.

Thanks & Regards,                                        
Chandramohan Jagtap

On Thu, Sep 1, 2022 at 4:26 PM Kumari Shweta via lists.hyperledger.org <kumari.shweta=hcl.com@...> wrote:
 
 
Pls confirm if below solution works for hlf 2.4 as i have gone throgh 
 
Assumption: Lets we have 20000 blocks in network
 
Step1: snapshot of ledger from 15000 block and crate an new peer,this new peer have last 5000 blocks and then have the new blocks
Step2 -update anchor peer in the channel to the newly created peer.
 
Step3 : bring dwon the old peer

Regards,
Shweta
 


Event: Documentation Workgroup monthly call - 09/02/2022 #cal-reminder

Group Notification <noreply@...>
 

Reminder: Documentation Workgroup monthly call

When:
09/02/2022
11:00am to 12:00pm
(UTC-04:00) America/New York

Where:
https://zoom.us/my/hyperledger.community.3?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09

Organizer: Josh Horton joshh@...

View Event

Description:
Schedule, Agendas, Minutes, etc: https://wiki.hyperledger.org/display/fabric/Documentation+Working+Group


Re: two channels with the same chaincode

jkneubuh@...
 

Hi Nikos,

Sharing the CCaaS endpoint across multiple channels is asking for trouble.  It _may_ work, but it seems like it's an invitation for unexpected problems if and when the states collide across the peer's notion of chaincode scope.

As an alternate option... strongly consider migrating from CCaaS to the new Kubernetes Chaincode Builder to help keep everything organized.  This will allow you to prepare one docker image and one chaincode package (bound to the immutable layer digest for the routine) for your smart contract.   The k8s-builder does a good job of juggling and sorting out pods based on the org, cc label, channel, etc. at which the contract is committed to the ledger.

Some notes on the k8s-builder CC installation flow are available at the Full Stack Asset Transfer Guide, illustrating in one case how a contract package can be published to a web server and linked to a Docker build pipeline.

Also note that the k8s-builder is supported natively by the modern k8s operators, both fabric-operator and hlf-operator provide built-in support for the new CC deployment mechanisms.

-josh


Archival solution in hyperledger fabric #fabric-peer #fabric

Kumari Shweta
 

 
 
Pls confirm if below solution works for hlf 2.4 as i have gone throgh 
https://hyperledger-fabric.readthedocs.io/en/release-2.3/peer_ledger_snapshot.html
 
Assumption: Lets we have 20000 blocks in network
 
Step1: snapshot of ledger from 15000 block and crate an new peer,this new peer have last 5000 blocks and then have the new blocks
Step2 -update anchor peer in the channel to the newly created peer.
 
Step3 : bring dwon the old peer

Regards,
Shweta
 


Re: two channels with the same chaincode

Nikos Karamolegkos
 

Any help on that?


Now: Private Chaincode Lab - 08/30/2022 #cal-notice

Group Notification <noreply@...>
 

Private Chaincode Lab

When:
08/30/2022
8:00am to 9:00am
(UTC-07:00) America/Los Angeles

Where:
https://zoom.us/my/hyperledger.community.3?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09

Organizer: Marcus Brandenburger bur@...

View Event

Description:
Two of the Hyperleger Labs projects (private data objects and private chain code) are collaborating to develop a "private smart contracts" capability.

Join Zoom Meeting https://zoom.us/j/5184947650?pwd=UE90WHhEaHRqOGEyMkV3cldKa2d2dz09 Meeting ID: 518 494 7650 Passcode: 475869


Re: Hyperledger Fabric Consensus update

Yacov
 

It's a complicated answer, and it has to do with priorities I guess?

I can say that we're currently working on bringing SmartBFT into Fabric.

Wait a couple of months...

From: Ahmed Alsalih <a.alsalih2@...>
Sent: Monday, August 29, 2022 7:36 AM
To: Yacov Manevich <YACOVM@...>
Cc: fabric@... <fabric@...>
Subject: [EXTERNAL] Re: [Hyperledger Fabric] Hyperledger Fabric Consensus update
 
Hi Yacov, I need your help or anyone might know! with those questions . 1- Why the first PBFT protocol get deprecated. 2- Why the Smart BFT not being listed till now as official BFT consensus in Fabric repository. Thanks ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd
Hi Yacov,
I need your help or anyone might know! with those questions .
1- Why the first PBFT protocol get deprecated.
2- Why the Smart BFT not being listed till now as official BFT consensus in Fabric repository.

Thanks
Best Regards
Ahmed Al Salih
Sr. Software Engineer/Tech lead
Ph.D. CS cybersecurity. MS of IT, BS of CS
a.alsalih2@... | 603-289-9431 cell
Charlotte, NC

--
Best Regards
Ahmed Al Salih
Sr. Software Engineer/Tech lead
Ph.D. CS cybersecurity. MS of IT, BS of CS
a.alsalih2@... | 603-289-9431 cell
Charlotte, NC


Re: Hyperledger Fabric Consensus update

Ahmed Al Salih
 

Hi Yacov,
I need your help or anyone might know! with those questions .
1- Why the first PBFT protocol get deprecated.
2- Why the Smart BFT not being listed till now as official BFT consensus in Fabric repository.

Thanks

Best Regards
Ahmed Al Salih
Sr. Software Engineer/Tech lead
Ph.D. CS cybersecurity. MS of IT, BS of CS
a.alsalih2@... | 603-289-9431 cell
Charlotte, NC

--
Best Regards
Ahmed Al Salih
Sr. Software Engineer/Tech lead
Ph.D. CS cybersecurity. MS of IT, BS of CS
a.alsalih2@... | 603-289-9431 cell
Charlotte, NC


Blockchain consensus

Imran Bashir
 

Hi Hyperledger community
I am happy to announce the publication of my new book "Blockchain Consensus An Introduction to Classical, Blockchain, and Quantum Consensus Protocols". I hope this book will provide insights to the community members and a wider audience who want to understand this fascinating subject. I hope you find this book useful.
many thanks
Regards
Imran

image.png


Fabric Full Stack Development Workshop / Fabric Open Stack

jkneubuh@...
 

Ahoy, Fabric!

Running sample applications with the test network (Docker compose) has been a great way to get started working with Fabric clients, chaincode, and operations.  One of the challenges with the test network is that it presents a very steep learning curve and onramp for Fabric.  It's ... "too hard."  
 
As a supplement to the test network, we've started an effort to assemble a Fabric Open Stack environment illustrating the best practices (circa ~2.4) for assembling blockchains in a cloud native, developer-friendly, production-ready, and 100% open-source fashion.

The three pillars of Fabric Open Stack include: 
 
  • Lightweight, rapid, step-debug local development with microfab, supplemented with virtual k8s clusters.

  • Gateway Client (new in 2.4) Application development 

  • Cloud Native deployment practices with k8s, fabric-operator, and the new k8s-chaincode builder.
While this project is still a work in progress (not an official fabric-sample), we'd love to hear your input, feedback, and community contributions on the approach.  And if you will be attending next month's Hyperledger Global Forum, please join us for an interactive session and workshop highlighting the Full Stack Asset Transfer Guide in action, in person, in Dublin.

Thank you all, and happy coding!

Cheers,
-josh



Data structure #chaincode

FemGeek
 

Can you explain to me how to port data to the blockchain.  I have a large set of data ( like medical data) that needs to go onto the ledger.  I need to know if formatting this data in a JSON format a good decision.  And exactly how do I streamline this data to the chaincode.  And what configurations needs to be made to accommodate this data being processed on the blockchain, (i.e. ordering peer).

161 - 180 of 11527