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等其他编程语言编写,实现指定的接口。链码运行在与背书对等进程隔离的安全Docker容器中。链码通过应用程序提交的事务初始化和管理分类帐状态。

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.
链码通常处理网络成员同意的业务逻辑,因此可以将其视为“智能契约”。由链码创建的状态仅限定于该链码,不能被另一个链码直接访问。但是,在相同的网络中,在适当的权限下,chaincode可以调用另一个chaincode来访问它的状态。

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.
在下面的部分中,我们将通过区块链网络运营商Noah的视角来研究链路代码。为了挪亚的利益,我们将关注链码生命周期操作;将链码包装、安装、实例化和升级为区块链网络中链码操作生命周期的函数的过程。

链码生命周期

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允许与区块链网络中的各个节点(对等节点、定序者和MSPs)进行交互,并且它还允许在已背书的对等节点上打包、安装、实例化和升级链码。特定于Hyperledger Fabric语言的SDKs抽象了Hyperledger Fabric API的细节以促进应用程序开发,尽管它可以用来管理一个链代码的生命周期。此外,可以通过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事务来禁用和重新启用链码,而不必真正卸载它。在成功安装和实例化链码之后,链码是活动的(正在运行),并且可以通过invoke事务处理事务。链码在安装后可以随时升级。

打包
安装
实例化
升级
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值