johnson86tw / quadratic-voting-contracts

Ethereum smart contracts for building QV applications on MACI.
GNU General Public License v3.0
7 stars 1 forks source link

pull access denied for maci, repository does not exist or may require 'docker login': denied: requested access to the resource is denied #12

Closed MBucklain closed 2 years ago

MBucklain commented 2 years ago

tried this command and got the error below sudo yarn hardhat run scripts/maci/6-genProofs.ts --network localhost

yarn run v1.22.18 $ /home/parallels/Desktop/final/quadratic-voting-contracts/node_modules/.bin/hardhat run scripts/maci/6-genProofs.ts --network localhost Generating typings for: 0 artifacts in dir: build/typechain/ for target: ethers-v5 Successfully generated 3 typings! Successfully generated 11 typings for external artifacts! Running docker-compose to generate proofs... Pulling maci (maci:)... pull access denied for maci, repository does not exist or may require 'docker login': denied: requested access to the resource is denied Done in 25.07s.

johnson86tw commented 2 years ago

Hi @MBucklain, I used this docker image to run maci CLI genProofs with docker-compose, so if you want to run this command, you should make sure that you have downloaded the image and have run the maci CLI successfully.

Another approach is that you can try setting up the maci repo and the environment and running the maci cli directly on your computer without docker.

MBucklain commented 2 years ago

Hi @MBucklain, I used this docker image to run maci CLI genProofs with docker-compose, so if you want to run this command, you should make sure that you have downloaded the image and have run the maci CLI successfully.

Another approach is that you can try setting up the maci repo and the environment and running the maci cli directly on your computer without docker.

I already installed the image before

Screen Shot 2022-06-21 at 12 51 45 PM
johnson86tw commented 2 years ago

Ok, can you get your docker login like this? image

And make sure you can run the command docker-compose.

MBucklain commented 2 years ago

Ok, can you get your docker login like this? image

And make sure you can run the command docker-compose.

Also I'm logged in and docker-compose works and still showing the same error

johnson86tw commented 2 years ago

Seems that the image name is wrong in the docker-compose.yml. Please update this repo to the latest commit and try running the command again, hope it works out for you

Fix: https://github.com/chnejohnson/quadratic-voting-contracts/commit/bf7c6993fc81fc92adba0d8b044b39c1f85d96fd

MBucklain commented 2 years ago

yeah it works but new issue happened


Generating typings for: 0 artifacts in dir: build/typechain/ for target: ethers-v5
Successfully generated 3 typings!
Successfully generated 11 typings for external artifacts!
Running docker-compose to generate proofs...
Creating quadratic-voting-contracts_maci_run ... 
Creating quadratic-voting-contracts_maci_run ... done
(node:1) UnhandledPromiseRejectionWarning: FetchError: request to http://host.docker.internal:8545/ failed, reason: getaddrinfo ENOTFOUND host.docker.internal
    at ClientRequest.<anonymous> (/root/maci/contracts/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (events.js:400:28)
    at Socket.socketErrorListener (_http_client.js:475:9)
    at Socket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 24.25s.
johnson86tw commented 2 years ago

I guess you're using Linux. Try editing this line of code for connecting local hardhat node from the docker container. https://github.com/chnejohnson/quadratic-voting-contracts/blob/bf7c6993fc81fc92adba0d8b044b39c1f85d96fd/maci-cli-defaults/localhost/defaults.js#L11

Change the link as follows:

var DEFAULT_ETH_PROVIDER = "http://172.17.0.1:8545/";

The problem is something like this: https://stackoverflow.com/questions/48546124/what-is-linux-equivalent-of-host-docker-internal

MBucklain commented 2 years ago

I have tried to use "http://172.17.0.1:8545/"

and got this error

Generating typings for: 0 artifacts in dir: build/typechain/ for target: ethers-v5
Successfully generated 3 typings!
Successfully generated 11 typings for external artifacts!
Running docker-compose to generate proofs...
Creating quadratic-voting-contracts_maci_run ... 
Creating quadratic-voting-contracts_maci_run ... done
(node:1) UnhandledPromiseRejectionWarning: HardhatError: HH108: Cannot connect to the network localhost.
Please make sure your node is running, and check your internet connection and networks config
    at HttpProvider._fetchJsonRpcResponse (/root/maci/contracts/node_modules/hardhat/src/internal/core/providers/http.ts:176:15)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at HttpProvider.request (/root/maci/contracts/node_modules/hardhat/src/internal/core/providers/http.ts:55:29)
    at GanacheGasMultiplierProvider._isGanache (/root/maci/contracts/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:317:30)
    at GanacheGasMultiplierProvider.request (/root/maci/contracts/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:306:23)
    at EthersProviderWrapper.send (/root/maci/cli/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)
    at getSigners (/root/maci/cli/node_modules/@nomiclabs/hardhat-ethers/src/internal/helpers.ts:45:20)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 20.13s.

then change it to "http://127.0.0.1:8545/"

and it tied to deploy MACI#polls contract but this error revealed

Generating typings for: 0 artifacts in dir: build/typechain/ for target: ethers-v5
Successfully generated 3 typings!
Successfully generated 11 typings for external artifacts!
Running docker-compose to generate proofs...
Creating quadratic-voting-contracts_maci_run ... 
Creating quadratic-voting-contracts_maci_run ... done
Error: there is no Poll contract with this poll ID linked to the specified MACI contract.
Done in 19.14s. 
johnson86tw commented 2 years ago

Yeah, seems that http://127.0.0.1:8545/ works!

and it tied to deploy MACI#polls contract but this error revealed

The problem is that you haven't deployed the poll contract. If you want to run genProofs successfully, please run through the scripts from 0 to 5 as follows

https://github.com/chnejohnson/quadratic-voting-contracts/blob/main/test/e2e/runScripts0-8.sh

MBucklain commented 2 years ago

thanks it works now