@uprtcl/multiplatform
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

@uprtcl/multiplatform

This package contains services, modules and GraphQl directives that help resolve generic content-addressable linking between entities. It also helps traverse entity links accross platforms.

Documentation

Visit our documentation site.

Install

npm install @uprtcl/multiplatform

Usage

Import the DiscoveryModule and load it in the micro-orchestrator.

import { DiscoveryModule } from '@uprtcl/multiplatform';

await orchestrator.loadModule(new DiscoveryModule());

Now you can add multiple CASModules to register new Content-Addressable Sources and Stores into your application. This will make all content-addressable object retrievable through that source integrated into the application, and they can automatically be referenced by any other entity to fetch and resolve them.

import { MicroModule } from '@uprtcl/micro-orchestrator';
import { CASModule } from '@uprtcl/multiplatform';
import { IpfsConnection, IpfsSource } from '@uprtcl/ipfs-provider';

const ipfsConnection = new IpfsConnection(ipfsConfig);
const ipfsSource = new IpfsSource(ipfsConnection);

export class TestModule extends MicroModule {
  static id = Symbol('test-module');

  get submodules() {
    return [new CASModule([ipfsSource])];
  }
}

Add that module to the micro-orchestrator:

import { TestModule } from './test-module';

await orchestrator.loadModule(new TestModule());

Readme

Keywords

none

Package Sidebar

Install

npm i @uprtcl/multiplatform

Homepage

uprtcl.io

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

183 kB

Total Files

32

Last publish

Collaborators

  • sotous
  • guillem.cordoba
  • pepoospina