gpt4 book ai didi

node.js - Tendermint Node 崩溃

转载 作者:太空宇宙 更新时间:2023-11-03 22:08:37 27 4
gpt4 key购买 nike

我在我的node js服务器中使用了lotion js,它被用作区 block 链技术。有时我的 Tendermint Node 崩溃了。由于我对区 block 链概念不熟悉,我不知道崩溃背后的原因。

我没有在 Node 模块内进行任何更改

const admin = require("firebase-admin")
const db = admin.database()

let app = require('lotion')
({
initialState: {count: 0}
})

function txHandler(state, tx, chainInfo) {
state.count++
}

var port = process.env.PORT || 3000
app.use(txHandler)
app.listen(port)

db.ref('Deal').orderByChild('createdTime').startAt(Date.now())
.on("child_added", function(snapshot, prevChildKey) {

var txnObject = {}
txnObject.senderId = snapshot.val().senderId
txnObject.name = snapshot.val().name
txnObject.phoneNumber = snapshot.val().phoneNumber
txnObject.receiverId = snapshot.val().receiverId
txnObject.amount = snapshot.val().amount

axios.post('http://localhost:' + port + '/txs', txnObject).then(function(response){
console.log('saved successfully')
}).catch(function(error) {
console.log('failed to save')
console.log(error)
})
})

这是我的index.js 文件内容。

我得到的错误是:

/Users/chandrika/Documents/lotion-js/node_modules/supercop.js/lib.js:97
throw ex;
^

Error: Tendermint node crashed
at ChildProcess.tendermintProcess.on (/Users/chandrika/Documents/lotion-js/node_modules/lotion/lib/tendermint.js:90:13)
at ChildProcess.emit (events.js:160:13)
at maybeClose (internal/child_process.js:943:16)
at Socket.stream.socket.on (internal/child_process.js:363:11)
at Socket.emit (events.js:160:13)
at Pipe._handle.close [as _onclose] (net.js:562:12)

有人可以帮助我吗?预先感谢您!

最佳答案

在终端中尝试此命令

$ rm -rf ~/.lotion

然后$node index.js这对我有用!!!

关于node.js - Tendermint Node 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48986816/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com