Still Linking Gateways - Development Log #454

Michi continues his work on linking gateways.

Avatar Michi

Michi (molp)

It has been a short week for me, for two reasons: We had a public holiday on Thursday, and I spent a lot of time in and around the house, coordinating craftsmen and helping out were I can. We (as in my family and me, not simulogics 😉) are currently modernizing our home.

Nonetheless, I got some work done. Last week I showed a screenshot of the "link gateway" motion component. I now finished its implementation, meaning that it can be added and removed from a motion and behaves like any other motion component.

The actual linking that happens once the component is executed, is currently work in progress though. There are a few things that happen once the motion passes. First, we make sure that the origin gateway is established. In a past devlog I told you that gateways will be visible as soon as the project starts, but we'll only allow established gateways to create links. Then we check if the ids of the origin and destination gateways aren't identical and that there is no existing link between the two.

Once these checks are done, we get the gateway information of the destination gateway and do similar checks: We make sure that the destination gateway is established and that the origin and destination gateway aren’t at the same location.

After all these checks, a transaction is started to mark the link as the outgoing link for the origin gateway and as one of potentially multiple incoming links for the destination gateway.

A check to make sure the destination gateway is in reach of the origin gateway still needs to be implemented.

As always: we'd love to hear what you think: join us on Discord or the forums!

Happy trading!