Skip to content

ripple-unmaintained/federation-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Ripple Federation Endpoint

This projects provides some PHP example code to set up a trivial federation endpoint with a static list of users.

Quickstart

git clone https://github.com/ripple/federation-php.git federation
cd federation
cp private/data-example.json private/data.json

Edit data.json to set your domain and your username -> address mappings.

For example, if your domain is example.com and you have one user bob whose Ripple address is rNDKeo9RrCiRdfsMG8AdoZvNZxHASGzbZL. Your data.json would look like this:

{
  "example.com" : {
    "bob" : "rNDKeo9RrCiRdfsMG8AdoZvNZxHASGzbZL"
  }
}

Then just point your ripple.txt to this federation endpoint:

[federation_url]
https://example.com/federation/

You should configure your webserver to disallow access to the /federation/private/ folder.

Configuration

The basic configuration format is:

{ "[domain]": { "[user]": "[Ripple address]" } }

Domain aliases

You can alias one domain to another one like so:

{ "example.com": { "testuser": "rNDKeo9RrCiRdfsMG8AdoZvNZxHASGzbZL" }, "example-alias.com": "example.com" }

Any query against an alias domain will be answered as if it was against the original domain. In the example above a query for domain example-alias.com and user testuser would be answered as rNDKeo9RrCiRdfsMG8AdoZvNZxHASGzbZL.

License

This code is licensed under the ISC license.

About

Simple PHP federation endpoint with a static JSON dataset

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages