美文网首页HyperLedger Fabric
Hyperledger Fabric SDK Nodejs

Hyperledger Fabric SDK Nodejs

作者: 糖果果老师 | 来源:发表于2018-05-29 22:17 被阅读226次

SDK能做什么

fabric上的安全性是用数字证书来保证的的。所有fabric中的操作要求必须由CA证书。

Node.js SDK的功能

Hyperledger Fabric SDK是以面向对象的编程风格进行设计。其模块化结构使应用程序开发人员能够对关键功能实现可插拔的替代实现,例如加密模块,状态存储模块和日志模块。
SDK的功能列表包括:

  • fabric-client

     //加载配置 可以传json对象或者json文件的路径
     loadFromConfig(config) 
    
     addTlsClientCertAndKey(opts)
    
     //创建channel 返回一个promise
     //参数类型 ChannelRequest
     ![image.png](https://img.haomeiwen.com/i5659111/b8fb4a5a46e7842c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
     createChannel(request)
      
    //创建User 参数类型UserOpts  返回promise
    ![image.png](https://img.haomeiwen.com/i5659111/02aa7111abac01ca.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
     createUser(opts) 
    
     extractChannelConfig(config_envelope)
    
     getCertificateAuthority(name)
      
     getChannel(name, throwError)
     ![image.png](https://img.haomeiwen.com/i5659111/b81d7f0755cb7d5f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
    
     getClientConfig()
    
     getCryptoSuite()
    
     getEventHub(peer_name)
    
     getEventHubsForOrg(org_name)
    
     getMspid()
    
     getOrderer(name)
    
     getPeer(name)
    
     getPeersForOrg(org_name)
    
     getStateStore()
    
     getUserContext(name, checkPersistence)
    
     initCredentialStores()
    
     installChaincode(request, timeout)
     ![image.png](https://img.haomeiwen.com/i5659111/dafc384213581ff6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
      
     isDevMode()
    
     loadFromConfig(config)
     
     loadUserFromStateStore(name)
    
     newChannel(name)
    
     newEventHub()
      
     newOrderer(url, opts)
    
     newPeer(url, opts)
    
     newTransactionID(admin)
    
     queryChannels(peer, useAdmin)
    
     queryInstalledChaincodes(peer, useAdmin)
    
     saveUserToStateStore()
      
     setAdminSigningIdentity(private_key, certificate, mspid)
    
     setCryptoSuite(cryptoSuite)
    
     setDevMode(devMode)
    
     setStateStore(keyValueStore)
    
     setTlsClientCertAndKey(clientCert, clientKey)
    
     setUserContext(user, skipPersistence)
    
     signChannelConfig(config)
    
     updateChannel(request)
    
    addOrderer(orderer)
    
    addPeer(peer, roles)
    
    close()
    
    compareProposalResponseResults(The)
    
    executeTransaction(request)
    
    getChannelConfig(target)
    
    getChannelConfigFromOrderer()
    
    getChannelEventHub(name)
    
    getChannelEventHubsForOrg(org_name)
    
    getChannelPeer(name)
    
    getGenesisBlock(request)
    
    getMSPManager()
    
    getName()
    
    getOrderer(name)
    
    getOrderers()
    
    getOrganizations()
    
    getPeer(name)
    
    getPeers()
    
    getPeersForOrg(org_name)
    
    initialize(config)
    
    joinChannel(request, timeout)
    
    newChannelEventHub(peer)
    
    queryBlock(blockNumber, target, useAdmin)
    
    queryBlockByHash(block, target, useAdmin)
    
    queryBlockByTxID(tx_id, target, useAdmin)
    
    queryByChaincode(request)
    
    queryInfo(target, useAdmin)
    
    queryInstantiatedChaincodes(target, useAdmin)
    
    queryTransaction(tx_id, target, useAdmin)
    
    removeOrderer(orderer)
    
    removePeer(peer)
    
    sendInstantiateProposal(request, timeout)
    
    sendTransaction(request)
    
    sendTransactionProposal(request, timeout)
    
    sendUpgradeProposal(request, timeout)
    
    setMSPManager(msp_manager)
    
    toString()
    
    verifyProposalResponse(proposal_response)
    
    installChaincode(request, timeout)
    
    sendInstantiateProposal(request, timeout)//
    
    sendTransaction(request) //https://fabric-sdk-node.github.io/Channel.html#sendInstantiateProposal
    
     sendTransactionProposal(request, timeout)//https://fabric-sdk-node.github.io/Channel.html#sendTransactionProposal
    
     sendTransaction(request)//https://fabric-sdk-node.github.io/Channel.html#sendTransaction
    
     queryByChaincode(request)
    
    //https://fabric-sdk-node.github.io/Remote.html
    
    //https://fabric-sdk-node.github.io/Orderer.html
    
    //https://fabric-sdk-node.github.io/Peer.html
    
    //https://fabric-sdk-node.github.io/Orderer.html
    
    
  • fabric-ca-client

相关文章

网友评论

    本文标题:Hyperledger Fabric SDK Nodejs

    本文链接:https://www.haomeiwen.com/subject/stzajftx.html