message bus for ravencoin
rvnsocketd has a dependency on rvndb.
npm install --save rvnsocketd
If you already have RvnDB running on port 22879, you can simply do this:
const rvnsocketd = require('rvnsocketd')
rvnsocketd.init()
You will see a screen like this:
Now open your browser to the socket URL and you'll see SSE pouring in.
That's the raw firehose. You probably don't want to consume the whole thing, so make sure to add a rvnquery filter. Learn more at https://bitsocket.org/docs
You can specify the Zeromq subscriber from a rvndb node, like this:
const rvnsocketd = require('rvnsocketd')
rvnsocketd.init({
rvn: { host: "127.0.0.1", port: 28769 },
})
By default Rvndb's zeromq publisher broadcasts to port 28769, but you can customize if you want.
By default, the SSE port is automatically 3001. You can customize this:
const rvnsocketd = require('rvnsocketd')
rvnsocketd.init({
socket: { port: 3001 }
})
// Step 1. express.js web server init
const express = require("express")
const app = express()
app.listen(3000 , function () {
console.log("web server listening at " + port)
})
// Step 2. pass the express server to rvnsocketd
const rvnsocketd = require('rvnsocketd')
rvnsocketd.init({
socket: { app: app }
})

