Geth Clients – How to Switch from Morden to Ropsten Testnets?

cliclientsgo-ethereummordenropsten

I installed a v.0.8.7 client and tried switching to Ropsten, following these instructions. Namely, I typed in:

dyn906-29:~ sam$ geth -- datadir /Users/sam/Library/Ethereum/testnet/geth/chaindata/ init /Users/sam/Library/Ethereum/testnet/testnet_genesis.json; geth -- datadir /Users/sam/Library/Ethereum/testnet/geth/chaindata/ --networkid 3 console

… synchronization started, with typical (i.e., after I let it run about 10 minutes) console output:

I1124 12:07:01.281067 eth/downloader/downloader.go:298] Synchronisation failed: block download canceled (requested)
I1124 12:07:23.178469 core/blockchain.go:975] imported 3 block(s) (0 queued 0 ignored) including 0 txs in 1.001425657s. #84205 [dc3d3bcd / c0b43021]
I1124 12:07:24.448356 core/blockchain.go:975] imported 3 block(s) (0 queued 0 ignored) including 2 txs in 8.001122ms. #84208 [e716f763 / 9cdfe671]
I1124 12:07:33.003664 core/blockchain.go:975] imported 2048 block(s) (0 queued 0 ignored) including 1897 txs in 4.743529105s. #86256 [2c5e179c / dbc9325e]
I1124 12:07:37.833884 core/blockchain.go:975] imported 2048 block(s) (0 queued 0 ignored) including 676 txs in 4.821595483s. #88304 [f9215a23 / 62150759]

What confuses me in this output it indicates I downloaded as many as 86256 blocks (see end of last line)… but I see here that there are only about 35000 blocks in the new testnet so far.

So I have the impression that I am synchronising with Morden..

1. Am I currently synchronizing with Morden (instead of with Ropsten)?

2. How can I make sure my Client is synchronizing with Ropsten?

Thanks.

EDIT: The GUI mentions a total of ca. 1,800 K blocks… so I am fairly positive my Client is synchronising with Morden. So how to move to Ropsten?

Best Answer

Using Geth 1.5.3 and later, it's 2 steps:

  1. Run geth --testnet removedb to delete your blockchain database for the Morden network.

  2. Run geth --testnet


ORIGINAL:

When you use geth init, the datadir should end with /testnet. For example: /Users/sam/Library/Ethereum/testnet

When you use other commands like geth console, the datadir should be the parent directory, in this example: /Users/sam/Library/Ethereum

Yes, it is confusing. But when Geth 1.5.3 is released, geth --testnet will simplify it and you don't need to bother with geth init.

It is helpful to start with a clean datadir (you may need to manually create the /testnet subdirectory), but make sure that you back up your existing datadir: be careful to make sure you do not lose any keystore.