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?
Add a comment
|
2 Answers
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
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.