0

I am using Monax version 0.18.0.I am following the tutorial for deploying contracts in Monax https://monax.io/docs/getting-started/. I have used the sample contract defined in their starting tutorial.

 pragma solidity ^0.4.0;

 contract IdisContractsFTW {
    uint storedData;

    function set(uint x) {
        storedData = x;
    }

    function get() constant returns (uint retVal) {
        return storedData;
    }
 }

I have used the epm.yaml file in their tutorial.

   jobs:

   - name: setStorageBase
      job:
          set:
              val: 5

 - name: deployStorageK
     job:
       deploy:
            contract: idi.sol

- name: setStorage
      job:
        call:
           destination: $deployStorageK
           data: set $setStorageBase

- name: queryStorage
      job:
        query-contract:
              destination: $deployStorageK
              data: get

- name: assertStorage
     job:
       assert:
          key: $queryStorage
          relation: eq
          val: $setStorageBase

On executing the configuration,it won't generate the deployed address for contract.

Consider this issue as a follow up to the question Issue in creating App using Monax :- Contract not found in JSON.

As mentioned I have updated the epm.yaml file by omitting the job field for the contract idi.sol.

jobs:

   - name: setStorageBase
        set:
        val: 5

    - name: deployStorageK
         deploy:
         contract: idi.sol

    - name: setStorage
         call:
         destination: $deployStorageK
         data: set $setStorageBase

    - name: queryStorage
        query-contract:
        destination: $deployStorageK
        data: get

  - name: assertStorage
      assert:
         key: $queryStorage
         relation: eq
         val: $setStorageBase

I have got the issue as follows:-

    Sorry, the marmots were unable to load the monax jobs file. Please check your path: While parsing config: yaml: line 3: mapping values are not allowed in this context

Any help is appreciated.

1

the yaml parser uses (tab) indention very strictly. I think it might be due to the formatting of your .yaml file. It should look like this (have not tried this, yet, but other files work for me).

Also notice the use of function and data when calling the contract (instead of only using the data line containing the function name, which is deprecated).

jobs:

- name: setStorageBase
  set:
    val: 5

- name: deployStorageK
  deploy:
    contract: idi.sol

- name: setStorage
  call:
    destination: $deployStorageK
    function: set
    data: [$setStorageBase]

- name: queryStorage
  query-contract:
    destination: $deployStorageK
    function: get

- name: assertStorage
  assert:
    key: $queryStorage
    relation: eq
    val: $setStorageBase
  • It worked...Thankyou for the updations in epm.yaml file.. – Crissi Mariam Robert Nov 29 '17 at 6:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.