
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
fabric-sdk-config
Advanced tools
Package for creating and modifying Fabric SDK node
Install with npm:
$ npm install --save fabric-sdk-config
var fabConf = require('fabric-sk-config');
Parameters:
let networkConfig = new fabConf.NetworkConfig("supply", "1.0", "supply", "hlfv1");
Create and add Peer
Parameters:
Variation 1 - create a Peer instance and pass it to the 'addPeer' method of the NetworkConfig class instance
let peer0 = new fabConf.NetworkConfig.Peer(
"peer0.org1.example.com",
"grpcs://localhost:7051",
{"ssl-target-name-override": "peer0.org1.example.com"},
{path: "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"}
//or string "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
);
networkConfig.addPeer(peer0);
Or variation 2 - pass the parameters directly to the 'addPeer' method
networkConfig.addPeer(
"peer0.org1.example.com",
"grpcs://localhost:7051",
{"ssl-target-name-override": "peer0.org1.example.com"},
{path: "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"} //or string "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
);
Create and add Orderer
Parameters:
Variation 1 - create a Orderer instance and pass it to the 'addOrderer' method of the NetworkConfig class instance
let orderer = new fabConf.NetworkConfig.Orderer(
"orderer.example.com",
"grpcs://localhost:7050",
{"ssl-target-name-override": "orderer.example.com"},
{path: "artifacts/channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"} //or string "artifacts/channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"
);
networkConfig.addOrderer(orderer);
Or variation 2 - pass the parameters directly to the 'addOrderer' method
networkConfig.addOrderer(
"orderer.example.com",
"grpcs://localhost:7050",
{"ssl-target-name-override": "orderer.example.com"},
{path: "artifacts/channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"} //or string "artifacts/channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt"
);
Create and add Organization
Parameters:
Variation 1 - create a Organization instance and pass it to the 'addOrganization' method of the NetworkConfig class instance
let organization = new fabConf.NetworkConfig.Organization(
"Org1",
"Org1MSP",
peer0, // instance of Peer. or [peer0, peer1, peer2...] or "peer0.org1.example.com" or ["peer0.org1.example.com", "peer1.org1.example.com"]
ca, // instance of CertificateAuthority. or [ca1, ca2] or "ca-org1" or ["ca-org1", "ca2-org1"]
{path: "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/5890f0061619c06fb29dea8cb304edecc020fe63f41a6db109f1e227cc1cb2a8_sk"}, //or string "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/5890f0061619c06fb29dea8cb304edecc020fe63f41a6db109f1e227cc1cb2a8_sk"
{path: "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem"} //or string "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem"
);
networkConfig.addOrganization(organization);
Or variation 2 - pass the parameters directly to the 'addOrganization' method
networkConfig.addOrganization(
"Org1",
"Org1MSP",
peer0, // instance of Peer. or [peer0, peer1, peer2...] or "peer0.org1.example.com" or ["peer0.org1.example.com", "peer1.org1.example.com"]
ca, // instance of CertificateAuthority. or [ca1, ca2] or "ca-org1" or ["ca-org1", "ca2-org1"]
{path: "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/5890f0061619c06fb29dea8cb304edecc020fe63f41a6db109f1e227cc1cb2a8_sk"}, //or string "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/5890f0061619c06fb29dea8cb304edecc020fe63f41a6db109f1e227cc1cb2a8_sk"
{path: "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem"} //or string "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem"
);
Create and add CertificateAuthority
Parameters:
Variation 1 - create a CertificateAuthority instance and pass it to the 'addCertificateAuthority' method of the NetworkConfig class instance
let ca = new fabConf.NetworkConfig.Organization(
"ca-org1",
"https://localhost:7054",
{verify: false},
{path: "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem"}, //or string "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem"
{
enrollId: "admin",
enrollSecret: "adminpw"
},
"ca-org1"
);
networkConfig.addCertificateAuthority(ca);
Or variation 2 - pass the parameters directly to the 'addCertificateAuthority' method
networkConfig.addCertificateAuthority(
"ca-org1",
"https://localhost:7054",
{verify: false},
{path: "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem"}, //or string "artifacts/channel/crypto-config/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem"
{
enrollId: "admin",
enrollSecret: "adminpw"
},
"ca-org1"
);
Create and add Channel
Parameters:
channel_peers format:
{
"peer0.main.arcelormittal-fabric.test": {
endorsingPeer?: *boolean*
chaincodeQuery?: *boolean*
ledgerQuery?: *boolean*
eventSource?: *boolean*
discover?: *boolean*
}
}
Variation 1 - create a Channel instance and pass it to the 'addChannel' method of the NetworkConfig class instance
let channel = new fabConf.NetworkConfig.Channel(
"mychannel",
orderer, // instance of Orderer. or [orderer1, orderer2] or "orderer.example.com" or ["orderer1.example.com", "orderer2.example.com"]
{"peer0.org1.example.com": {
"endorsingPeer": true,
"chaincodeQuery": true,
"ledgerQuery": true,
"eventSource": true
}}
);
networkConfig.addChannel(channel);
Or variation 2 - pass the parameters directly to the 'addChannel' method
networkConfig.addChannel(
"mychannel",
orderer, // instance of Orderer. or [orderer1, orderer2] or "orderer.example.com" or ["orderer1.example.com", "orderer2.example.com"]
{"peer0.org1.example.com": {
"endorsingPeer": true,
"chaincodeQuery": true,
"ledgerQuery": true,
"eventSource": true
}}
);
Parameters:
let ClientConfig = new fabConf.ClientOrgConfig("supply", "1.0", "supply", "hlfv1");
Create and add Client
Parameters:
Pass the parameters directly to the 'addClient' method
ClientConfig.addClient(
"Org1",
{
"path": "./fabric-client-kv-org1",
"cryptoStore": {
"path": "/tmp/fabric-client-kv-org1"
},
"wallet": "wallet-name"
}
);
FAQs
Package for creating and modifying Fabric SDK node
We found that fabric-sdk-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.