问题描述
我正在与composer 0.19.8
合作开发超级账本区块链应用程序.我的问题是,每次更改区块链模型时,都必须更新package.json
中的业务网络版本并重新启动结构服务器,以使更改反映在Composer REST Server上.如果我不这样做,所做的更改将不会反映在其余服务器API(由命令生成的API)上.
是否有一种方法可以覆盖当前的业务网络版本,而不是更新到package.json
文件中的新版本号?
Hyperledger Composer现在符合"在Fabric上部署和升级链码的标准方式,所以恐怕您对此一无所知. >
您创建的每个新版本的Network都会有一个新的Docker Image和一个新的Docker容器,因此,如果您在开发中进行许多迭代,则需要清理这些旧版本.
如果您想进行快速测试并且不需要REST服务器,则可以使用Composer Playground 在此处在线,或通过本地运行.如果您在线使用它,或者使用Web Profile在本地使用它,则业务网络将在浏览器本地存储中的模拟Fabric中运行,这是升级和测试的快速过程.
更新后的评论升级业务网络时,您不会丢失数据-您可能会丢失数据的可见性!如果更改模型并添加字段而不使其成为可选字段,则会发生这种情况.有关更多详细信息,请参见数据迁移.
I am working with composer 0.19.8
to develop hyperledger blockchain app. My problem is that every time I make changes to the blockchain models I have to update the business network version in package.json
and restart the fabric server in order for changes to reflect on Composer REST Server. If I do not do that the changes I made are not reflected on the rest server API(generated API by composer-rest-server
command).
Is there a way to override the current business network version instead of updating to a new version number in the package.json
file?
Hyperledger Composer is now 'compliant' with the standard way of deploying and upgrading chaincode on the Fabric, so you are stuck with this I'm afraid.
With each new version of the Network that you create there will be a new Docker Image and a new Docker container created, so if you are working with many iterations in your development you will want to clean up these old versions.
If you want to do quick testing and don't need the REST server, you could use the Composer Playground either online here, or by running locally. If you use it on line, or locally using the Web Profile, the Business Network is run in a simulated Fabric in the Browser local storage, and this is a fast process to upgrade and test.
Update Following CommentWhen you upgrade a Business Network you don't loose the data - you may loose visibility of the data! This happens if you change the model and add fields without making them optional. There are more details of this in the Composer Knowledge Wiki section on Data Migration.
这篇关于升级Hyperledger Fabric业务网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!