1

I have a single geth node running a private blockchain with a network ID N and data directory data/. I had deployed a smart contract ContractName on the same and things were working fine. I wanted to start fresh once again, so I deleted the directory data/geth/ entirely and ran geth init and started my node with the same network ID N. However, when I enter truffle console and run ContractName.address, I am still returned an address. The block data has been reset and the new block number is 0. How is this happening?

2 Answers 2

1

Keystore folder of the data directory stores information for the accounts. Delete following folders to remove the accounts information.

Mac:~/Library/Ethereum
Linux: ~/.ethereum
Windows: %APPDATA%\Ethereum
1
  • 1
    I'd done that. The contract was still shown. Commented Jun 13, 2020 at 15:21
0

I found out the reason in the end. Turns out truffle console uses its own build files for contract addresses. So I had my previous compiled and deployed JSON files in the truffle build directory. Removing that directory showed my ContractName is not defined as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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