Aeternal middleware concurrency?

I’m using the Aeternal Middleware to get past events and subscribe for new ones. The following case is so confusing and annoying.

  1. Broadcast a transaction with waitMined flag set to false - this will resolve the promise and give me as a result the transaction hash.
  2. Once the transaction is mined, the Aeternal emits a websocket event that the transaction is mined giving all the data, EXCEPT the one that’s needed to get the event data.
  3. In order to get the event data from the transaction I have to make additional request to the node to get it - https://testnet.aeternity.io/v2/transactions/th_dapqDR77xw6cFw7i3NG8JHTQhhw88BaGdVstC2mUkszs4iexs/info
  4. The funny part - the node doesn’t know about the tx yet, because it’s not synced yet and the Aeternal middleware was synced first. So I receive an exception that the tx is not mined. Therefore the emiting of the event from the middleware was pointless, because you can’t get any valuable data from it.

Possible soltion:
I believe adding the log data to the webosocket event won’t be hard and won’t hurt anyone. This will bring lots of benefits - no more additional requests to the node to get the log datat, no more concurrency between the Aeternal and the node.

1 Like

This same thing also happens with the JS SDK alone when waitMined is set to true. The promise is resolved and right after that the same exception occurs - the tx is not mined yet.

Hey @botanicalcarebot.chain and @dincho.chain can you help here?

1 Like

Your description points to the disparity between using a central service (the middleware) and the load-balanced API access to the testnet, where there are many nodes you can hit.

The original middleware is currently in maintenance mode and being replaced by a new version which is closer to the Core. Thus I would forward that as a feature request to @karol.chain.

In the meantime you could, once the event has been received, periodically check the testnet node for the info data if that is not what you are already doing. Not elegant, but a workaround until the next version of the middleware is ready which will take some time.

1 Like

I don’t like this, but I already do that :confused:

Right, I figured you would. But this short-coming is now known and @karol.chain will certainly take care of it in some form.

1 Like

Cool! Is there a place I can track the progress?

The care here means that steps will be taken to improve this permanently in the new middleware, but as was said, this will take a bit more time.
You can track the progress here: GitHub - aeternity/ae_mdw: Aeternity Middleware in Elixir

1 Like

I guess the project is still private, because the result is 404

OK, it’s now public.