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.

42 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
306 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 ...
2
votes
1answer
16 views

uniswap solidity contract: swapExactTokensForTokens Failed in my own smart contract

I am using sushiswap to transfer weth to dai. Everything goes fine when I use web3.js to call swapExactTokensForTokens directory. However, thing goes wrong when I try to include the ...
2
votes
0answers
66 views

How to continuesly fork mainnet on latest block

How do I keep the fork mainnet use the latest block using web3? I need to fork mainnet to latest block before I send the transaction What originally i do is just run the ganache fork command which ...
2
votes
1answer
132 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
103 views

UnhandledPromiseRejectionWarning: Error: nonce generation function failed or private key is invalid in Ganache

In Go I am using go-ethereum to read data from the ethereum smart contract. My smart contract is maintained with truffle. I am trying to fetch candidate information based on candidate id. I have a ...
1
vote
1answer
28 views

Changing contract property to public increases gas costs

I am following kind of an outdated tutorial and trying to adapt it to the more recent changes in Solidity and other packages. Following one of my changes, I am running into a problem that I can't find ...
1
vote
0answers
103 views

Failure to call 1inch getExpectedReturn function from the Solidity contract

I am trying to test 1inch getExpectedReturn function from my Solidity contract. I deploy my contract on the Mainnet forked with Ganache via Remix. The entire contract is pretty simple and looks as ...
1
vote
1answer
351 views

Deploy smart contract with web3 and ganache-cli

I've been trying to get a simple contract deployed on ganache with web3.js. Here is my test code : const ganache = require('ganache-cli'); const Web3 = require('web3'); const provider = ganache....
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
212 views

ganache-cli: Returned values aren't valid, did it run Out of Gas?

This issue is simple to replicate using an Ethereum Grid (Geth) node, ganache-cli and truffle. After starting the (light) Geth node: 1. Fork mainnet from Geth node ganache-cli --fork http://...
1
vote
0answers
66 views

Calling contract method results in metamask error using ganache

I have a simple Vue form, that calls a method in an Ethereum contract. If I don't provide a callback to my method, Metamask complains: Uncaught Error: The MetaMask Web3 object does not support ...
1
vote
1answer
663 views

Smart Contract is being deployed but call does not return contract address after deployment

So I have been trying to deploy a smart contract using nodejs, but when I call the function to deploy, I get no contract address on my console. It's like the send() function never completed its ...
1
vote
0answers
113 views

Is it possible to access MetaMask functionality for integration testing?

I'd like to be able to access MetaMask to test potential user actions. I doubt it's possible to directly simulate sending transactions, but what I hope I can at least confirm is that transactions are ...
0
votes
0answers
9 views

How do I efficiently install truffle and ganache-cli in a docker container?

Say I want to run a container with ganache-cli and truffle installed for dev purposes. I have this first attempt Dockerfile FROM node:15-alpine RUN mkdir -p /home/node/app WORKDIR /home/node/app ...
0
votes
0answers
11 views

Ganache -f how can I fork the whole chain?

Im developing locally but I need a full copy, Im using ganache for local dev, also providing -f option to fork another blockchain (BSC), is it possible to download the complete chain somehow?
0
votes
1answer
20 views

Truffle console call contract without ABI (Ganache Forked BSC)

So I started Ganache-cli with -f option to fork the BSC (ETH FORK), and in the truffle console I want to interact with some smart contracts that are not mine nor I deployed them, how can I interact ...
0
votes
0answers
41 views

MetaMask: ALERT: Transaction Error. Exception thrown in contract code

I'm working with ganache, drizzle and Vue on a decentralized app. I have a simple contract IPFSStore which contains the following function: function changeStatus(address owner, string memory ...
0
votes
0answers
215 views

Debugging reverted BSC transaction that fails only through ganache-cli

I have a Truffle migration that deploys and configures a set of smart contracts on BSC (Binance Smart Chain). When running the migration on the actual network, it works fine. However, when I try to ...
0
votes
0answers
175 views

Error: VM Exception while processing transaction: revert UniswapV2: LOCKED

I am using this repo to begin testing UniSwap flash swap contracts. I've installed all dependencies correctly and cleanly. The project uses ganache-cli, hardhat buidler, and yarn in the terminal and I ...
0
votes
0answers
206 views

Always same INSUFFICIENT_OUTPUT_AMOUNT error

I've been trying to swap some DAI which I sent to the contract to WETH. However even after trying to change the contract a bit I always get the same error output: transact to GibIhmHart.runUniswap ...
0
votes
0answers
13 views

trying to send some tokens from unlocked account

So I'm trying to send some tokens from an, with ganache-cli unlocked, address to mine to try something out, however for my code to work I need some starting amount of the initial token. Is there some ...
0
votes
1answer
103 views

Swaping ETH to DAI on Uniswap

I don't get why when trying to deploy my contract it says that gas estimation errored. Forked Mainnet with ganache-cli -f <INFURA_ID> Trying to deploy and execute following code: pragma solidity ...
0
votes
0answers
17 views

What are the transaction ordering options in ganache?

I saw this got Geth and Parity but I am just wondering if the are transaction ordering options in ganache too? I yes what are these, what is the default one and how to enable them?
0
votes
0answers
25 views

How to get all transactions in ganache-cli that have not been mined yet?

Considering a scenario in ganache where a block is mined every 200 seconds ganache-cli --blockTime 200 how can I get the all the transactions that have been sent but not yet mined?
0
votes
0answers
102 views

Trying to interact with ganache-cli fork through script

const {ChainId, Fetcher, WETH, Route, Trade, TokenAmount, TradeType, Percent} = require ('@uniswap/sdk'); const ethers = require('ethers'); const chainId = ChainId.MAINNET; how would I specify it to ...
0
votes
0answers
82 views

When forking MainNet with ganache-cli and trying to interact with contract -> error thrown

Forked MainNet with Ganache-ClI wrote script to interact with on-chain DAI contract to send some Dai to account Unlocked the DAI contract const Web3 = require('web3'); const daiAbi = require('/Users/...
0
votes
0answers
36 views

Trying to work with ganche-cli, truffle and infura

When trying to migrate a truffle-config.js file following error appears. TypeError: Cannot read property 'fromMasterSeed' of undefined any help would be much appreciated. const HDWalletProvider = ...
0
votes
1answer
111 views

My metamask extension is not getting connected to ganache local block chain

This is my Html code : <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> ...
0
votes
0answers
78 views

Revert error when sending ERC20 token on Ethereum mainnet fork

I am trying to send an ERC token (USDC) on the Ethereum Mainnet fork made with ganache-cli --fork. The transfer is made from the unlocked account that has both ETH and USDC balances available to the ...
0
votes
1answer
638 views

“Migrations” — sender account not recognized

This is my truffle.js i've removed the credentials marked as * var HDWalletProvider = require('@truffle/hdwallet-provider'); var fs = require('fs'); var infura_apikey = "*" var mnemonic = &...
0
votes
0answers
37 views

Failed to use truffle develop

When I successfully compiled and deployed contracts using Truffle and ganache-cli, I typed truffle develop to get into the truffle(develop)>, and then typed let instance = await Factory.deployed(), ...
0
votes
1answer
172 views

How do I add more gas to the ganache-cli

I started the ganache-cli with 'ganache-cli -l 800000000' I deployed my contract with 'truffle --network development' which is defined in the truffle-config.js file as: networks: { // Useful for ...
0
votes
1answer
50 views

Couldn't get any accounts!, Ethereum client is not configured correctly

I'm running testrpc on the default port 7545. I run truffle console and test with: web3.eth.getAccounts().then( function (result) { return result[0] }); This works fine. According to docs the ...
0
votes
2answers
79 views

Does Truffle Test consume gas?

When I run the $truffle test command in the terminal does it consume any gas from my local blockchain(say Ganache)?
0
votes
2answers
247 views

“VM Exception while processing transaction: revert” in Truffle test and Truffle dev

this is my problem :) Issue "Error: Returned error: VM Exception while processing transaction: revert" when reaching the Transfer function. I think it is related to the fact that my Crowdsale smart ...
0
votes
0answers
43 views

Trying to connect Ethereum Wallet with ganache-cli on Windows

I am trying to connect Ethereum Wallet with Ganache-Cli but it starts looking for geth note instead of ganache-cli. Can someone please tell me the correct way of doing it. Or is there any specific ...
0
votes
0answers
111 views

gas estimation about tests on Ganache forked mainnet

I come up with this solution with gas estimation. Could someone help check whether it is feasible? If we want to send a transaction, first, we just fork the newest mainnet blockchain using ganache-...
0
votes
1answer
432 views

Metamask TestRPC shows 0 Ether while connecting to Ganache- CLI

I've gone through various Q/A(s) of the problem of ganache-cli and metamask not linking but after trying all the solutions, still doesn't work for me. As soon as I type ganache-cli in windows cmd ...
0
votes
0answers
83 views

Can't create eth accounts on wifi by using ganache-cli@v7.0.0-beta.0

I was previously getting out of gas error which was resolved by following this issue. Now i installed ganache-cli@v7.0.0-beta.0 . It creates ethereum accounts on localhost if i write the following ...
0
votes
0answers
186 views

How to fix? Tx nonce go out of sync when using multiple unit tests on the same contract under Ganache+Truffle

Here is my example contract (ignore the fact this could be pure, this is a simplified example and my real example is not a pure function, it changes state, but I can reproduce the bug with this simple ...
0
votes
0answers
124 views

Running Migrate in Truffle does not work

I have been using Remix for developing my dapp but decided I should use Truffle to make things a little more robust and professional. I have truffle and ganache installed. I run truffle migrate and ...
0
votes
1answer
287 views

Syntax Error when trying to run ganache-cli with node v6.14.3

My environment ganache-cli 6.4.4 node v6.14.3 Mac OS Terminal I run the following commands to install ganache-cli Aseems-MacBook-Pro:bdnd aseem$ nvm use v8.11.3 Aseems-MacBook-Pro:bdnd aseem$ npm ...