Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Connect Ganache GUI to Ganache CLI? #322

Open
siman opened this issue Jan 30, 2018 · 29 comments
Open

Connect Ganache GUI to Ganache CLI? #322

siman opened this issue Jan 30, 2018 · 29 comments

Comments

@siman
Copy link

siman commented Jan 30, 2018

Is it possible to connect Ganache GUI to Ganache CLI? So far I see that they don't work together :(
What I am trying to achieve: run Ganache CLI on a server in a background and connect to it with GUI on my local laptop.

@n1c01a5
Copy link

n1c01a5 commented Mar 22, 2018

change the port 7545 => 8545 in the parameters and restart Ganache

@nickysemenza
Copy link

This isn't working for me, Ganache GUI is just starting up a server on 8545 as well...

@kowsheek
Copy link

kowsheek commented Apr 3, 2018

They have to have the same networkId. You can change the networkId of ganache-cli using the -i flag. If you have the GUI running though, you won't need the CLI.

@nickysemenza
Copy link

Hmm it's still not working for me.
I have Ganache configured like so:
image
and then i'm running ganache-cli --deterministic --networkId 999999 inside a docker container on the same computer, and exposing 8545. I can connect to ganache-cli over rpc using Mist/etc running outside of docker, so the communication is working.

Ganache shows this in the logs

[3:41:13 PM] Starting server with configuration: {"hostname":"127.0.0.1","mnemonic":"candy maple cake sugar pudding cream honey rich smooth crumble sweet treat","network_id":999999,"port":8545,"total_accounts":10,"unlocked_accounts":[]}

This kind of implies it's trying to spin up a ganache-cli server internally, instead of connecting to one with that networkid/port

@karneaud
Copy link

karneaud commented Apr 8, 2018

ever got this to work? @nickysemenza

@nickysemenza
Copy link

nickysemenza commented Apr 8, 2018 via email

@kowsheek
Copy link

kowsheek commented Apr 9, 2018

If you have the GUI running on 8545, you don't need to run ganache-cli again. If the container can read that port you should be able to access it via RPC.

@siman
Copy link
Author

siman commented Apr 9, 2018

@kowsheek the idea behind having CLI and GUI is to run CLI on Ubuntu server, and connect GUI on my laptop and see what is going on in server's blockchain. I cannot run GUI on Ubuntu server.

@DanielRamosAcosta
Copy link

Any updates on this?

@mikeseese
Copy link
Contributor

Hey everyone! As you have found out, Ganache currently cannot connect to another RPC endpoint such as ganache-cli.

With that said, unfortunately we don't have an update on if/when this will be implemented.

It's definitely on our radar, but not on deck to implement.

@lakamsani
Copy link

@seesemichaelj or anyone else: is there any way to start the Ganache UI electron app with high ether values for all its accounts instead of just 100. I need it to perform some tests that involve high ether values. Like this script from Open Zeppelin: https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/scripts/test.sh . I 'am using it to successfully do my test with ganache-cli but UI app would be better for demo purposes. Thx.

@mikeseese
Copy link
Contributor

@lakamsani in the next release in the coming weeks, there will be some additional settings you can change to do this.

In the meantime you can modify your settings file:

  • MacOS: ~/Library/Application\ Support/Ganache/Settings
  • Windows: %APPDATA%\Ganache\Settings.
  • Linux: either $XDG_CONFIG_HOME/Ganache/Settings or ~/.config/Ganache/Settings.

The "server" object actually gets passed as is to ganache-cli/core. So you can just add the default_balance_ether attribute here (see https://github.com/trufflesuite/ganache-core/blob/develop/README.md#usage)

@lakamsani
Copy link

@seesemichaelj thx for that suggestion. I tried and it doesn't seem to pick up anything from there. Neither the mnemonic nor the default_balance_ether. I 'm running via npm start from the cloned repo. Would it look elsewhere in this case?

@lakamsani
Copy link

I was actually able to save those values from the GUI preferences! Should have looked there first. 👍

@mikeseese
Copy link
Contributor

@lakamsani Ah, yes the Settings file is actually at .../Electron/Settings instead of .../Ganache/Settings when you run npm start

You are correct; they are in the GUI in the develop branch. It should go without saying, but working out of the develop branch can come with bugs as you're running with the latest stuff.

@elsaVelazquez

This comment has been minimized.

@mikeseese
Copy link
Contributor

If someone was interested in tackling this issue (I saw @oxidizer was potentially interested [or I have the wrong GitHub username]), some points of interest for you to see the interactions between the GUI and ganache-core to try to abstract it to point to a CLI instance rather than starting one up:

This may have once been somewhat trivial, but after we did the work for workspaces (which are not supported in ganache-core/cli) there are some nuances that may not be so easy to port the functionality

@vforvalerio87
Copy link

Any updates on this?

As an alternative, since the GUI still uses the same ganache-core/cli, can you use Ganache GUI to do the fork directly instead of using the cli?

If none of the above are possible today, is there a way we could fund the development of this feature so it moves higher up the list? Feel free to reach out directly if you want to discuss this further at valerio at ocelot dot net

Thanks

@mikeseese
Copy link
Contributor

@davidmurdoch has really become the owner around Ganache and would be able to provide a better response, so I'll defer to him on this one

@dportabella
Copy link

I also have ganachi-cli running on a development server.
is there any web application (simulating ganachi-gui) that I could install on the server, that connects to ganachi-cli?

@SalahAdDin
Copy link

@dportabella Did you find something?

@diogomartino
Copy link

@SalahAdDin I'm also interested. Did you find anything?

@SalahAdDin
Copy link

@Bruxo00 Unfortunately.

@dportabella
Copy link

@Bruxo00, I gave up on ganache temporally. I am currently using the free version of the infura.io service.

@jknight
Copy link

jknight commented Dec 7, 2020

Maybe I'm missing something, but this would seem like a great feature on an already amazing UI : it can spin up its own blockchain, the way it does today, or connect to an existing running instance and just be a UI

Screen Shot-20201207-1417 26 WET-jpegoptim

@adamwojt
Copy link

adamwojt commented Jun 2, 2021

I second that. I tried today and Ganache GUI wants to spawn another chain. Would be good to have that supported. On top of above described use-case with Ubuntu server there is one more. For brownie users when using development console, ganache-cli is automatically spawned. All I need in this case is block explorer.

@Plumillon
Copy link

Need to have that supported, I'm running ganache-cli on a Docker container and would love to explore it via Ganache UI

@samholmes
Copy link

Updates on this? I prefer ganache-cli to start the RPC service over the UI. This way the UI is optional for development and is only used when needed to explore the local blockchain created by ganache-cli.

@davidmurdoch
Copy link
Member

I started work on this here: #5633

Anyone savvy enough with JSON-RPC, web3.js, and React want to give it a shot at optimizing this to handle mainnet in a way that doesn't crawl to a hault when viewing the transactions tab? Bonus points if you get Truffle Project and Events working!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests