Reddit 에 올린글인데, 뗑글에도 동시 포스팅 합니다.
방법은
datadir 구분,
port 구분, / rpcport, wsport 구분 (사용하면)
특히,
Windows 에서는 ipcpath 를 구분해서 사용하여야 합니다.
사용 예제는 아래를 참고 하시기 바랍니다.
http://trustfarm.io/wp/?p=42
How to Install ETH and ETC in same computer, and works with CLI interface
POSTED ON 2016년 8월 11일 BY TRUSTFARM
In most case,
Most of Normal users have very confusing how to use eth / etc in the same time, in the same computer.
In trustfarm.io ETH / ETC Pool has exist on same server.
It’s very easy way is set different block chain data directory , different accounts , different ports.
It makes the differentiate co-existense of ETH/ETC.
In that case, block synchronization is independent. It means that geth process works like independents program.
In my case, I’ve configured geth in Ubuntu server.
different accounts, different ports, different datadir.
most important thing is make diffrent datadir , next different ports.
Here’s my ETH/ETC ubuntu setup
# geth-node for ETC description "Trustfarm geth Ethereum Classic node" env DAEMON=/usr/bin/geth env UIDGID="etcpool" # env SUPPORT_FORK="--oppose-dao-fork" # env SUPPORT_FORK="--support-dao-fork" env RPCPORT=28545 env DATADIR=/backup/${UIDGID}_data env CONFIG="--oppose-dao-fork --rpc --rpcport 28545 --ws --wsport 28546 --port 50303 --datadir /backup/etcpool_data/ --identity 'KT-trustfarm-etcpool' --rpccorsdomain 'http://localhost:28000' --etherbase 0xaf866329223e9f72efb01119a93cfd63f5a2c6ea --extradata 'trustfarm pool/geth-etc' " env NAME=geth_etcpool start on filesystem or runlevel [2345] stop on runlevel [!2345] setuid etcpool setgid etcpool kill signal INT respawn respawn limit 10 5 umask 022 pre-start script test -x $DAEMON || { stop; exit 0; } end script # Start script exec $DAEMON $CONFIG 2> etcnode.`date +%y%m%d-%H%M%S`.log end script post-start script echo "$UIDGID $DAEMON started" end script
in case of ETH is similar, port number is added to 1xxxx , so rpcport is 18545 ,
--support-dao-fork --rpc --rpcport 18545 --ws --wsport 18546 --port 40303 --datadir /backup/ethpool_data/
You can easily customize it.
Above Ubuntu startup script will be modified for windows batch file , with some modification of IPC path.
And then You can select each ETC/ETH nodes in your computer easily.
If you are familiar with CLI then you can attach each node when you needs.
geth --datadir /backup/etcpool_data/ attach <-- attach ETC node
and
geth --datadir /backup/ethpool_data/ attach <-- attach ETH node
In that case, you can use web3 api within geth
in geth attach is connected with IPC , which pipe files are exists in datadir.
— In windows works is a little bit different than above configurations.
in Ubuntu geth.ipc , IPC named pipe is exist in datadir , so, “geth –datadir /path/to/etcdb attach ” will works.
But, in windows,
You can start geth with followings. for ETH – ipcpath to “eth.ipc”
--support-dao-fork --rpc --rpcport 18545 --ws --wsport 18546 --port 40303 --datadir "c:\backup\ethpool_data\" --ipcpath "eth.ipc"
and, ETC case –ipcpath to “etc.ipc”
--oppose-dao-fork --rpc --rpcport 28545 --ws --wsport 28546 --port 50303 --datadir "c:\backup\etcpool_data\" --ipcpath "etc.ipc"
You can attach in geth CLI for ETH/ETC each one,
geth attach ipc://./pipe/etc.ipc <---- in Windows geth attach ipc://backup/etcpool_data/geth.ipc <-- in Alternative method on Ubuntu
And then you can use CLI interface and Another 3rd party Ethereum application will makes interface with each geth node.
And Next time I’ll post GUI app interfacing case.