NodeInfo server implemented in Go.
Matt Baer 91102b12f3 Add more NodeServices 8 months ago
example Add example implementation 9 months ago
.gitignore Add .gitignore 9 months ago
LICENSE Add MIT license 9 months ago Fix typo in README 9 months ago
nodeinfo.go Add more NodeServices 8 months ago
resolver.go Create nodeinfo library 9 months ago
routes.go Create nodeinfo library 9 months ago
service.go Include BaseURL in nodeinfo discover href 9 months ago


GoDoc Discuss on our forum

go-nodeinfo is an implementation of NodeInfo, a standard metadata format for federated social networks, in Go (golang).


nodeinfo.Service integrates with your existing net/http server.

package main

import (

func main() {
	cfg := nodeinfo.Config{
		BaseURL: "http://localhost:8080",
		InfoURL: "/api/nodeinfo",

		Metadata: nodeinfo.Metadata{
			NodeName:        "Agora",
			NodeDescription: "A federated something-something.",
			Private:         false,
		Protocols: []nodeinfo.NodeProtocol{
		Services: nodeinfo.Services{
			Inbound: []nodeinfo.NodeService{},
			Outbound: []nodeinfo.NodeService{
		Software: nodeinfo.SoftwareInfo{
			Name:    "Agora",
			Version: "1.0",
	ni := nodeinfo.NewService(cfg, nodeInfoResolver{})

	http.Handle(nodeinfo.NodeInfoPath, http.HandlerFunc(ni.NodeInfoDiscover))
	http.Handle(cfg.InfoURL, http.HandlerFunc(ni.NodeInfo))

	http.ListenAndServe(":8080", nil)

type nodeInfoResolver struct{}

func (r nodeInfoResolver) IsOpenRegistration() (bool, error) {
	return true, nil

func (r nodeInfoResolver) Usage() (nodeinfo.Usage, error) {
	u := nodeinfo.Usage{
		Users: nodeinfo.UsageUsers{
			Total: 1,
		LocalPosts: 1,
	return u, nil