Questions tagged [ganache-cli]

Ganache CLI, part of the Truffle suite of Ethereum development tools, is the command line version of Ganache, your personal blockchain for Ethereum development.

Filter by
Sorted by
Tagged with
0 votes
1 answer
14 views

Access deployed contracts on Ganache local blockchain - BrownieEnvironmentError: Functionality not available in local environment

Using a generic SimpleStorage.sol contract and a deploy.py I'm able to create a contract on a Ganache local blockchain and access it during execution. On brownie console is possible to do the same ...
user avatar
0 votes
0 answers
7 views

ganache-cli ganache-cli --fork after machine restart

I use ganache-cli to fork from mainnet and develop. But everytime I reset my computer, I need to restart the ganache-clie and changes that I have done on forked version are lost. Is there a way to ...
user avatar
  • 101
0 votes
0 answers
11 views

What's the best way to create/deploy an oracle contract on a ganache-cli testnet?

I'm working on an academic project using a ganache-cli testnet, I've got some Python code which transmits a few variables through API, and I'd like to create/deploy a smart contract to my testnet that ...
user avatar
  • 1
1 vote
1 answer
49 views

How do you import a custom unlocked account from Ganache-CLI into MetaMask?

I'm attempting to write some test contracts that interacts w/ Uniswap and am using the following stack: Remix (Injected Web3) -> MetaMask -> Ganache-CLI -> Alchemy (Fork of Ethereum Mainnet) ...
user avatar
  • 113
0 votes
1 answer
19 views

is there a way to use ganache with dapps

For development I use Ganache and forking the mainnet. I also have a metamask wallet than can access this. The issue is that every-time I want to do something on a contract (like aave, uniswap etc) I ...
user avatar
0 votes
2 answers
41 views

Error : contract.methods.myfunction().call() is not a function

I'm new to web 3 and I'm trying to interact with a contract deployed with ganache and I get an error here is a screenshot: `
user avatar
  • 5
0 votes
0 answers
13 views

Error While trying to deploy smartcontract via ganache-cli

How do I solve error concern timeout, I tried all. I closed and restarted my system but I'm still getting Timeout error, below is the error: at Timeout._onTimeout (C:\\Users\\USER\\AppData\\Roaming\\...
user avatar
0 votes
1 answer
196 views

Windows Ganache install Errors [closed]

I'm attempting to install ganache via npm install ganache from my windows machine using PowerShell. Upon execution, a list of errors is populated. One asked me to install python which I thought was ...
user avatar
  • 107
0 votes
1 answer
59 views

ganache-cli functions.balanceOf web3.exceptions.BadFunctionCallOutput

I have forked BSC testnet using Ganache v7.04 and I am able to swap BNB for a token using the PancakeSwap contract and check the native balance without issue, but now when I am working on a script to ...
user avatar
0 votes
1 answer
94 views

Ganache and webscockets

I'm searching the docs, but, I cannot find anything. Does ganache support WebSocket connections? People seem to use for web socket connections in different posts.
user avatar
2 votes
0 answers
132 views

Brownie ConnectionResetError on running forks

I am running a test script with mainnet-fork using alchemy. The test appears to be successfully completed, but during the tear down bit, brownie throws up: ConnectionResetError: [WinError 10054] An ...
user avatar
  • 21
1 vote
1 answer
62 views

truffle with ganache uses "UNKNOWN" network instead of "development"

When I run truffle migrate --reset and then truffle networks I see that the contracts were deployed to a network named UNKNOWN. I have this configuration: development: { host: "127.0.0.1&...
user avatar
1 vote
0 answers
74 views

How to install ganache Cli with the new update on chromeos?

i tried installing ganache cli on chromeos with npm but it keeps giving me this error: npm WARN deprecated ganache-cli@6.12.2: ganache-cli is now ganache; visit https://trfl.io/g7 for details npm WARN ...
user avatar
0 votes
1 answer
86 views

My contract is failing to deploy because my code is not reading what address I am deploying from. How can I get this contract to deploy?

from brownie import accounts, config, SimpleStorage def deploy_simple_storage(): account = accounts[0] simple_storage = SimpleStorage.deploy({"from: account"}) print(...
user avatar
0 votes
1 answer
417 views

Error: Transaction's maxFeePerGas (0) is less than the block's baseFeePerGas (527514873)

Not Able to deploy to Ganache- Local chain, I have tried using func from Web3.eth , tried to import GasNowStrategy, Redownload the ganache as well and also tried to copy exact same code from GIT. ...
user avatar
0 votes
1 answer
36 views

Contract Development: How can I run an entire folder of scripts through Brownie?

I am trying to run my "deploy.py" file, and I was having trouble just deploying that at first, however, I figured that out. Is there a way that I can run every script under a certain folder ...
user avatar
0 votes
0 answers
97 views

ganache-cli running in fork mode returns wrong chain id

I am running ganache-cli in fork mode and taking fork off the rinkeby testnet. I have deployed a contract on the testnet that returns block.chainid: pragma solidity >=0.7.0 <0.9.0; contract ...
user avatar
  • 121
1 vote
1 answer
240 views

Brownie testing for reverted transactions does not work with pytest.raises() or brownie.reverts()

disclaimer: this is a duplicate from https://stackoverflow.com/questions/71126128/ I couldn't find out how to move the question, so I copied it here. Issue description: Brownie tests containing either ...
user avatar
0 votes
0 answers
37 views

Brownie v.17.2 doesn't work, only got AttributeError

I'm new to Ethereum ecossystem and I'm trying to finish Patric's FreeCodeCamp course using Brownie v1.17.2. Python Version: Python 3.9.10 (v3.9.10:f2f3f53782, Jan 13 2022, 17:02:14) [Clang 6.0 (clang-...
user avatar
0 votes
0 answers
15 views

/bin/sh: {ganache-cli,: not found <> why this is happening im sure i installed ganache-cli

why this is happening I'm sure I installed ganache-cli how to change directory!
user avatar
0 votes
1 answer
205 views

Brownie test skips over a function

So I wanted to test my lottery contract and python scripts. I have three functions namely test_get_entrance_fee() , test_cant_enter_unless_started() and can_start_and_enter_lottery() Out of these ...
user avatar
3 votes
0 answers
71 views

Is it possible to fork multiple blockchains at the same time for testing smart contracts?

I am trying to fork ethereum, polygon, and arbitrum at the same time. I tried to use ganache-cli specifying different ports for each chain but it does not seem to grab the chain data when I use a ...
user avatar
0 votes
0 answers
8 views

simulate the passage of time with ganache-cli [duplicate]

I'm building a test suite for my contracts in ganache-cli using mocha. I'm currently testing a time locked contract and, to be able to assert some behaviors, I'd need to simulate the passage of some ...
user avatar
0 votes
0 answers
17 views

How can I view data that is stored in a struct from the Ganache CLI? (Solidity)

I am trying to access a string that I stored in a struct from the Ganache-cli. To that end, I wrote this function: function viewContract(uint256 tokenId) public view returns(string memory) { ...
user avatar
  • 103
0 votes
1 answer
660 views

Remix IDE not connecting to Ganache Web3 Provider

I'm trying to deploy my smart contract to Ganache (perferably the Ganache desktop app but this issue is also occurring for ganache-cli). When I select "Web3 Provider" under the "...
user avatar
0 votes
0 answers
47 views

Ganache UI infinite spinner / workspace not accesable

I have been using Ganache UI for over a year now on CentOS7. But last week it hadn't been working correctly. Whenever I create a new Workspace and add a project, the UI gets stuck For example: I open ...
user avatar
  • 636
0 votes
1 answer
297 views

Ganache-cli Not Working properly WSL 2

I installed npm install -g ganache-cli on my WSL, but when I entered ganache-cli, it is showing me this error. Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:...
user avatar
  • 31
0 votes
0 answers
12 views

Beyond ethereum stackexchange what are the other good resources for asking questions regarding truffle, ganache-cli, babel and solidity?

Beyond ethereum stackexchange what are some good resources for asking questions regarding truffle, ganache-cli, babel and solidity? Starting working on blockchain development need information on good ...
user avatar
0 votes
1 answer
151 views

How to run Truffle Solidity tests in Gitlab CI?

Here is my .gitlab-ci.yml file, inspired by @GrandFleet's answer: image: node:latest cache: paths: - node_modules/ stages: - test test_async: stage: test services: - trufflesuite/...
user avatar
0 votes
0 answers
64 views

Ganache-cli server and Webjs not connecting : Returned values aren't valid, did it run Out of Gas?

I am trying to connect web3js in the javascript section of my html to my ganache-cli nodejs server ganache deployment script: const ganache = require("ganache-cli"); const Web3 = require(&...
user avatar
  • 1
0 votes
1 answer
586 views

Ganache-Cli Error: Digital Envelope Routines Unsupported

When running the command ganache-cli in Git Bash, I get the following error. I have already installed Truffle and Ganache-Cli, and I've even tried on Powershell and the Windows command prompt (all ...
user avatar
  • 117
1 vote
2 answers
197 views

ganache-cli command not found

I tried installing ganache-cli with yarn. Even though yarn has successfully installed ganache-cli, I bash can't find the ganache-cli. smakbar@OMEN:~/cryptoCurrencies/web3$ yarn global add ganache-cli ...
user avatar
0 votes
1 answer
436 views

How to add polygon fork network to brownie with correct chain-id

I want to add a forked network to brownie. If i do it like this: brownie networks add development polygon-main-fork-dev cmd=ganache-cli host=http://127.0.0.1 chainid=137 fork='https://polygon-mainnet....
user avatar
0 votes
0 answers
231 views

web3.currentProvider.send() - eth_signTypedData with Truffle and Ganache

I am calling web3.currentProvider.send(). const params = [permitParams, defaultAccount]; const method = 'eth_signTypedData'; var result = await web3.currentProvider.send({ method, params, ...
user avatar
  • 199
0 votes
1 answer
679 views

TypeError: this._deployData.startsWith is not a function

I'm trying to deploy my smart contract that compiled without any problem and stored all the compiled data in two separate files. Then I'm requiring the ABI and bytecode and tries to deploy it. I get ...
user avatar
0 votes
0 answers
37 views

iam getting brownie compiler error while running lottery in brownie test network

PS E:\smartcontract-lottery> brownie test --network mainnet-fork INFO: Could not find files for the given pattern(s). Brownie v1.16.4 - Python development framework for Ethereum Compiling contracts....
user avatar
0 votes
0 answers
83 views

Uniswap Prices are not being updated when forking mainnet

I'm writing a bot interacting with uniswap contracts to get data from the pool reserves. I'm using ganache-cli to fork mainnet to do so. When I'm using infura as a websocket provider, everything is ...
user avatar
0 votes
0 answers
38 views

UniswapV2Router02 contract's function are failing on forked mainnet

I have forked the mainnet with the ganache-cli --fork <node_url> and I am trying to interact with the UniswapV2Router02 (for eg. the Sushiswap's one), however when I try to do a swap as follows: ...
user avatar
0 votes
0 answers
142 views

Cannot run the script through Brownie 'deploy.py' [duplicate]

I've been following the amazing tutorial on Blockchain/Python/Solidity and I'm stuck on the first steps of using Brownie. I'm operating on Windows 10, I have pipx, yarn and ganache-cli installed as ...
user avatar
0 votes
1 answer
33 views

Does "ganache" implements the specification in the Yellow Paper?

I wondered whether ganache, which produces a blockchain on my machine and is used for development, implements the Etherum yellow paper protocol. Please follow my line of logic: That is when the ...
user avatar
  • 227
0 votes
1 answer
144 views

Ethereum fork on Ganache: ran out of gas

what I'm trying to do is to fork the Ethereum Mainnet on my local ganache blockchain in order to interact with smart contract like Uniswap on my local machine. I forked the Ethereum network using ...
user avatar
  • 145
0 votes
0 answers
483 views

How do I set initial supply for a ERC-1155?

In my smart contract I set 2 different token types: uint256 public constant COIN = 0; uint256 public constant OBJECT_NFT = 1; And my constructor has the initial mint for a specific address, but when ...
user avatar
0 votes
0 answers
202 views

Ganache throws "Invalid JSON RPC response" when trying to fork mainnet from full geth node

I have full Ethereum node running GETH 1.10.10-stable-bb74230f and when I try to fork mainnet from it with Ganache it fails with: Error: The fork provider errored when checking net_version: Invalid ...
user avatar
  • 108
0 votes
0 answers
26 views

Getting an error when using methods.myMethod.call() with web3js

I am getting an error trying to call an existing smart contract function using call(). The error is "Returned values aren't valid, did it run Out of Gas? You might also see this error if you are ...
user avatar
0 votes
0 answers
111 views

ganache-cli cmd not fpund even after "npm i -g ganache-cli" #brownie

$ brownie run scripts/1_deploy_easy_token.py INFO: Could not find files for the given pattern(s). Brownie v1.16.4 - Python development framework for Ethereum Erc20BrownieProject is the active project. ...
user avatar
  • 1
4 votes
2 answers
1k views

deploying smartcontract to ganache-desktop instead of ganache-cli with brownie

i have a smartcontract developed with brownie. I want to deploy it to ganache. If i run my deployment script brownie run scripts/deploy.py, brownie deploys the smartcontract with ganache-cli. But i ...
user avatar
  • 295
0 votes
1 answer
26 views

deploying dydxexchange/solo: '"OperationImpl" ran out of gas'

I'm trying to deploy the 'solo' (https://github.com/dydxprotocol/solo) After cloning git@github.com:dydxprotocol/solo.git and resolving all dependencies Contracts compilation is successful, however ...
user avatar
0 votes
0 answers
313 views

'ganache-cli' is not recognized as an internal or external command, operable program or batch file

I already installed ganache as: ` C:\Users\Henry Alberto\Desktop\GenerativeArtPython>npm install -g ganache-cli C:\Users\Henry Alberto\AppData\Roaming\npm\ganache-cli -> C:\Users\Henry ...
user avatar
1 vote
1 answer
64 views

Why contract deployed return property contract.options.address null

Why contract deployed return property contract.options.address null. Inbox.test.sol const assert = require('assert'); const ganache = require('ganache-cli'); const { send } = require('process'); const ...
user avatar
0 votes
0 answers
167 views

Brownie - Contract.from_explorer is not working - What else can I try?

I'm working with the Balancer Vault Contract, address: 0xBA12222222228d8Ba445958a75a0704d566BF2C8 I was running tests and they were failing, the error was 'SourceUnit' object has no attribute 'name' I ...
user avatar
  • 33