Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starting multiple geth console #1714

Closed
meetreks opened this issue Aug 25, 2015 · 8 comments
Closed

starting multiple geth console #1714

meetreks opened this issue Aug 25, 2015 · 8 comments

Comments

@meetreks
Copy link

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.

@bas-vk
Copy link
Member

bas-vk commented Aug 25, 2015

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.

@meetreks
Copy link
Author

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.

@bas-vk
Copy link
Member

bas-vk commented Aug 26, 2015

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.

@maran
Copy link
Member

maran commented Aug 26, 2015

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

@meetreks
Copy link
Author

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.

@maran
Copy link
Member

maran commented Aug 26, 2015

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

@bas-vk
Copy link
Member

bas-vk commented Aug 26, 2015

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.

@karalabe
Copy link
Member

karalabe commented Sep 1, 2015

Considering this resolved. Please reopen is your issue persists.

@karalabe karalabe closed this as completed Sep 1, 2015
tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this issue Jan 20, 2022
### Description

Observed `cmd/geth TestRegistryInGenesis` test failed intermittently on CI while running fine on my laptop.
Given that the failures ends with a timeout from what I observed, I'm suspecting CI's cpu cannot spinning up `geth` within current 5s timeout.
So I set timeout to 15s, and managed run it 1000 times on CI without failure.

### Other changes

- Deletes redundant `datadir` setup in the test.

### Tested

Run `TestRegistryInGenesis` 1000 times under CircleCI job `test-TestRegistryInGenesis-1000-times`, no single failure.
https://app.circleci.com/pipelines/github/celo-org/celo-blockchain/7107/workflows/342b4446-0a25-4c77-835c-d89dc5c29e84/jobs/70510

### Backwards compatibility

Yes, only modifies CircleCI config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants