Questions tagged [ganache]

For questions about using the Ganache personal blockchain testing environment.

Filter by
Sorted by
Tagged with
1
vote
1answer
60 views

Can't find address in abi encoded data of event

I have an event with the signature Event(address, uint256, string) which my smart contract emit from time to time. I am testing said contract on a ganache test net where when the Ganache picks up ...
1
vote
1answer
35 views

Is it fine to use Ganache in a staging environment?

We are currently using Rinkeby in our staging environment, but planning to stop using it cause it doesn't make sense as our application will communicate with a private Ethereum network when it goes to ...
1
vote
1answer
198 views

Testing solidity transfer method not transferring tokens

I have this solidity contract: contract Token { mapping(address => uint256) public balanceOf; event Transfer( address indexed _from, address indexed _to, uint256 _value ); ...
1
vote
2answers
486 views

Accessing database in solidity

I am developing a voting application using blockchain (ganache). So basically i am registering the candidates by a web form and storing the data in phpmyadmin database. Now i want to access this data ...
1
vote
4answers
343 views

Can the mapping storage change after contract deployment?

I am beginner in mapping.I work on Truffle and Ganache. I deploy the following contract: pragma solidity ^0.5.12; contract customerFinder{ mapping(uint256 => address payable) public ...
1
vote
1answer
518 views

Ganache: out-of-gas during deployment

I have a bunch of contracts which deploy just fine. Deployment of one of the contracts, XBRNetwork takes exactly 5418911 gas - no problems with that. However, once I add another trivial (public) ...
1
vote
1answer
741 views

How to send transaction using web3 contract instance from address which is not a node's account

I succeeded creating transaction from node's account(created by ganache) to a contract using web3.js . const contract = new web3.eth.Contract(abi, contractAddress, { from: from, gasPrice: ...
1
vote
1answer
319 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
138 views

TxPool on Ganache

I started using Ganache to run Ethereum and tried via cURL the following: curl -X POST -d '{"jsonrpc":"2.0","method":"txpool_status","params":[],"id":1}' http://ip:port But I got the message: ...
1
vote
2answers
1k views

Issue with Ganche and Truffle with Metamask. Can't load token balance

I'm testing to create a token in Truffle; it compiles fine, but it won't load the balance of the token in to Metamask. I've set the connection correct: it does load the ETH balances of the Ganache ...
1
vote
1answer
421 views

Uncaught (in promise) Error: Contract has not been deployed to detected network (network/artifact mismatch)

The client side application always throws the above error. I have connected the ganache account(by copying the private key)also with the correct port number in Metamask extension as well as in the ...
1
vote
1answer
169 views

Can ganache-cli connects to another ganache-cli?

Is it possible to create a private network using ganache-cli? Can a ganache-cli running on port 8545 connect to ganache-cli running on port 9545? Can we use ganache-cli as a node? Or it is a ...
1
vote
1answer
300 views

Dapp on Ganache and Truffle but… what about Remix?

My dapp runs well with Ganache and Truffle but how to deploy with Remix and connect the contract to web GUI without abi? I mean, i created a Dapp that runs really good on Ganache and i run the web ...
1
vote
1answer
309 views

Ganache-cli EADDRINUSE 127.0.0.1:8545 error?

when i start ganache-cli with command, it gives this error : ❯ ganache-cli Ganache CLI v6.4.1 (ganache-core: 2.5.3) Error: listen EADDRINUSE 127.0.0.1:8545 at Server.setupListenHandle [as ...
1
vote
1answer
216 views

Error when trying to open Ganache on Ubuntu: archive type not supported

After downloading a fresh copy of the latest Ganache and double click to run it, the following error is shown: archive type not supported Versions Ubuntu: 16 and 17 All Ganache versions: for ...
1
vote
1answer
105 views

How to test time-dependent contracts on the mainnet?

In Ganache, I use evm_mine to simulate the passage of time. Assuming block times are accurate enough, what are the best practices to test some contracts on the mainnet or a testnet which depend on ...
1
vote
1answer
800 views

How to find out the number of blocks in Ganache?

I have tested a contract on truffle using the command: truffle test I got following message: D:\Funding4\contracts>truffle test Compiling .\contracts\Funding4.sol... Compiling .\contracts\...
1
vote
1answer
208 views

How do I see how much gas a .call() transaction used in remix IDE connected to ganache-cli?

I've got remix connected to ganache-cli and I'm running some read-only transactions. I can't seem to figure out how to see how much gas those transactions used up? Any help would be great thanks!
1
vote
1answer
532 views

Connecting with existing ganache core server

I have a ganache-core server running at port 18545 (part of an npm app) How can I attach to it and see the transactions/blocks in that. I tried running ganache GUI and setting port number as 18545 in ...
1
vote
1answer
197 views

geth calling funtion from a different contract not working, ganache & remix works

I'm trying to call a contract function from another contract, using web3.js. When using ganache or remix everything works fine: web3.js returns the events fired and the gas used (33938 in this ...
1
vote
1answer
222 views

The MetaMask Web3 object does not support synchronous methods

Hi I'm having this error when I try to set a variable in remix. inpage.js:1 Uncaught Error: The MetaMask Web3 object does not support synchronous methods like eth_sendTransaction without a callback ...
1
vote
1answer
272 views

How do OpenZeppelin ERC721 tests pass?

I don't understand how the following test can pass. I tried it in my application and it fails. The entry point is the description 'when called by the owner'. In this function two test cases are ...
1
vote
0answers
21 views

Could not connect to your Ethereum client with the following parameters: (Ganache)

Could not connect to your Ethereum client with the following parameters: - host > 127.0.0.1 - port > 7545 - network_id > * Please check that your Ethereum client: - is running - ...
1
vote
0answers
13 views

Why does Ganache's contract information not accurately display hex values?

Difficulties are as stated above. Running Truffle v3.5.3, Solidity ^0.8.0, Ganache v2.5.4 local test net. I have a contract upcomingRace which has the following constructor: constructor(string memory ...
1
vote
1answer
23 views

How to use truffle HDWalletProvider to get more then 10 addresses with funds for test purpose

How do I need to call HDWalletProvider to get for example 50 addresses with funds? The networks part in my truffle.js configuration file looks like this: networks: { development: { provider: ...
1
vote
0answers
19 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
197 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
1answer
104 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
25 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
21 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
1answer
103 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
479 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
305 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
193 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
523 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
720 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
93 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
0answers
103 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
113 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
484 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, ... , '...
1
vote
0answers
78 views

How to interact with smart contracts on Ganache from Express app

How can I interact with the smart contract on ganache from my express app using Web3.js Any Tutorials?
1
vote
0answers
653 views

Ganache is not showing any events

I have a contract method which emits events but ganache seems not to catch any events. I say this because when I deploy my contract on ropsten the events are being caught fine but only in ganache I ...
1
vote
1answer
358 views

How can I debug a my Solidity smart contract with a GUI?

Is there any way to debug a Solidity smart contract with a GUI, like remix? How can I do it for both testnets and mainnet?
1
vote
1answer
29 views

What are the ways to call a smart contract function during development?

What are the ways to call a smart contract function during development using Truffle simulated VM with a GUI interface (like Remix or EtherScan offer)? I know I could use CLI options like Truffle ...
1
vote
1answer
663 views

Web3 - Cannot read property 'clearSubscriptions' of undefined

While creating a web3 instance, and attempting to call setProvider with a valid provider (Ganache), I get a TypeError. TypeError: Cannot read property 'clearSubscriptions' of undefined Steps to ...
1
vote
1answer
781 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"), ...
1
vote
0answers
186 views

Contract has no network id set, cannot lookup artifact data

I am using web3 v1.0.0-beta.37 and truffle contract for server.js configuration. I have defined two contracts FlightSuretyData.sol and FlightSuretyApp.sol FlightSuretyApp contract access functions ...
1
vote
1answer
154 views

Unable to install Mocha Web3 and Ganache-cli

I have been trying to install mocha,Web3 and ganache all through one command but I am facing an issue while installing can someone help me in sorting our this error. Quick response will be appreciated ...
1
vote
1answer
207 views

Cannot deploy contract

I'm having difficulty deploying a solc-compiled contract to ganache test network using web3. package.json { "name": "smartinvoice", "version": "1.0.0", "description": "", "main": "index.js", ...
1
vote
1answer
299 views

Can't call function from contract using web3.js due to gas issue

I'm building a smart contract and dapp using ganache and web3.js. In my smart contract I have a function (named "add_pilot") which gets 4 parameters and add them to a mapping. It looks like this: ...

1 2 3
4
5
9