0.1.2 • Published 1 month ago

@dstanesc/o-o-o-o-o-o-o-r v0.1.2

Weekly downloads
-
License
(Apache-2.0 AND M...
Repository
github
Last release
1 month ago

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.

0.1.2

1 month ago

0.1.0

9 months ago

0.1.1

9 months ago

0.0.23

9 months ago

0.0.24

9 months ago

0.0.5

10 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago