如何使用ConseilJS和SmartPy生成的Michelson部署受UI输入影响的智能合约?
1 个回答
- 投票数
我无法回答您所有的问题,但至少可以说,在SmartPy.io中,发送到ConseilJS的存储是"存储"选项卡的内容(采用Michelson或Micheline格式),并且代码类似相应标签之一的内容.
根据您使用的表单,您需要设置Michelson或Micheline(从长远来看,后者可能会更好). 需要明确的是,Micheline是JSON,而Michelson是自定义格式.
然后,在您的应用程序中,需要通过使用自己的值更改工作版本来生成存储. 我认为已经发布了一些可以帮助您的工具,但我不知道. 如果有几个团队致力于这个问题,我不会感到惊讶.
请注意,如果该节点不起作用或在使用它时出现CORS问题,您可能希望尝试其他节点.
I cannot answer all your questions but at least, I can say that, in SmartPy.io, the storage sent to ConseilJS is the content of the tab "Storage" (in either Michelson or Micheline formats) and the code is similarly the content of one of the corresponding tabs.
Depending on the form you're using, you need to set Michelson or Micheline (the latter is quite possibly better to use in the long run). To be clear, Micheline is in JSON, Michelson is a custom format.
Then, in your application you need to generate the storage by changing a working version with your own values. I think that there are already released tools that may be able to help you but I don't know them. I wouldn't be surprised if a few teams were working on this subject.
Note that you may wish to try another node if this one doesn't work or you have CORS issues when using it.
我希望能够创建一个智能合约,以从UI接收输入以为部署提供参数
pubKey
,prvKey
,pubHash
和minAmount
和maxTime
来影响迈克尔逊.我有以下JS:
当前运行时会产生以下错误:
但是,我确定这些相关性较低,因为代码在当前形式下显然不正确.
此代码大量源自 Cryptonomic 的文档,但我仍然离开不确定许多元素:
seed:''
是否正确?storeType:conseiljs.StoreType.Fundraiser
是否正确?const storage='"Sample"'
的值是什么?与迈克尔逊互动.它是使用 SmartPy.io 生成和美化的,在测试案例中,提供了一些输入,它们会影响智能合约:
如何与静态地表示为JS的迈克尔逊进行相同的交互?
非常感谢您的帮助!