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.
71
questions
0
votes
0answers
36 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
57 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 ...
1
vote
1answer
23 views
gasless contract deployment with ganache-cli
I have runned ganache-cli with this command:
$ ganache-cli --port 8545 --gasLimit 12000000 --accounts 10 --hardfork istanbul --mnemonic test
I have create a truffle project with this command:
$ ...
0
votes
0answers
95 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
12 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 ...
2
votes
0answers
29 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 ...
0
votes
1answer
44 views
Not able to interact with Ganache-cli: “-bash: ganache-cli: command not found”
I've already installed ganache-cli with sudo npm install -g ganache-cli on my MacOS but I am not able to interact with it through my terminal.
I always get the error: -bash: ganache-cli: command not ...
0
votes
0answers
54 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
14 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
18 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
49 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
29 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
24 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 ...
0
votes
0answers
31 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
38 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">
...
3
votes
2answers
184 views
Ganache-cli Fork unlocked account to make transactions
I'm trying to use ganache-cli on a fork of the Main Network.
I use the following command to start ganache.
ganache-cli --fork https://mainnet.infura.io/v3/MY_API_KEY -- unlock ...
1
vote
0answers
73 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
97 views
Truffle ganache fork
Suppose I have access to a full archive Node and I want to fork from a specific block using Ganache.
Using ganache-cli, I can specify where to fork using the --fork parameter
by passing it the Node ...
0
votes
1answer
86 views
Truffle doesn't see the smart contract deployed on ganache
etherjs (5.0) is used to deployed a smart contract Hello.sol. Here is the js code (truffle 5.1.52/ganache CLI 6.12.1):
import { ContractFactory, ethers } from "ethers";
let privateKey = ...
0
votes
1answer
19 views
Synchronizing test and web3 enabled nodejs service
I have a test suite running in truffle, and an external web3 connected node service running - both connected to a ganache-cli network.
My problem is: my tests are supposed to pick up an event ...
0
votes
0answers
60 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 ...
1
vote
1answer
93 views
Dockerized Ganache-cli + HdWallet Provider?
Does anyone have any experience connecting an instance of HdWalletProvider to a dockerized Ganache-Cli? Having trouble connecting with http://0.0.0.0:8545, or ganache-cli:8545, or anything other form ...
1
vote
1answer
39 views
How to find value of non-public state variable
I understand that public state variables automatically creates a getter function when deployed, its value can be accessed via the getter function.
However, if a state variable is not public, how can ...
2
votes
0answers
81 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
35 views
Is there any advantage of using localhost as testnet in Metamask?
I am using Metamask with ganache to deploy my Dapp, i use localhost testnet depend on some tutorials i followed it but really i don't know if it has any advantages comparing with other testnets or no? ...
0
votes
2answers
186 views
solc-js error: “before each” hook for “deploys a contract”: SyntaxError: Unexpected token u in JSON at position 0
The issue is probably here: const { interface, bytecode } = require('../compile');.
interface in the test file is undefined.
inbox/contracts/Inbox.sol:
pragma solidity ^0.7.0;
contract Inbox {
...
0
votes
1answer
352 views
Is there a way to retrieve private key of ganache account with web3?
web3.eth.getAccounts() returns list of accounts.
Is there a way around to get the private key of one of the account from the list returned from the above code?
0
votes
1answer
368 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
1answer
41 views
Reproducing a Ganache Server across multiple computers
There are multiple developers on the team and it seems as though we all want to be working on a specific test network with specific public and private keys with a specific number of users who all have ...
0
votes
0answers
31 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
124 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
2answers
606 views
How to debug a “rpc error with payload”
Debugging smart contract errors can be surprisingly hard. There is one particular kind of error that annoys me the most: the infamous rpc error with payload.
For instance, just a few hours ago, while ...
0
votes
1answer
41 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
61 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
1answer
21 views
set up 2 accounts
I am trying to implement a KYC system for banks. so for this, I will require the banks to have a respective account address so when the customer joins that bank he will pay to it. I have provided the ...
0
votes
2answers
136 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 ...
1
vote
1answer
200 views
Can't unlock address when using ganache-cli
I want to unlock an address and fund it with ETH in ganache that I don't have its private key. So I run this:
./node_modules/.bin/ganache-cli --hardfork istanbul --port 8545 --gasLimit 8000000 --fork ...
1
vote
1answer
237 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....
0
votes
0answers
39 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
96 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-...
1
vote
0answers
52 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 ...
0
votes
1answer
907 views
revert ERC20: transfer amount exceeds balance [closed]
I try to send from ERC-20 to other ERC-20 via interledger in ganache , but get this error:
{
< "id": 3451,
< "jsonrpc": "2.0",
< "error": {
< "message": "VM ...
0
votes
1answer
143 views
Truffle Test: Setting blockTime
I'm using Truffle and I want to increase the blocktime to mimic that of the mainnet when i run my tests.
As i understand it, Truffle has already instantiated a web3 instance that's ready to use so i ...
1
vote
1answer
173 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
1answer
50 views
contracts missing from ganache-cli after restart
I have a ganache-cli running on an ec2 instance but everytime I restart the ganache-cli the contracts go missing. I have specified a db, a id and also the precious mnemonic and it still is the same.
...
0
votes
1answer
161 views
Cannot create contract from another contract - truffle and ganache
I'm trying to write a test with ganache and truffle to create a contract instance from another contract.
Everything works in Remix but it doesn't in ganache. This is the code
const assert = require('...
2
votes
1answer
251 views
Getting an 'invalid opcode' calling a solidty function from test file
im in the process of learning about ethereum and Solidity, and im having a problem calling a payable function from a test file.
This is my contract
pragma solidity >=0.4.22 <0.6.0;
//pragma ...
0
votes
1answer
267 views
Creating workspace kind in ganache-cli
I am presently developing a Dapp and I am now trying to deploy it on cloud. So what I do is create an EC2 instance and drop all my code there. Then I install ganache-cli there and before on my local ...
2
votes
2answers
454 views
How to persist ganache-cli data when run from within a docker container
The reason for persisting the data is that every time i run the ganache-cli container , the deployed smart contracts address changes each time i restart it .SO i am looking for a work around to either ...
1
vote
0answers
56 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 ...