Skip to content
A simple Stellar federation server implementation that uses Cloudflare workers
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.prettierrc
AUTHORS.md
CHANGELOG.md
CONTRIBUTING.md
LICENSE.md
README.md
_config.yml
addressbook.json
index.js
package.json

README.md

cloudflare-federation-server / ReadmeContributingChangelog

Readme

Licence Dependencies

A simple Stellar federation server implementation that uses Cloudflare workers.

(Weekly updates: Reddit, Twitter, Keybase, Telegram)

Introduction

This is a federation server implementation running in the cloud using Cloudflare Workers. It features federated address lookup using a simple addressbook.json file.

The structure of the address book is as follow:

{
  "hello*example.org": {
    "account_id": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF",
    "memo_type": "text",
    "memo": "hello"
  },
  ...
}

The advantage of using Cloudflare is that it offers the lightest - hence cheapest - cloud workers implementation. At that time (2019-12), the first 100k daily requests are free of charge. This is more than enough for most use cases.

Demonstration

This federation server is used by Cosmic.plus and Cosmic.link since mid-2019. It's being used to resolve addresses such as tips*cosmic.plus and gils*cosmic.plus.

You can play with Cosmic.plus' instance of the worker here: worker preview.

Usage

Setup the Federation server

If you're not familiar with Cloudflare Workers, please check the Cloudflare Workers Quick Start Guide first.

Step 1: Clone the Template

wrangler generate federation-server https://git.cosmic.plus/cloudflare-federation-server

Step 2: Edit addressbook.json

cd federation-server
nano addressbook.json

Step 3: Setup wrangler.toml

wrangler config

Step 4: Publish

wrangler publish

Link the Federation Server to a Domain

Edit or create the file at https://${domain}/.well-known/stellar.toml and add the following entry:

FEDERATION_SERVER = "${federation_server_url}"

Note: it is possible to use the same federation server for several domains.

Links

Organization: Cosmic.plus | @GitHub | @NPM

Follow: Reddit | Twitter | Medium | Codepen

Talk: Telegram | Keybase

You can’t perform that action at this time.