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

Problems getting ganache to run successful on Ubuntu Linux - Docker Image harmony-localnet-ganache Does not exist #2

Open
devonartis opened this issue Jul 2, 2021 · 10 comments
Assignees

Comments

@devonartis
Copy link

devonartis commented Jul 2, 2021

I closed the first ticket because the issue stated problems getting Ganache running on OSX after reading over the documentation, I realized that this was never tested on on OSX or Windows the documentation specifically states it was tested on Manjaro.

Prerequisites

Docker 20.10+
node 12+
yarn
NOTE: Tested on Manjaro Linux 21.0.2

Armed with the knowledge that it was only tested on Manjaro which is a linux based system I attempted to test the application on Ubuntu the following errors occurred running ubuntu

Error: Command failed: docker run --name harmony-localnet-ganache --rm -d  -p 9500:9500 -p 9800:9800 -p 9801:9801 -p 9501:9501 harmonyone/localnet-ganache
Unable to find image 'harmonyone/localnet-ganache:latest' locally
docker: Error response from daemon: pull access denied for harmonyone/localnet-ganache, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.

    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

After reviewing Harmonyone docker repo I realized that "harmony-localnet-ganache" image does not exist.

@devonartis devonartis changed the title Problems getting ganache to run successful on Ubuntu Linux Problems getting ganache to run successful on Ubuntu Linux - Docker Image harmony-localnet-ganache Does not exist Jul 2, 2021
@blockjoe
Copy link

blockjoe commented Jul 3, 2021

I was able to build and run on Ubuntu 20.10 through the following process.

  1. I ran scripts/build-docker.sh
  2. I had to install python 2 as whatever version of Ganache was forked assumed /usr/bin/python was still pointing to python 2 sudo apt install python2
  3. I moved into ganache-harmony and installed a python virtual environment there and activated it. virtualenv --python=$(which python2) venv && source venv/bin/activate
  4. Built Ganache with npm install.
  5. Ran it with npm run dev.

@devonartis
Copy link
Author

@blockjoe thank you .. So basically you did not have any success running ./ganache-2.6.0-beta.3-linux-x86_64.AppImage.

I would like to update the documentation so if I was to run this on Ubuntu I would

Step 1

git clone --recursive https://github.com/harmony-one/harmony-one-ganache-support
cd harmony-one-ganache-support

Step 2

Ran the scripts in scripts/build-docker.sh

Step 3

Install python 2 sudo apt install python2

Step 4

Cd to ganache-harmony and installed a python virtual environment there and activated it. virtualenv --python=$(which python2) venv && source venv/bin/activa

Step 5

Built Ganache with npm install.

Step 6

Run Harmony Ganache by running npm run dev

I was able to build and run on Ubuntu 20.10 through the following process.

  1. I ran scripts/build-docker.sh
  2. I had to install python 2 as whatever version of Ganache was forked assumed /usr/bin/python was still pointing to python 2 sudo apt install python2
  3. I moved into ganache-harmony and installed a python virtual environment there and activated it. virtualenv --python=$(which python2) venv && source venv/bin/activate
  4. Built Ganache with npm install.
  5. Ran it with npm run dev.

@Severino
Copy link

Severino commented Jul 9, 2021

@blockjoe could you just get the program to launch or did you also succeed in running ganache on harmony-one network?

I followed your instructions on Ubuntu 20.04 and I am stuck at "Starting localnet Docker container..."
Console not logging anything. It has been like 10 minutes, think there will be nothing happening anymore 🤣

@givp
Copy link

givp commented Jul 12, 2021

@devonartis @Severino I'm going to look into this shortly. Will keep you posted.

@hypnagonia
Copy link

@Severino i have tried fresh installation of ubuntu 20
installed docker
https://docs.docker.com/engine/install/ubuntu/

built an image
scripts/build-docker.sh
successfully ran localnet using
docker run --name harmony-localnet-ganache --rm -d -p 9500:9500 -p 9800:9800 -p 9801:9801 -p 9501:9501 harmonyone/localnet-ganache

@Severino
Copy link

When I add a 'go mod tidy' to the Dockerfile the container starts successfully.
But Ganache shuts down the running container and tries to start the localnet.

Now I'm stuck at 'Waiting for localnet to be ready ...'
I waited 10 minutes.

I got an error when the app image tried to update ganache:

10:48:34.261 › Checking for update
10:48:35.320 › Error: HttpError: 404 
"method: GET url: https://github.com/trufflesuite/ganache/releases/download/vganache%407.0.0-alpha.1/latest-linux.yml\n\nPlease double check that your authentication token is correct. Due to security reasons actual status maybe not reported, but 404.\n"

When requesting the URL in the browser I also get an 404, even when being logged in.

@Severino
Copy link

I could display the progress what's happening inside the container. I get this error message.
Can you tell me what this could be about?

image

Also weird that the IP addresses are all 0.0.0.0

@Severino
Copy link

Okay I got two new things (1) workaround (2) some problem investigation:
(1) This fork from @isthiscodefluffyruns ganache when the localnet is initialized manually: https://github.com/isthiscodefluffy/ganache

(2) For this repo I think it comes down to this line in code:

assert util.is_active_shard(endpoints[0], delay_tolerance=20), "Shard 0 is not making progress..."

That just has the timeout set too low. I'm getting there.

@Severino
Copy link

Okay I found the error, as it was just pointing to a wrong endpoint/port which caused the error.
But the initial funding does not work correctly yet.
Will create a pull request probably tomorrow.

@saugion
Copy link

saugion commented Jan 27, 2022

Hi,
after struggling a bit I've managed to make it run on OS X. Steps in case you need them:

  1. Download the repo
  2. Make sure to have Docker, Xcode, Node 14.14.0 and Yarn installed
  3. CD and run scripts/build-docker.sh
  4. CD ganache-harmony, open package.json and at the end of the file set the node version to 14.14.0
  5. Run yarn install from the terminal and wait. It will get stuck at the end because after installing the packages it will try to start. Ctrl + C to stop the process
  6. Run docker run --name harmony-localnet-ganache --rm -d -p 9500:9500 -p 9800:9800 -p 9801:9801 -p 9501:9501 harmonyone/localnet-ganache from the terminal
  7. Run yarn run start

I've only 1 issue: all the addresses have balance = 0. The rest seems fine.

Hope it helps

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

7 participants