Frontier Documentation

Learn the service-to-edge model, run the fastest demos, and then integrate the SDKs.

Frontier is easiest to understand in this order: first the communication model, then the examples, then the SDK snippets. If your backend services need to directly reach online edge nodes and edge nodes also need to reach services back, you are in the right place.

Quick Start Guide

1Start the Gateway

Run a standalone Frontier instance using Docker. This exposes the Service port (30011) and the Edge port (30012).

docker run -d --name frontier -p 30011:30011 -p 30012:30012 singchia/frontier:1.2.2

2Microservice Integration

Microservices connect to port 30011. Start with a dialer, then create the service client.

import (
"net"
"github.com/singchia/frontier/api/dataplane/v1/service"
)
func main() {
dialer := func() (net.Conn, error) {
return net.Dial("tcp", "127.0.0.1:30011")
}
svc, err := service.NewService(dialer)
if err != nil { panic(err) }

// Now the service can receive messages, register RPC, or open streams
}

3Edge Node Integration

Edge nodes (IoT, agents, clients) connect to port 30012. Then they can publish, register RPC, call services, or accept streams.

import (
"net"
"github.com/singchia/frontier/api/dataplane/v1/edge"
)
func main() {
dialer := func() (net.Conn, error) {
return net.Dial("tcp", "127.0.0.1:30012")
}
eg, err := edge.NewEdge(dialer)

// Now the edge can publish, register methods, call services, or open streams
}