gerte v1.1.1-2
GERTe Gateway (NodeJS)
This repository is dedicated to the NodeJS version of the GERTe Gateway
For more information on GERTe or its gateways see the main repository.
Installing
Simply install the npm package (npm i gerte
or other methods) and iit.
Usage
The API provided by this package has two parts: Config and Connection.
Connecting to a Peer
To connect, first create an address from GERTe.Address
. Then create an identity using GERTe.Identity
using the previous address and a private key, either from a Buffer
, crypto.KeyObject
, or webcrypto.CryptoKey
.
Note: The address must be associated with the private key passed into the identity or the peer will reject the connection.
Once the identity is ready, create the connection with GERTe.Connection
passing in the IP of the peer, the port to connect to, and the identity.
Data Transmission
Data must be wrapped in a GERTe.Packet
class to be sent. This class takes two GERTe.Address
classes, the source and the destination. The destination must be a complete address, with internal or external. If the source has an external address, it will be overridden with the identity. The final argument is the data as a string.
Once the packet is ready, send it on the connection's write
method.
Licensing
The project is currently listed as UNLICENSED
otherwise known as "all rights reserved."
This has more to do with a rush to publish and less to do with restrictions on modifications. General rule: play nice.
Give credit where credit is due, be willing to submit your changes to this repository, do not "steal" outside reasonable redistribution, etc.
Officially all rights are reserved but if you play nice there is no reason to worry.