Pollenium

Application Agnostic • Browser Compatible • Gossip Network


Demo Whitepaper Github Get Started Contact

Decentralization Should Be Easy

With our browser-compatible gossip network, you can leave the networking and spam prevention to Pollenium. Simply choose an application id and data format, then focus on building your dApp.

Get Started
/* Import dependencies */
const client = new pollenium.Client({
  signalingServerUrls: [
    'wss://begonia-us-1.herokuapp.com',
    'wss://begonia-eu-1.herokuapp.com',
  ],
  Worker: Worker,
  WebSocket: WebSocket,
  hashcashWorkerUrl: './browser/hashcash-worker.js'
})
const Bytes = pollenium.Bytes
const MissiveGenerator = pollenium.MissiveGenerator

/* Choose an application id */
const applicationId = Bytes.fromUtf8('my-app').padLeft(32)

/* Connect and send a message */
client.once('fullyConnected', async () => {

  const applicationData = Bytes.fromUtf8('Hello World!')

  const fmg = new MissiveGenerator(
      applicationId,
      applicationData,
      8 // difficulty
    )

  const missive = await fmg.fetchMissive()
  missive.broadcast()

})

/* Listen for messages from peers */
client.on('friend.missive', (missive) => {

  /* Verify the application id */
  if (!missive.applicationId.equals(applicationId)) {
    return
  }

  /* Use the application data however you like */
  console.log(
    missive.applicationData.getUtf8()
  )
})
          
Get Started