Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM smart contract genesis.json creation #314

Open
gv-timur opened this issue Mar 20, 2023 · 0 comments
Open

WASM smart contract genesis.json creation #314

gv-timur opened this issue Mar 20, 2023 · 0 comments
Assignees
Labels

Comments

@gv-timur
Copy link
Contributor

gv-timur commented Mar 20, 2023

When we use Iroha SDK to register wasm smart contract:
Instructions.registerWasmTrigger(...)
In class that extends Genesis.class
And start container Iroha SDK generates the following instructions:

{
  "Register" : {
    "Identifiable" : {
      "Trigger" : {
        "id" : "some_id",
        "action" : {
          "executable" : {
            "Wasm" : {
              "raw_data" : "[bytes]"
            }
          },
          "repeats" : "Indefinitely",
          "technical_account" : "account@domain",
          "filter" : {
            "Data" : {
              "BySome" : {
                "ByAccount" : {
                  "BySome" : {
                    "origin_filter" : "AcceptAll",
                    "event_filter" : {
                      "BySome" : "ByMetadataInserted"
                    }
                  }
                }
              }
            }
          },
          "metadata" : { }
        }
      }
    }
  }
}

And fails to start with error that genesis.json is incorrect.

Valid json should be:

{
  "Register": {
      "Identifiable": {
          "Trigger": {
              "id": "some_id",
              "action": {
                  "executable": {
                      "Wasm": {
                          "raw_data": "[bytes]"
                      }
                  },
                  "repeats": "Indefinitely",
                  "technical_account": "account@domain",
                  "filter": {
                      "Data": {
                          "ByAccount": {
                              "origin_filter": "AcceptAll",
                              "event_filter": "ByMetadataInserted"
                          }
                      }
                  },
                  "metadata": {}
              }
          }
      }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants