【问题标题】:Kadena Chainweaver Deploy Contract Failure: Tx Failed: Keyset failure (keys-any)Kadena Chainweaver 部署合约失败:Tx 失败:密钥集失败(keys-any)
【发布时间】:2022-01-01 21:33:14
【问题描述】:

当我在 VM (https://chainweaver-builds.s3.amazonaws.com/2.2/kadena-chainweaver-vm-2.2.0.1.ova) 上使用 Kadena Chainweaver 部署 Hello World 合约时出现此错误: 失败:Tx 失败:密钥集失败(keys-any)

这是我正在尝试部署的合约(这是您创建 chainweaver 帐户时存在的默认 hello world):

;;
;; "Hello, world!" smart contract/module
;;
;; To try it out, click "Load into REPL" and type into the repl:
;; (free.hello-world.set-message "universe")
;; (free.hello-world.greet)
;;
;; Check lines 21 and 34 to play with Formal Verification
;;

(namespace "free")

;; Define the module.
(module hello-world MODULE_ADMIN
  "A smart contract to greet the world."

  ; no-op module admin for example purposes.
  ; in a real contract this could enforce a keyset, or
  ; tally votes, etc.
  (defcap MODULE_ADMIN () true)

  (defschema message-schema
    @doc "Message schema"
    @model [(invariant (!= msg ""))]

    msg:string)

  (deftable
    message:{message-schema})

  (defun set-message
    (
      m:string
    )
    "Set the message that will be used next"
    ; uncomment the following to make the model happy!
    ;(enforce (!= m "") "set-message: must not be empty")
    (write message "0" {"msg": m})
  )

  (defun greet ()
    "Do the hello-world dance"
    (with-default-read message "0" { "msg": "" } { "msg":= msg }
      (format "Hello {}!" [msg])))
)

(create-table message)

(set-message "world")
(greet)

Failure: Tx Failed: Keyset failure (keys-any)

【问题讨论】:

    标签: blockchain


    【解决方案1】:

    当我将模块名称从 hello-world 更改为其他名称时,问题就解决了。

    改变这个:

    ;; Define the module.
    (module hello-world MODULE_ADMIN
      "A smart contract to greet the world."
    

    到这里:

    ;; Define the module.
    (module hello-world-YOUR-UNIQUE-NAME MODULE_ADMIN
      "A smart contract to greet the world."
    

    【讨论】:

    • 他们应该在他们给出的例子中更加明确。谢谢@Mike!
    猜你喜欢
    • 2022-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-07
    相关资源
    最近更新 更多