我正在使用nodejs应用程序使用智能合约和松露将数据添加到go-ethereum(geth)本地环境 . 如果由于某种原因发生任何事情,我需要停止geth并在以后恢复,我无法获取数据 . 重现:

ps -aux | grep geth
sudo kill -9 ProcessID
geth --datadir ./myDataDir --rpc --targetgaslimit 18446744073709551615 --networkid 1441 console 2>> myEth.log
miner.start()
personal.unlockAccount(personal.listAccounts[0], "Password", 0)
pm2 restart myApp

当我尝试在停止geth之前使用添加的数据的GET API时,在NodeJS应用程序上显示错误:

0|myApp | 21-06 12:19:44.271: You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
0|myApp | Error: Invalid address passed to BankFactory.at(): 0x

这显然是分配地址的冲突,因为它没有读取BankFactory的正确地址 . Contract 地址通常是在我执行 truffle deploy 然后我将 Contract 复制到我的应用程序目录时生成的,但在这种情况下它们仍然在我的节点应用程序中,所以看起来区块链本身的 Contract 被删除或更改了!

如何解决?