@dstanesc/o-o-o-o-o-o-o-r
v0.1.2
Published
O-O-O-O-O-O-O relay
Downloads
15
Maintainers
Readme
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.