@dstanesc/o-o-o-o-o-o-o-r
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

Discontinued

This project is discontinued. @ubiquify/relay fork provides a compatible and more advanced implementation. The new relay needs paired with the evolved @ubiquify/core.

O-O-O-O-O-O-O-R

Simple graph relay for O7 library.

Usage

Relay api. Only http and https protocols are supported at this stage.

const blockStore: BlockStore = memoryBlockStoreFactory();
const linkResolver: LinkResolver = memoryBlockResolverFactory();
const httpsPort = 3003;
const graphRelay = createGraphRelay(blockStore, linkResolver);
graphRelay.startHttps(3000, getCertificate(), () => {
  console.log(`GraphRelay listening on https://localhost:${httpsPort}`);
});
const httpPort = 3001;
graphRelay.startHttp(httpPort, () => {
  console.log(`GraphRelay listening on http://localhost:${httpPort}`);
});

Client api. Two categories: plumbing (fine granular) & basic (coarse granular) apis.

// See tests for examples.

SSL

The relay expects two files in the ssl folder:

  • server.key - Private key.
  • server.crt - Certificate.

A self signed certificate can be generated in linux with openssl:

cd ssl/
openssl req -nodes -new -x509 -keyout server.key -out server.crt

Build

npm run clean
npm install
npm run build
npm run test

Usage

npm start

Licenses

Licensed under either Apache 2.0 or MIT at your option.

Package Sidebar

Install

npm i @dstanesc/o-o-o-o-o-o-o-r

Weekly Downloads

15

Version

0.1.2

License

(Apache-2.0 AND MIT)

Unpacked Size

169 kB

Total Files

58

Last publish

Collaborators

  • dstanesc