How To Run Both Ethereum & Ethereum Classic Blockchains On The Same Computer

in #ethereum7 years ago

Maybe I missed something, but I was hunting around the internet for far too long trying to figure out how to run both Ethereum and Ethereum Classic blockchains on the same computer. Hopefully this will help a few folk out and save them some time!

Most of what I found were dated posts about how to split your Ether after the fork happened - not very helpful as it didn't apply to me, but I'm now running both blockchains successfully on Ubuntu.

I haven't had the need to run both simultaneously, and thus haven't tried it but it should be as simple as changing the Geth port one of them uses.

Anyway, down to it!

1. Download

ETH

Wallet/Geth
https://github.com/ethereum/mist/releases

ETC

Wallet
https://github.com/ethereumproject/mist/releases
Geth
https://github.com/ethereumproject/go-ethereum/releases/

2. Paths & Directories

Create the directories that will hold all the data, here I put it in my "Downloads" in a folder called "eth-both-chains", each with their own respective folder: "classic" and "core":
mkdir -p ~/Downloads/eth-both-chains/classic/ ~/Downloads/eth-both-chains/core/

Our folders will end up looking something like this after starting it up:

ETH

Create the folder that will hold the blockchain data:
mkdir -p ~/Downloads/eth-both-chains/core/data/chaindata

Create the folder that will hold your wallet:
mkdir -p ~/Downloads/eth-both-chains/core/data/keystore

Note; if you have already downloaded the blockchain you can move the existing data into this folder from:
~/.ethereum/chaindata
If you do this make sure you're moving the correct blockchain into the correct folder!

Extract Geth and the Ethereum Wallet we've downloaded into the appropriate directories i.e. in this case:
~/Downloads/eth-both-chains/core/Ethereum-Wallet-linux64-0-8-10/
~/Downloads/eth-both-chains/core/geth-1-6-6

ETC

Create the folder that will hold the blockchain data:
mkdir -p ~/Downloads/eth-both-chains/classic/data/mainnet/chaindata/

Create the folder that will hold your wallet:
mkdir -p ~/Downloads/eth-both-chains/classic/data/mainnet/keystore/

Extract Geth and the Ethereum Classic Wallet we've downloaded into the appropriate directories i.e. in this case:
~/Downloads/eth-both-chains/classic/Ethereum-Classic-Wallet-linux64-0-8-1/
~/Downloads/eth-both-chains/classic/geth-classic-3-5-0

Now we have all the needed folders and it will create any other folders we need when it's started up.
Onto the next step; creating our startup scripts!

3. Start Scripts

We'll be making two scripts to make life easier for us, rather than entering the commands every time we want to start it - one for the Geth background process, and another script for starting up the Wallet interface.

Place the commands in the script file. Obviously if you have different paths/filenames you'll need to adapt the commands.

ETH

~/Downloads/eth-both-chains/core/start.sh
#!/bin/bash
./geth-1-6-6 --datadir "./data" 2>>geth.log

~/Downloads/eth-both-chains/core/start-wallet.sh
#!/bin/bash
Ethereum-Wallet-linux64-0-8-10/ethereumwallet --datadir ./data/ --rpc ./data/geth.ipc

ETC

~/Downloads/eth-both-chains/classic/start.sh
#!/bin/bash
./geth-classic-3-5-0 --datadir "./data" 2>>geth.log

~/Downloads/eth-both-chains/classic/start-wallet.sh
#!/bin/bash
Ethereum-Classic-Wallet-linux64-0-8-1/Ethereum-Wallet --datadir ./data/ --ipcpath ./data/mainnet/geth.ipc

Note; if you are downloading the blockchains for the first time, you can add the "fast" option here to speed the whole process up significantly. Once the blockchain is downloaded, remove these options. If you have limited memory on your PC, you may want to adjust the cache option to a lesser size (default is 128MB).

ETH

~/Downloads/eth-both-chains/core/start.sh
#!/bin/bash
./geth-1-6-6 --fast --cache=2048 --datadir "./data" 2>>geth.log

ETC

~/Downloads/eth-both-chains/classic/start.sh
#!/bin/bash
./geth-classic-3-5-0 --fast --cache=2048 --datadir "./data" 2>>geth.log

Make sure our scripts have executable permissions:
chmod +x ~/Downloads/eth-both-chains/core/start.sh ~/Downloads/eth-both-chains/core/start-wallet.sh

chmod +x ~/Downloads/eth-both-chains/classic/start.sh ~/Downloads/eth-both-chains/classic/start-wallet.sh

4. Start Her Up!

If you have an existing wallet you want to import here, be sure you've moved them into the respective "keystore" folder.

ETH

Open up a terminal and change to the Ethereum directory:
cd ~/Downloads/eth-both-chains/core/

Start the Geth process running:
./start.sh

Finally, in another terminal start the Ethereum Wallet:
./start-wallet.sh

ETC

Open up a terminal and change to the Ethereum Classic directory:
cd ~/Downloads/eth-both-chains/classic/

Start the Geth process running:
./start.sh

Finally, in another terminal start the Ethereum Classic Wallet:
./start-wallet.sh

5. Enjoy!

Crack open a cool beer and wait for the blockchain to sync, you've done it!
You can now run both blockchains and wallets independant of each other.
I hope you found my first Steem post useful :)

Sort:  

In both cases I have failed to connect to:

{"path": "./data/geth.ipc"}

Any ideas?

Make sure it's the right path for the right chain!
If you run start.sh, browse to that folder and check that geth.ipc is there, if not change it to where it is (remember these are relative paths from the scripts).
Then when you run start-wallet.sh it should be able to connect.

Need windows tutorial.

Congratulations @scotg! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.20
TRX 0.16
JST 0.030
BTC 65856.98
ETH 2663.80
USDT 1.00
SBD 2.88