Go-ethereum: starting multiple geth console

Created on 25 Aug 2015  路  8Comments  路  Source: ethereum/go-ethereum

Hi,

I started geth mainnet using the following.

geth --networkid=12345 --genesis C:\Users\106862\genesis.json --datadir C:/Users/106862/.ethereum_experiment console

I also tried to get a private network going like the following.

geth --genesis example_genesis.json console

When I tried the above, I got a error to say Error String IPC: Access is denied.

I also tried forcing it to a different port like
geth --genedid example_genesis.json --port=35555 console

But i still got the same error.

Currently I have stopped the mainnet and running only the private network. This is making deploying contracts very difficult.

Most helpful comment

First of all:

geth --networkid=12345 --genesis C:\Users\106862\genesis.json --datadir C:/Users/106862/.ethereum_experiment console

Doesn't connect to the main net. If you provide a custom networkid your node will not be able to connect to nodes which are on the network. If you use a recent version of geth (and you should) you can omit the genesis argument since its embedded in geth. Your command should somewhat like this

geth --datadir C:/Users/106862/.ethereum_main <more optional argument> console

If you want to start a second node which you can use for development, testing and deployment you can setup a private network. Each geth instance needs its own datadir, unique ports and unique ipc endpoint. In your case you choose to disable the ipc interface which makes it a bit easier. And second you might want to use a custom genesis block for your private network. See https://github.com/ethereum/go-ethereum/wiki/Private-network for instructions and an example genesis file which you can adapt to your personal needs.

The command for you private instance will look something like:
geth --networkid 12345 --datadir c:/Users/106862/.ethereum_private --port 31313 --ipcdisable --genesis <path to genesis file> console

If you want to do some DApp development and need the JSON RPC HTTP interface you must add the --rpc argument. If you want to enable the rpc interface on the main and private geth instance make sure you specify a unique port for the rpc interface with --rpcport.

You can find more instructions here: https://github.com/ethereum/go-ethereum/wiki/Setting-up-private-network-or-local-cluster.

If you need more help just visit the gitter channel, there are people who can help you with this.

All 8 comments

Each geth instance will open a named pipe on the Windows platform where clients can attach to. Since you already have one instance running the second instance cannot create the named pipe since it already exists.

There are 2 options:

  1. Simply disable the IPC interface for one or both of your geth intances. This is no problem if you don't use it (e.g. geth attach). The command would than be something like geth --genesis some.genesis.json --ipcdisable console
  2. Specify a custom name for the pipe with the --ipcpath argument. Make sure that it follows the naming convenstion Windows uses for named pipes and that its unique.

Tried your first option and got the following error.

Fatal blockchain db error: The process cannot access the file because it is used by another process.

I will write (or update if such page already exists) a wiki page which explains how to run multiple geth instances and replace this comment with a link to it.

@meetreks You need to also supply a different datadir, I believe if you do that the ipcpath will automatically be different. See instructions here.

I tried that as well first and did not work. Which is why I reached out to the forum to try my luck. I think we need detailed instructions on how to run 2 geth nodes.

You might need to specify a different port with --port 20202 for instance. If you give me your error I can help you further.

First of all:

geth --networkid=12345 --genesis C:\Users\106862\genesis.json --datadir C:/Users/106862/.ethereum_experiment console

Doesn't connect to the main net. If you provide a custom networkid your node will not be able to connect to nodes which are on the network. If you use a recent version of geth (and you should) you can omit the genesis argument since its embedded in geth. Your command should somewhat like this

geth --datadir C:/Users/106862/.ethereum_main <more optional argument> console

If you want to start a second node which you can use for development, testing and deployment you can setup a private network. Each geth instance needs its own datadir, unique ports and unique ipc endpoint. In your case you choose to disable the ipc interface which makes it a bit easier. And second you might want to use a custom genesis block for your private network. See https://github.com/ethereum/go-ethereum/wiki/Private-network for instructions and an example genesis file which you can adapt to your personal needs.

The command for you private instance will look something like:
geth --networkid 12345 --datadir c:/Users/106862/.ethereum_private --port 31313 --ipcdisable --genesis <path to genesis file> console

If you want to do some DApp development and need the JSON RPC HTTP interface you must add the --rpc argument. If you want to enable the rpc interface on the main and private geth instance make sure you specify a unique port for the rpc interface with --rpcport.

You can find more instructions here: https://github.com/ethereum/go-ethereum/wiki/Setting-up-private-network-or-local-cluster.

If you need more help just visit the gitter channel, there are people who can help you with this.

Considering this resolved. Please reopen is your issue persists.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JMaxU picture JMaxU  路  3Comments

362228416 picture 362228416  路  3Comments

bgrieder picture bgrieder  路  3Comments

AdrianScott picture AdrianScott  路  3Comments

VenusHu picture VenusHu  路  3Comments