MNCAPI - GlobalEmpire/GERT GitHub Wiki

This page details differences between the MNCAPI and the standard GERTiClient API. If a function or feature is not mentioned here, it should be assumed to be the same as on the standard GERTiClient. Unlike GERTiClient, the MNCAPI is intended to go on the MNC (still in /lib/GERTiClient.lua or /usr/lib/GERTiClient.lua though) and ONLY on the MNC. It should not be installed elsewhere on the network, or it will not function properly.

MNCAPI.getNeighbors(): table

Unlike the standard GERTiClient API, this will return a table of every node on the network, and with each entry noting its neighbors. This can be used to examine the entire GERTi network.

MNCAPI.getEdition(): string

This function will return "MNCAPI". This can be queried by programs and network services that should be locked to only running on the MNC.

MNCAPI.registerNetworkService(name, port): does not return

This function can be used by another program running on the MNC to register itself as a network service. A name and connection ID must be passed to the function. After this function is called, clients can query the MNCAPI for services and the newly registered service will be listed

MNCAPI.removeDNSRecord(hostname): does not return MNCAPI.updateDNSRecord(hostname, address): does not return

The above functions act the same as the standard GERTiClient functions, except that they can overwrite, add, and remove, DNS entries for any node on the network, and even for nodes that are not yet present. As such, updateDNSRecord requires a second parameter to set the GERTi address that the hostname should bind to.