安装和实例化链代码在 hyperledger fabric 中的真正含义是什么?它们之间有什么区别?
What install and instantiation chaincode really mean in hyperledger fabric? and what are the differences between them?
在 hyperledger fabric 文档中,使用了 2 个术语
1. 在节点上安装链码
2. 在通道
上实例化链代码
这两者之间的主要区别是什么?
文档中说链代码可以安装在多个节点上,但只能实例化一次。这点我理解为频道只需要频道的信息。
我正在关注余额转移示例,因此在创建频道后,需要将对等点加入该频道。
有 2 个节点加入了频道 ["peer0.org1.example.com", "peer0.org1.example.com"]
,所以当我实例化链代码时,它创建了链代码
的 2 docker 个图像
dev-peer0.org1.example.com-chaincode-v0
dev-peer1.org1.example.com-chaincode-v0
这两张图片的真正含义是什么?
初始化chaincode不是通道的意思吗?
或者通道在所有加入它的节点上初始化它?
这个初始化实际上发生在哪里?
谢谢!
What these 2 images really mean?
Isn't initializing the chaincode means for the channel?
是也不是。每个节点都需要在自身上安装相同版本的链代码,因为每个人都需要能够执行和验证传入的 queries/invokes。
所以有2个步骤要做。
- 在通道上的每个节点上安装链代码
- 在通道上实例化链代码
Where actually this initialization is happening?
因此,链码的实例化发生在每个节点都拥有 "knowledge" 链码并且可以验证之后。
感谢@PaulO'Mahony 和@kajuken 提供的资源和解释。
以下是我的疑惑总结:
- 链代码在 Docker 容器中运行,该容器与需要与之交互的任何对等点相关联。
- Chaincode 安装在对等点上,然后在通道上实例化。
All members that want to submit transactions or read data by using a chaincode need to install the chaincode on their peer.
- 实例化将输入链码使用的初始数据,然后启动链码容器在节点上加入到安装了链码的通道。
Note that only one network member needs to instantiate a chaincode. If a peer with a chaincode installed joins a channel where it has already been instantiated, the chaincode container will start automatically.
a chaincode is installed onto the file system of every peer that joins a channel, the chaincode must then be instantiated on the channel so that peers can interact with the ledger via the chaincode container. The instantiation performs any necessary initialization of the chaincode. This will often involve setting the key value pairs that comprise a chaincode's initial world state.
- 节点可以安装一次链代码,然后在任何已实例化的通道上使用相同的链代码容器。
参考文献:
install and instantiate the chaincode
instantiate the chaincode
在 hyperledger fabric 文档中,使用了 2 个术语
1. 在节点上安装链码
2. 在通道
这两者之间的主要区别是什么?
文档中说链代码可以安装在多个节点上,但只能实例化一次。这点我理解为频道只需要频道的信息。
我正在关注余额转移示例,因此在创建频道后,需要将对等点加入该频道。
有 2 个节点加入了频道 ["peer0.org1.example.com", "peer0.org1.example.com"]
,所以当我实例化链代码时,它创建了链代码
dev-peer0.org1.example.com-chaincode-v0
dev-peer1.org1.example.com-chaincode-v0
这两张图片的真正含义是什么?
初始化chaincode不是通道的意思吗?
或者通道在所有加入它的节点上初始化它?
这个初始化实际上发生在哪里?
谢谢!
What these 2 images really mean? Isn't initializing the chaincode means for the channel?
是也不是。每个节点都需要在自身上安装相同版本的链代码,因为每个人都需要能够执行和验证传入的 queries/invokes。 所以有2个步骤要做。
- 在通道上的每个节点上安装链代码
- 在通道上实例化链代码
Where actually this initialization is happening?
因此,链码的实例化发生在每个节点都拥有 "knowledge" 链码并且可以验证之后。
感谢@PaulO'Mahony 和@kajuken 提供的资源和解释。
以下是我的疑惑总结:
- 链代码在 Docker 容器中运行,该容器与需要与之交互的任何对等点相关联。
- Chaincode 安装在对等点上,然后在通道上实例化。
All members that want to submit transactions or read data by using a chaincode need to install the chaincode on their peer.
- 实例化将输入链码使用的初始数据,然后启动链码容器在节点上加入到安装了链码的通道。
Note that only one network member needs to instantiate a chaincode. If a peer with a chaincode installed joins a channel where it has already been instantiated, the chaincode container will start automatically.
a chaincode is installed onto the file system of every peer that joins a channel, the chaincode must then be instantiated on the channel so that peers can interact with the ledger via the chaincode container. The instantiation performs any necessary initialization of the chaincode. This will often involve setting the key value pairs that comprise a chaincode's initial world state.
- 节点可以安装一次链代码,然后在任何已实例化的通道上使用相同的链代码容器。
参考文献:
install and instantiate the chaincode
instantiate the chaincode