I was trying to store the new user on the multichain blockchain using streams before storing it to the database. I am getting socket error and when I am trying to store the new user using streams.
I have setup the multichainOptions correctly and running the blockchain locally
{ Error: socket hang up
[0] at createHangUpError (_http_client.js:313:15)
[0] at Socket.socketOnEnd (_http_client.js:416:23)
[0] at Socket.emit (events.js:187:15)
[0] at endReadableNT (_stream_readable.js:1081:12)
[0] at process._tickCallback (internal/process/next_tick.js:63:19) code: 'ECONNRESET' }
[0] User : undefined
******************************************* Here is the code
const newUser = new User({
name: req.body.name,
email: req.body.email,
avatar,
password: req.body.password
});
const dataStr = JSON.stringify({
name: newUser.name,
email: newUser.email,
avatar: newUser.avatar
});
//multichain code goes here
multichain.publish(
{
stream: "users",
key: "prateek",
data: StrToHex(dataStr)
},
(err, info) => {
console.log(`User : ` + info); # getting undefined here along with the error
}
Please if anyone can help I am newbie to multichain and this is my first project using it. I am using multichain-node