3

I have a private blockchain where I'm testing a contract and I want to re-deploy a very-slightly modified version. I need to delete the old one first. I control all of the nodes, so I can do this.

But I don't know how?

I tried deleting the ~/.parity/chains config dapps directories, but the contract is still out there.

Do I have to delete these directories on every node? Do I have to delete the "network" directory also?

  • Not a direct answer to your question but just so you know you can redeploy the modified contract and just use the address for the new contract instead. Probably much easier than constantly restarting a new private chain. – jojeyh Oct 20 '17 at 5:00
  • @jojeyh Thank you but I don't know anything about a contract address. This contract is accessible via its own RPC port, so I can only have one at a time. – stone.212 Oct 20 '17 at 5:07
  • @jojeyh I should say that that was good info. Just not really specific to this question. :) – stone.212 Nov 7 '17 at 6:05
  • can the contract send internal transactions? – Achala Dissanayake Nov 8 '17 at 16:03
  • @AchalaDissanayake I'm sorry but I don't know. I don't know much about writing contracts and I don't know what this one is all about. I just want to get rid of it. :) – stone.212 Nov 9 '17 at 2:04
5
+50
  1. Stop all nodes
  2. Delete blockcahin folder on every node
  3. Recreate your blockchain from genesis at one node
  4. Start this node
  5. Connect other nodes to it

Did not tried, do not have oportunity now:( Try if this can help

  • Please be more specific. As you see in my original question, "I tried deleting the ~/.parity/chains config dapps directories, but the contract is still out there." – stone.212 Nov 7 '17 at 5:30
  • Backup ~/.parity/keys (just copy somewhere). Remove ~/.parity. Create ~/.parity. Restore keys – Alexey Barsuk Nov 7 '17 at 6:21
  • Take a look at this too ethereum.stackexchange.com/questions/9163/… – Alexey Barsuk Nov 7 '17 at 7:31
  • That seems to be effectively the same as what I write in my first comment. But in that case, the contract is not deleted. – stone.212 Nov 7 '17 at 10:14
  • Did you try to run parity as single node? I supose that your node, where you removed bolckchain db, connects to other nodes and takes blockchain from them. Another suggestion: check the blockchain directory path - take a look at github.com/paritytech/parity/issues/6634 – Alexey Barsuk Nov 7 '17 at 11:17
1

The contract cannot be "out there" if all nodes on your private network delete all their data. So, as previously described by Alexey Barsuk, you just need to stop all nodes and then delete all their blockdata. Do not forget to backup your keys.

  • You and Alexey are probably right. I must have made a mistake and possibly didn't delete the data from all nodes. Thank you. – stone.212 Nov 14 '17 at 1:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.