How to use the ipfs/createProtocol function in ipfs

To help you get started, we’ve selected a few ipfs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MichaelMure / Arbore / app / actions / shareList.js View on Github external
return async function (dispatch, getState) {
    const profile: Profile = getState().profile

    pubsub = createProtocol('shareList', profile.sharesPubsubTopic, {
      [protocol.queryShares.toString()]: handleQueryShares,
      [protocol.sharesReply.toString()]: handleSharesReply,
      [protocol.sharePush.toString()]: handleSharePush,
      [protocol.shareAck.toString()]: handleShareAck,
    })

    await dispatch(pubsub.subscribe())
  }
}
github MichaelMure / Arbore / app / actions / chat.js View on Github external
return async function (dispatch, getState) {

    const profile: Profile = getState().profile
    pubsub = createProtocol('chat', profile.chatPubsubTopic, {
      [protocol.chat.toString()]: handleMessage,
      [protocol.chatAck.toString()]: handleAck,
    })

    await dispatch(pubsub.subscribe())
  }
}
github MichaelMure / Arbore / app / actions / contactList.js View on Github external
return async function (dispatch, getState) {
    const profile: Profile = getState().profile

    pubsub = createProtocol('contactList', profile.contactsPubsubTopic, {
      [protocol.queryContacts.toString()]: handleQueryContacts,
      [protocol.contactsReply.toString()]: handleContactsReply,
      [protocol.ping.toString()]: handlePing,
      [protocol.pong.toString()]: handlePong,
      [protocol.addedContactQuery.toString()]: handleAddedContactQuery,
      [protocol.addedContactAck.toString()]: handleAddedContactAck,
    })

    await dispatch(pubsub.subscribe())
  }
}
github MichaelMure / Arbore / app / actions / contactResolver.js View on Github external
return async function (dispatch, getState) {
    const profile: Profile = getState().profile

    queryPubsub = createProtocol('contactDicovery', PUBSUB_TOPIC, {
      [protocol.lookup.toString()]: handleLookup,
    })

    replyPubsub = createProtocol('contactDicovery', profile.contactDiscoveryPubsubTopic, {
      [protocol.lookupReply.toString()]: handleLookupReply,
    })

    await dispatch(queryPubsub.subscribe())
    await dispatch(replyPubsub.subscribe())
  }
}
github MichaelMure / Arbore / app / actions / contactResolver.js View on Github external
return async function (dispatch, getState) {
    const profile: Profile = getState().profile

    queryPubsub = createProtocol('contactDicovery', PUBSUB_TOPIC, {
      [protocol.lookup.toString()]: handleLookup,
    })

    replyPubsub = createProtocol('contactDicovery', profile.contactDiscoveryPubsubTopic, {
      [protocol.lookupReply.toString()]: handleLookupReply,
    })

    await dispatch(queryPubsub.subscribe())
    await dispatch(replyPubsub.subscribe())
  }
}

ipfs

JavaScript implementation of the IPFS specification

Apache-2.0 OR MIT
Latest version published 1 year ago

Package Health Score

56 / 100
Full package analysis