There are no events emitting if I call remotely


I am trying to call a method query:

 payable stateful entrypoint query(args: string) : bytes(32) =
         if(Map.lookup(Call.caller, state.reqc) == None)
            put(state{reqc[Call.caller] = 0})
         put(state{reqc[Call.caller] = state.reqc[Call.caller] + 1})
         // Required, so queries can be mapped with unique key
         let uniq_id : bytes(32) = Crypto.sha3(String.concat(String.concat(Address.to_str(Contract.address), Address.to_str(Call.caller)), Int.to_str(state.reqc[Call.caller])))
         require(state.base_fee =< Call.value, "insufficient value for qfee") 
         put(state{queries[uniq_id] = Oracle.query(state.source_oracle, args, state.base_fee, RelativeTTL(state.qttl), RelativeTTL(state.rttl))})
         Chain.event(QueryCreated(state.source_oracle, uniq_id, Chain.timestamp, args))

If I call it directly, It emits an event that I can listen to with a WebSocket connection.

    op: "Subscribe",
    payload: "Object",
    target: contract_address.replace(/^.{2}/g, 'ok')

But if I try to call query from another contract then it do gives bytes(32) in the end but there are no events emitting in this case and further, I don’t see any call that is done from a contract but I did many calls to query and it successfully gave the results from another contract:


copy/paste from discord:

@jeevanjot when I understand correctly your tx is successful right? I see that you are trying to access the frontend of the “old buggy middleware”
let me check your tx with die API of the new middleware
here the endpoints: GitHub - aeternity/ae_mdw: Aeternity Middleware in Elixir
does that help you?

1 Like

Thank you @marco.chain New endpoints helps to find my call But not from another contract. So I am trying another but this endpoint but it returns

from here: GitHub - aeternity/ae_mdw: Aeternity Middleware in Elixir

And Is it also possible to listen to the event. I am using newer mdw endpoint now. If it is not, I can work with it.

@karol.chain @Arthur can you help out? :sweat_smile:

1 Like

The latest version with this endpoint isn’t yet deployed on our infra, if you need it urgently the best is to have middleware running locally.

We are focusing on identifying of potential issues related to Iris hard fork and once that is complete we will deploy the latest version which will be Iris compatible for smooth transition.

Should be all there in week or two, sorry for delay!


Thank you Karol, What I am looking for is to list queries or events, Can you please help me out.

For events emitted explicitly from your contract, take a look at contracts/logs endpoint:

Since middleware doesn’t have the source code of your contract, the user experience isn’t exactly great, but that endpoint is still useful.


oh ok, I can take value from the event arg. Thank you @marco.chain @karol.chain