Questions tagged [ganache]

For questions about using the Ganache personal blockchain testing environment.

110 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
1answer
273 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
1answer
158 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 ...
3
votes
0answers
39 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 ...
3
votes
0answers
42 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-...
3
votes
0answers
128 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
0answers
142 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
2answers
119 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
1answer
460 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
0answers
55 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
2answers
97 views

Metamask injects one account in web3, but calls contracts using another account

Building a React app, MetaMask injects web3, I get accounts[0] from getAccounts(), then pass it to my contract functions together with other parameters. I want my modifiers to lock incoming function ...
2
votes
1answer
98 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
98 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
261 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 = ..., ...
2
votes
0answers
260 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 ...
2
votes
0answers
127 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
800 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
165 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
0answers
202 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
181 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
110 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
164 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
244 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
125 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
2answers
334 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
274 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
134 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
2answers
149 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') ...
1
vote
0answers
21 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 ...
1
vote
1answer
105 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
108 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
vote
0answers
57 views

Error: Cannot create instance of X; no code at address

Having a little issue. I have deployed a Mock ERC20 contract on development network like so: const ERC20Mock = artifacts.require("ERC20Mock"); module.exports = async function(deployer, network, ...
1
vote
1answer
334 views

Cannot connect to ganache-cli with web3 and nodejs

from package.json: "ganache-cli": "^6.3.0", "web3": "^1.0.0-beta.41", in my createContract.js const Web3 = require("web3"); const ganache = require("ganache-cli"); console.log('ganache.provider :', ...
1
vote
0answers
28 views

access remix addresses within contact

I want to write tests for my simple solidity contract and one of the tests I have is to pass an address dynamically from remix or ganache-cli. Is there a way to access all other addresses from remix ...
1
vote
1answer
64 views

Truffle migrate ERC820Registry

I use Truffle and Ganache and I want to test some contracts that use the ERC820 Registry. I'm new to Truffle (and JavaScript in general) and I'm struggling to follow the instructions described in EIP-...
1
vote
0answers
128 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. I am attaching screenshot of it....
1
vote
1answer
407 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 ...
1
vote
1answer
61 views

Truffle fails to migrate an Oraclize contract into Ganache

I have a contract that is using Oraclize. When deploying the contract from the Remix IDE into Ganache/Ethereum-bridge via MetaMask, the contract is fully functional. However, when trying to migrate ...
1
vote
0answers
99 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 "...
1
vote
1answer
130 views

Simple Open Auction example - how to run it?

I'm trying to run Simple Open Auction, compiled successfully in Remix. I receive "Exception while processing transaction: revert" when I try to enter recipient account addresses from Ganache, or "...
1
vote
0answers
27 views

Trying to iterate through an array to send signed transactions results in one failure and one success

I'm trying to iterate through an array of address/key pairs and send a transaction from each one. When I do this on testrpc with an array of the account info for two different accounts, one ...
1
vote
1answer
228 views

Why doesn't my contract call create a new transaction in my ganache transaction section?

goes easy on me because I'm quite new to all of this stuff. So I've created a function which signs my transaction using web3js library and looks like this: signTx = async () => { const { ...
1
vote
1answer
151 views

Installing Ganache GUI on windows 8.1

How to install Ganache UI on windows 8.1 ? I downloaded from Official website but after downloading i am unable to install it on my machine. I tried to install it through power shell but facing ...
1
vote
0answers
50 views

Why do are the 'type' & 'removed' fields in receipt logs different between Ganache and Geth?

When I run a particular transaction and log the receipt, I am getting different results depending on if my EVM is Geth or Ganache. Specifically, Ganache returns receipt.logs[0].type: 'mined' while in ...
1
vote
1answer
157 views

Once i use selfdestruct(owner) then `Attempting to run transaction which calls a contract function, but recipient address is not a contract address`

How do I fix this? I've already tried truffle migrate --reset and/or deleting the .json files.
1
vote
0answers
99 views

How to deploy contract in Mist Browser connected to Ganache?

I connected Mist to my Private Ganache Blockchain, but when I try to deploy it it gives the following error: Returned Error: Method personal sign_Transaction not supported I can deploy contracts ...
1
vote
0answers
157 views

Remix - Contract A doesn't work anymore when I deploy contract B

I recently had to deploy my second contract on the local Ganache Blockchain (Windows) using http://remix.ethereum.org/. But every single time I deploy contract B after I deployed contract A, contract ...
1
vote
1answer
216 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 ...
1
vote
0answers
257 views

Mocha timeout, not resolving promise of large array from method.mymethod.call()

I'm trying to test a contract getter method that returns a large array. I am testing using the web3 library in Mocha with ganache-cli provider. My contract deploys alright, but trying to call the ...
1
vote
0answers
39 views

Same Transaction is getting mined twice

I have a smart contract which generates a random number and compares it with the user's input to check if both are equals, and based on that it updates a mapping. But anyhow the same transaction is ...
1
vote
0answers
119 views

How can I import the Accounts from ganache-cli into Nethereum?

Is there a way to automatically load the Accounts created by ganache-li into a project which uses Nethereum?