Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

anypath/federation-php

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
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

 
 
 

Contributors

Languages

  • PHP 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.