Questions tagged [ganache]

For questions about using the Ganache personal blockchain testing environment.

187 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
363 views

Can't debug transactions that fail during the Web3.js estimateGas() call? No Tx Hash

NOTE: I am doing my work with the Ganache v1.2.2 GUI client on a Linux Ubuntu 18.04 station. There are many revert errors that happen during the estimateGas() call that precedes the actual Web3.js ...
4
votes
0answers
307 views

`eth_getTransactionReceipt` returns the transaction hash not the receipt

I use sol-coverage in a truffle project. Ganache is my development blockchain. I have a lot of tests which end up doing more than a few thousand JSON RPC calls. Due to unbeknownst reasons, the ...
4
votes
0answers
95 views

Does 'estimateGas' behave the same on Ganache and on mainnet?

I noticed that estimateGas behavior in Ganache has changed: In version 6.4.1, it throws an exception if exceeding the gas-limit. In version 6.5.1, it returns the estimation even if exceeding the gas-...
4
votes
1answer
462 views

Remix + Ganache - Cannot call one contract from another

I have an innocent looking contracts that work painlessly in Remix. Test contract can easily call Another if I use JavaScript VM in Remix. I also have ganache-cli running on port 7454. If I connect ...
4
votes
0answers
427 views

How to Catch Connection Issues to Web3 Provider using Web3.js

My node.js script is able to successfully connect to the Web3 provider when both the private key (using truffle-privatekey-provider) and the provider host URL are correct. let privateKey = ..., ...
3
votes
1answer
310 views

Web3.py Could not transact with/call contract function, is contract deployed correctly and chain synced?

I am trying to call a contract function deployed in Ganache. I am pretty sure the contract is deployed because I can transact() and work with other functions. But when I call() it, I get this error: ...
3
votes
0answers
293 views

Truffle test of two transactions during the same block

I'm trying to test a solidity function that only allows it to be called once per block. E.g. (my desired functionality): Tx1 calls Fn during block #100, and when successful sets a boolean flag for ...
3
votes
1answer
781 views

Error Ganache: Run out of gas - Works in Remix/Not from dApp

I am working on an application that stores and retrieves personal data on/from the ethereum blockchain. Just working on this to improve my Solidity and SC expertise and get comfortable with the ...
3
votes
0answers
242 views

Difference between execution costs on remix an Ganache?

I created a contract on remix and then deployed it. when I call any function there is an execution cost in gas. I also deployed the same contract on Ganache for testing. I find the execution cost in ...
3
votes
0answers
432 views

Mnemonic and HD Path in Ganache and ethereumjs-tx gives different private key and address

I am having difficulty reproducing the private key and address using the mnemonic and HD path provided by Ganache. Mnemonic weird farm vast surge upper truth answer end radar impact mind jeans HD ...
3
votes
2answers
219 views

Check your gas amount error ERC721

I am trying to deploy contracts to Ganache for testing using Truffle, but no matter what I set gas price / gas limit / gas to both in truffle.js and Ganache itself, it always get check gas amount on ...
3
votes
2answers
791 views

Ganache (UI) save blockchain

I am running a testnet on Ganache UI. But when I deploy a contract and close and reopen ganache, there are no blocks and the contract deployment is gone. Is it possible to save/load a blockchain ...
2
votes
1answer
41 views

Uniswap GUI on forked mainnet

I have created a forked mainnet in Ganache which is working well using the CLI. However I would like to have access to the UNISWAP GUI. If I open Uniswap and change my metamask settings to localhost, ...
2
votes
1answer
135 views

Checking transactions in ganache-cli

Is there a command to enter into the terminal to check past transactions on the locally deployed ganache-cli blockchain? With ganache gui one gets the transactions button. Is there some similar ...
2
votes
0answers
161 views

Android Studio And Ethereum?

how i can connect android studio application with Ganache? i'm trying to build an application on android (that is my Front end) with a Smart contract (Back end) on my private Blockchain (Ganache). it'...
2
votes
1answer
578 views

openzeppelin,VM Exception while processing transaction: revert

using openzeppelin-solidity to create crowdsale. Then I use this statement to Buy Token: MyCrowdsaleInstance.sendTransaction({ from: purchaser[1], value: web3.utils.toWei("0.5", "ether"), ...
2
votes
2answers
919 views

ganache-cli: how to persist new created accounts

I start my service by: ganache-cli -d --gasPrice 0 -q --db=./db This persists my 10 defaults created accounts, but when I create new accounts using Web3: web3.eth.personal.newAccount('password') ...
2
votes
0answers
29 views

When does 'truffle deploy' yield a different output every time?

truffle deploy (aka truffle migrate) is documented here. I'm doing the following sequence: Starting a local Ganache node Running truffle deploy I'd expect this sequence to yield the exact same ...
2
votes
1answer
243 views

Is it possible that Ganache can handle a private key without an “0x” prefix, but Parity cannot?

I am trying to sign and send a transaction as follows: let signedTx = await web3.eth.accounts.signTransaction(options, PRIVATE_KEY); let txReceipt = await web3.eth.sendSignedTransaction(signedTx....
2
votes
0answers
163 views

Using OpenZeppelin's increaseTime.js

I'm writing a test for a time-dependent solidity function. I'd like to use the increaseTime.js helper from v1.12.0 of OpenZeppelin's library. When I try to call this helper inside my test, I get an ...
2
votes
0answers
250 views

evm_revert to snapshot#1 in ganache-cli automatically

I am using evm_increaseTime in my tests to move block time but in ganache-cli it shows that it is reverting to snapshot #1. I have not used evm_revert or evm_snapshot. Is it normal? what is the ...
2
votes
0answers
149 views

Mist on Ganache asks for a password on creating transaction

I cannot send funds to another my account with Mist, it asks for password. I'm using Ganache testnet, and didn't created any password in it. I tried to use ganache-cli -d -u "...
2
votes
0answers
214 views

What does ganache mean by eth_getTransactionReceipt?

I'm transitioning our testing suite from using the parity client to using (a fork of) testrpc/ganache (so we can run code coverage). Our parity client has a lot of configuration, and I don't know how ...
2
votes
0answers
1k views

web3.personal.newAccount() successfully created but not listed in ganache accounts.why?

I am using truffle framework for Dapp development and I am new in Blockchain.I used the command web3.personal.newAccount() to create a new account. But i cannot view this account when i take ...
2
votes
0answers
211 views

Signature generated through web3.eth.sign not leading to same address after fromRpcSig

I am trying to write sign a challenge using web3.eth.sign, web3 uses ganache.provider(), But when i do fromRpcSig(signature) ecrecover(challenge) which results in different address. But when i sign ...
2
votes
1answer
281 views

Exceeds block gas limit error to call view functions

With solidity view function, you can specific the amount of gas to use. My understand is since it is not a state changing transaction, all the gas cost is not charged for, and the client should be ...
2
votes
0answers
253 views

Truffle deployment with metamask to ganache leads private key error

I'm using Truffle, web3js and Metamask to build a webapp. I'm using ganache for local testing. I'm trying to deploy a contract with import TruffleDeployer from 'truffle-deployer'; import ...
2
votes
0answers
204 views

Couldn't estimate the gas when running Mist against ganache-cli

I am running ganache-cli locally, then connecting Mist with /Applications/Mist.app/Contents/MacOS/Mist --rpc http://localhost:8545 Then, when I try to send from one test acccount to another in the ...
2
votes
0answers
120 views

Import contracts, compiling and deployment

quick question. I have a set of contracts A,B,C. A contains import 'B' and import 'C'. Should I just compile A and then deploy it on the blockchain for the functions in B and C to be implemented ...
2
votes
1answer
331 views

Alternatives to listen Events contract with web3.py?

I'm facing some issue/bug on web3.py, I need to listen my event contract, but event logs are always empty. I know the following issue on Ganach-CLI but may be there is other alternative. I already ...
2
votes
1answer
293 views

Why would Ganache behave differently depending on geth, web3j, web3js and web3.py?

I have a smart contract token deployed in a Ganache instance. My dapp written with React and web3.js shows the same 10 accounts for eth.accounts as running the same command in the geth console. If I ...
2
votes
1answer
184 views

Branch a Truffle test into various Ganache blockchain states

I am currently testing a contract that can evolve in different ways, depending on the interaction between parties. But all these possible scenarios share the same initialization. So, the question I ...
1
vote
0answers
16 views

Create account with initial fund using web3

Is it possible to create an account with initial fund using web3? Every time I create a new account I had to do fund transfer to add initial fund. If there is way to fund the account with minimum ETH ...
1
vote
0answers
21 views

Uniswap addLiquidity Error: “revert TransferHelper: TRANSFER_FROM_FAILED”

I'm having issues with the addLiquidity() call failing due to what likely seems to be an approval issue and producing the following error code: Internal JSON-RPC error. { "message": "VM ...
1
vote
0answers
44 views

Cannot call function in openzepplin ERC1155 contract via web3/metamask

I am trying to call the balanceOf function in a pretty barebones openzepplin ERC1155 contract through metamask. I am using web3 only to generate the ABI, and metamask to actually send out the call. ...
1
vote
0answers
19 views

Interaction between 2 nodes of ganache

I am making a project on blockchain where in I am using ganache for private blockchain, meta mask to interact with the same. Since ganache provides 10 nodes in the private blockchain, I want all the ...
1
vote
0answers
18 views

How to store each new transaction in multiple/different blocks

How can I connect to Ganache so each time I add to the blockchain the transaction is stored in the next block. I have an issue that each time I add to the blockchain it gets added to the same block ...
1
vote
0answers
45 views

Debugging contracts on a mainnet fork with Remix

I'm developing a contract that relies on some states of other contracts currently deployed on mainnet. I'm after a way to test and debug my contract without having to deploy to mainnet first. I'm ...
1
vote
1answer
54 views

Windows Ganache GUI not taking updates from Truffle running on WSL2

I have added truffle workspace to Ganache as usual. But now when I do a simple truffle develop followed by migrate inside the truffle shell, Ganache picks up that the contracts are deployed, but it ...
1
vote
0answers
262 views

UniswapV2 addLiquidityETH() reverting when trying to deploy to ganache locally

I'm trying to locally deploy a contract similar to sushiswap, but I keep getting a revert from addLiquidityETH(), no message other than VM Exception while processing transaction: revert //module....
1
vote
0answers
230 views

How can I handle the UniswapV2: LOCKED revert reason when calling swapETHForExactTokens on the Uniswap router2 contract

I have forked the eth mainnet onto my local machine using ganache cli and am trying to call the UNISWAP router2's SwapETHForExactTokens to swap eth for MEME tokens. I call the function from truffle ...
1
vote
1answer
113 views

Modify storage in Ganache or Hardhat Network?

I have an orchestrated contract with a function that can only be called by another contract. While struggling to find an elegant solution for writing a unit test, I realised that I could circumvent ...
1
vote
0answers
406 views

How to deploy uniswap contract with open zeppelin?

I was following the quick start here which suggests to "Deploy the UniswapV2Factory" under the writing tests header. I'm using OpenZeppelin and have Ganache running but I wasn't able to ...
1
vote
0answers
433 views

Alternative to ganache

can someone please tell me an alternative to Ganache? Tried installing ganache on my laptop and it's not supported. Ganache works on 64 bit computers and mine is 32bit. Is there a way I can go round ...
1
vote
0answers
69 views

Testing response times using Ganache

If you want to simulate repsonse time of your smart contract, how realisitc is it to use ganache? I'm thinking that in a live network, ropsten for example, there would be a lot more transactions ...
1
vote
1answer
126 views

How to deploy blockchain app in heroku

I want to deploy my blockchain app in heroku and i just want to use ganache as my blockchain network. is that possible?
1
vote
0answers
88 views

Does ganache only store the most recent transaction's events?

I can log them to the console in each transaction with subscribe, but the ganache UI only ever shows the latest one, as does web3.eth.getPastLogs.
1
vote
1answer
88 views

ganache-cli 127.0.0.1:8080 bad request

Alright, it looks like everything in the terminals is running well. The contract looks to be deployed successfully. It seems like there's supposed to be an API or something I can access via looking up ...
1
vote
1answer
174 views

I got this error during truffle testing. AssertionError: it returns true: expected { Object (tx, receipt, …) } to equal true

DappToken.sol function transfer(address _to, uint256 _value) public returns (bool success){ require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] -= _value; balanceOf[...
1
vote
1answer
286 views

web3py error while interacting with smart contract 'message': 'execution error: revert', 'code': -32000

When I try to interact with the contract with web3.py, I am using ganache, I get the completely useless error message: ValueError: {'message': 'execution error: revert', 'code': -32000, ... , '...