Relay
The most basic pattern you can find in AIR scripts is sending particles to clients via a relay.
It looks like in the example below:
(seq
(call relay ("op" "identity") [])
(call client ("service" "function") [arg])
)
Here, client
is a variable with the value of the client PeerId, and relay
is equal to the PeerId of the node which the client is connected to. The following picture might explain the situation better.


Client is behind NAT and has to maintain connection with relay to receive particles
So, for the particle to reach the client behind the relay, the script must explicitly specify this network topology as follows:
- Go to the relay, do nothing (
op identity
). - Go to the client, execute the required function.
Service creation
TBD
Updated a day ago