quorum icon indicating copy to clipboard operation
quorum copied to clipboard

How can I recover the private contract after the node data are all lose

Open matrixoneken opened this issue 8 years ago • 1 comments

I have network about 3 node, sush as node1, node2, node3. I deploy a private smart contract on node1 and set the private for is the public key of node2. Everything is ok. Now The quorum work dir and constellation work dir about node2 are all loss. I recover node2 by following step : 1 ) Get the node2 address and raftid which have been backup in database before 2 ) Call node1 raft.removePeer with raftid from setp 1 3) Initialize the work dir and constellation work dir of node 2 with the key files which have been backup before 4) Call node 1 raft.addPeer with the node2 address from setp 1 and get a new raftId 5) Run node 2 with --raftjoinexisting and new raftid from step 4

Follwoing above step node2 can be recovered without any error. But when I got the private contract which send to node2 before with web3.js, I got exception. I want to know how can I recover the private contract which sended to node2 before?

Thank you!

matrixoneken avatar Aug 30 '18 02:08 matrixoneken

Hi Matrixoneken,

Did you have a backup of the Constellation working directory, or was it just the key files? If the Constellation database wasn't restored, Constellation does not have the private transaction data anymore and Quorum2 thinks it is not party to that transaction when processing it.

There is an HTTP API in Constellation that can be used to restore the transactions (asking Constellation1 to resend the transactions to Constellation2), but this can prove to have some issues depending on the storage type.

Note that if you use Tessera as your private transaction manager, this process is automatically executed - just make sure that Tessera has finished this startup process before Quorum is started so the private transaction data is available.

prd-fox avatar Sep 04 '18 10:09 prd-fox