Chaincode for Operators(运营商的链码手册)
原文地址:https://hyperledger-fabric.readthedocs.io/en/latest/chaincode4noah.html
鏈碼是什么?
Chaincode is a program, written in Go, and eventually in other programming languages such as Java, that implements a prescribed interface. Chaincode runs in a secured Docker container isolated from the endorsing peer process. Chaincode initializes and manages ledger state through transactions submitted by applications.
鏈碼是用Go編寫的程序,最終用Java等其他編程語言編寫,實現(xiàn)指定的接口。鏈碼運(yùn)行在與背書對等進(jìn)程隔離的安全Docker容器中。鏈碼通過應(yīng)用程序提交的事務(wù)初始化和管理分類帳狀態(tài)。
A chaincode typically handles business logic agreed to by members of the network, so it may be considered as a “smart contract”. State created by a chaincode is scoped exclusively to that chaincode and can’t be accessed directly by another chaincode. However, within the same network, given the appropriate permission a chaincode may invoke another chaincode to access its state.
鏈碼通常處理網(wǎng)絡(luò)成員同意的業(yè)務(wù)邏輯,因此可以將其視為“智能契約”。由鏈碼創(chuàng)建的狀態(tài)僅限定于該鏈碼,不能被另一個鏈碼直接訪問。但是,在相同的網(wǎng)絡(luò)中,在適當(dāng)?shù)臋?quán)限下,chaincode可以調(diào)用另一個chaincode來訪問它的狀態(tài)。
In the following sections, we will explore chaincode through the eyes of a blockchain network operator, Noah. For Noah’s interests, we will focus on chaincode lifecycle operations; the process of packaging, installing, instantiating and upgrading the chaincode as a function of the chaincode’s operational lifecycle within a blockchain network.
在下面的部分中,我們將通過區(qū)塊鏈網(wǎng)絡(luò)運(yùn)營商N(yùn)oah的視角來研究鏈路代碼。為了挪亞的利益,我們將關(guān)注鏈碼生命周期操作;將鏈碼包裝、安裝、實例化和升級為區(qū)塊鏈網(wǎng)絡(luò)中鏈碼操作生命周期的函數(shù)的過程。
鏈碼生命周期
The Hyperledger Fabric API enables interaction with the various nodes in a blockchain network - the peers, orderers and MSPs - and it also allows one to package, install, instantiate and upgrade chaincode on the endorsing peer nodes. The Hyperledger Fabric language-specific SDKs abstract the specifics of the Hyperledger Fabric API to facilitate application development, though it can be used to manage a chaincode’s lifecycle. Additionally, the Hyperledger Fabric API can be accessed directly via the CLI, which we will use in this document.
Hyperledger Fabric API允許與區(qū)塊鏈網(wǎng)絡(luò)中的各個節(jié)點(對等節(jié)點、定序者和MSPs)進(jìn)行交互,并且它還允許在已背書的對等節(jié)點上打包、安裝、實例化和升級鏈碼。特定于Hyperledger Fabric語言的SDKs抽象了Hyperledger Fabric API的細(xì)節(jié)以促進(jìn)應(yīng)用程序開發(fā),盡管它可以用來管理一個鏈代碼的生命周期。此外,可以通過CLI直接訪問Hyperledger Fabric API,我們將在本文中使用CLI。
We provide four commands to manage a chaincode’s lifecycle: package, install, instantiate, and upgrade. In a future release, we are considering adding stop and start transactions to disable and re-enable a chaincode without having to actually uninstall it. After a chaincode has been successfully installed and instantiated, the chaincode is active (running) and can process transactions via the invoke transaction. A chaincode may be upgraded any time after it has been installed.
我們提供了四個命令來管理鏈碼的生命周期:打包、安裝、實例化和升級。在未來的版本中,我們正在考慮添加stop和start事務(wù)來禁用和重新啟用鏈碼,而不必真正卸載它。在成功安裝和實例化鏈碼之后,鏈碼是活動的(正在運(yùn)行),并且可以通過invoke事務(wù)處理事務(wù)。鏈碼在安裝后可以隨時升級。
打包
安裝
實例化
升級
與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的Chaincode for Operators(运营商的链码手册)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 论文笔记系列-Efficient Neu
- 下一篇: Putty通过ssh代理连接远程服务