This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var channel = fabric_client.newChannel('mychannel'); | |
var peer = fabric_client.newPeer('grpc://localhost:7051'); | |
channel.addPeer(peer); | |
var order = fabric_client.newOrderer('grpc://localhost:7050') | |
channel.addOrderer(order); | |
var member_user = null; | |
var store_path = path.join(__dirname, 'hfc-key-store'); | |
console.log('Store path:'+store_path); | |
var tx_id = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var channel = fabric_client.newChannel('mychannel'); | |
var peer = fabric_client.newPeer('grpc://localhost:7051'); | |
channel.addPeer(peer); | |
var order = fabric_client.newOrderer('grpc://localhost:7050') | |
channel.addOrderer(order); | |
var member_user = null; | |
var store_path = path.join(__dirname, 'hfc-key-store'); | |
console.log('Store path:'+store_path); | |
var tx_id = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -sSL | |
https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.2.0 | |
ls | |
cd fabric-samples/ | |
cd bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd first-network/ | |
./byfn.sh -h | |
./byfn.sh generate | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./byfn.sh up // Turns on the network | |
./byfn.sh down // Shuts down the network | |
./byfn.sh generate // Generates a new network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls channel-artifacts | |
ls crypto-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Fabric_Client = require('fabric-client'); | |
var path = require('path'); | |
var util = require('util'); | |
var os = require('os'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var channel = fabric_client.newChannel('mychannel'); | |
var peer = fabric_client.newPeer('grpc://localhost:7051'); | |
channel.addPeer(peer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = { | |
//targets : --- letting this default to the peers assigned to the channel | |
chaincodeId: 'fabcar', | |
fcn: 'queryAllCars', | |
args: [''] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async queryAllCars(stub, args) { | |
let startKey = 'CAR0'; | |
let endKey = 'CAR999'; | |
let iterator = await stub.getStateByRange(startKey, endKey); | |
let allResults = []; | |
while (true) { | |
let res = await iterator.next(); |
OlderNewer