Giter Club home page Giter Club logo

gapi-ipfs-pubsub's Introduction

@Gapi Ipfs InterPlanetary File System Pub Sub Module (Beta)

More information about IPFS system can be find here IPFS-WIKI
For questions/issues you can write ticket here
This module is intended to be used with Gapi or rxdi

@gapi/ipfs hello world ipfs address:

https://ipfs.io/ipfs/QmPhYdx4dB6TwBU1KEbYmyET7HQJoLpyERvRD4kMWv3B3a

Installation and basic examples:

To install this module, run:
$ npm install @gapi/ipfs-pubsub --save

Consuming @gapi/ipfs-pubsub

Import inside AppModule or CoreModule
import { Module, Service } from '@rxdi/core';
import { IpfsPubSubModule, IpfsPubSubRoom } from '@gapi/ipfs-pubsub';


@Module({
    imports: [
        IpfsPubSubModule.forRoot({
            rooms: [
                { topic: 'test-topic'},
                { topic: 'test-topic2'},
                { topic: 'test-topic3'},
            ],
            logging: true
        }),
    ]
})
export class CoreModule { }

TODO: Later releases

import { Module, Service } from '@rxdi/core';
import { IpfsPubSubModule, IpfsPubSubRoom } from '@gapi/ipfs-pubsub';

@Service()
export class TestRoom implements IpfsPubSubRoom {
    name?: string = 'TestRoom'; // optional if not provided it will take class name as topic

    constructor(
        @Inject(OrbitDb) private orbitdb: Promise<OrbitDb>
        @Inject(IpfsPubSubRoom) private ipfsPubSubRoom: IpfsPubSubRoom
        @Inject(IPFS) private ipfs: IPFS
    ) {

    }
}

@Module({
    imports: [
        IpfsPubSubModule.forRoot({
            rooms: [TestRoom],
            logging: true
        }),
    ]
})
export class CoreModule { }

TODO: Better documentation...

Enjoy ! :)

gapi-ipfs-pubsub's People

Contributors

stradivario avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.