This project is discontinued. @ubiquify/relay fork provides a compatible and more advanced implementation. The new relay needs paired with the evolved @ubiquify/core.
Simple graph relay for O7 library.
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.
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
npm run clean
npm install
npm run build
npm run test
npm start
Licensed under either Apache 2.0 or MIT at your option.