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
2answers
195 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
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 ...
1
vote
1answer
661 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 ...
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
16 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 ...
2
votes
1answer
124 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
1answer
430 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 ...
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 ...
0
votes
0answers
38 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
1answer
109 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
1answer
99 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
2answers
78 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)?
1
vote
2answers
47 views

Metamask not connecting to ganache localhost

I am running a local ganache-cli and my metamask in my browser just keeps saying: Oops! Something went wrong. Here are the network details: name: Localhost RPC URL: http://localhost:8545 Chain ID: ...
0
votes
2answers
239 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
188 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
167 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 ...
3
votes
2answers
321 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
1answer
343 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
1answer
28 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
1answer
631 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
193 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
1answer
169 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
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 ...
2
votes
0answers
64 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
156 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
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
99 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
78 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 = ...
1
vote
2answers
156 views

How to increase the number of test accounts?

I have encountered a problem where I need a large number of test accounts. How can I increase the number of test accounts from 10. Remix and ganache only give 10 accounts. I require more than that.
0
votes
2answers
267 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 { ...
1
vote
1answer
209 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://...
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 ...
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 ...
1
vote
0answers
97 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
137 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 ...
1
vote
1answer
55 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 ...
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
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 ...
1
vote
1answer
112 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 ...
10
votes
1answer
2k views

How can I take a snapshot of Ganache or Truffle Develop state and reload later?

I would like to be able to save the state of my local Ganache or Truffle Develop chains into some sort of file. At a later time, I would like to be able to restart Ganache or Truffle Develop and apply ...
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
235 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
38 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
1answer
545 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
55 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
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
2answers
643 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
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 ...