The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [ganache]

For questions about using the Ganache personal blockchain testing environment.

Filter by
Sorted by
Tagged with
2
votes
0answers
256 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 ...
1
vote
1answer
46 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
364 views

web3js - Promises - web3.eth.getAccounts()

Objective: Assign a global variable to the first indexed address returned in web3.eth.getAccounts(). I want this so I can use it in the rest of my code and simply reference a variable. Problem: ...
1
vote
0answers
95 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 "...
0
votes
2answers
859 views

Cannot connect ganache-cli to metamask

I am trying to follow the truffle pet shop tutorial. But failed to connect metamask with ganache-cli I ran ganache-cli in the console and changed the rpc url to http://127.0.0.1:8545 But the addresses ...
0
votes
1answer
52 views

Create a new contract from other contract by connecting to ganache-cli

I am trying to create a contract from other contract on gnache-cli using remix web3 provider but getting following error: VM Exception while processing transaction: revert The issue is that when I ...
5
votes
1answer
516 views

Web3.js + ganache local development: Response to preflight request doesn't pass access control check, CORS error

I am fairly new to DAPP and I am trying to follow an online guide building my first smart contract. Here's the source code: Election.sol pragma solidity ^0.4.2; contract Election { string ...
1
vote
1answer
239 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
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 "...
0
votes
1answer
160 views

Solidity contract runs on Ganache but gives runtime errors on Geth

I have a really simple contract. The tests run great on Ganache, but on Geth I get strange runtime errors. Solidity contract: pragma solidity ^0.4.17; contract SimpleStorage { mapping(address =&...
1
vote
1answer
111 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
144 views

Out of gas in web3 but not Remix?

I have a test function: function test(uint[400] subscriptions, uint[400] subscriptionIndexes) public view returns (uint[4000], uint[4000], uint[400]) { uint[4000] memory postSenders; ...
0
votes
1answer
103 views

Getting error in the contract code “please check your gas amount”

I am getting this error: Error: The contract code couldn't be stored, please check your gas amount. This is when I am importing one extra contract with the name of TimedCrowdsale from ...
1
vote
1answer
170 views

How do I access the owner's funds in the Truffle test environment?

I'm trying to test my simple coin-based contract in the Truffle test environment by sending funds to the first user's address. My understanding is that the contract is created (thereby calling the ...
2
votes
1answer
140 views

Contract call with ether and gas fails with revert

Testing with Truffle and solidity on localhost ganache network: Works: function dosomething(string a) { //do nothing } testing with: TokenFactory tf = TokenFactory(TokenFactoryAddress); ...
2
votes
0answers
120 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 ...
8
votes
3answers
6k views

Difference between Ganache and Truffle

What is the difference between this two? I understand that Ganache is like a fake blockchain, but Truffle has that too ? What are the limitations of each and under which circumstance we use either ...
1
vote
1answer
256 views

Smart Contract to send ether

I have Solidity contract that is meant to send ether to someone. Unfortunately it's giving me a cryptic error message after I confirm the transaction in MetaMask. I'm testing on a local ethereum ...
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 ...
3
votes
1answer
526 views

ganache-cli doesn't have enough funds to send tx – number increases proportionally to however much I initialize a wallet with

I'm trying to write a simple function to send a transaction using web3 and ethereumjs-tx that empties the wallet of an account (call this account A) into another account (account B). However, no ...
1
vote
1answer
219 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
150 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 ...
2
votes
0answers
760 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
164 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
1answer
891 views

Can we see events in ganache?

I am using Ganache and wanted to understand where can we see the events in the Ganache UI. I tried checking the events in the transaction and logs tab but I did not find it. Here is one sample code. ...
1
vote
0answers
49 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.
3
votes
2answers
113 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 ...
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
2answers
678 views

Get Gas use of a transaction with web3

is it possible to get the information about the actual amount of gas that was used for a transaction? I have the transaction hash and I'd like to know the gas that was used by this transaction after ...
0
votes
3answers
46 views

How I add Security to the smart contract?

I deployed this contract and also interacted with it using ganache. pragma solidity ^0.4.0; contract Counter { int private count = 0; function incrementCounter() public { ...
0
votes
1answer
128 views

Basic token transfer and unit test

I am having trouble testing a very naive transfer method for my coin, based off of the ethereum.org demo coin. I've simplified it down into the essentials, yet my solidity unit test keeps failing. ...
0
votes
1answer
274 views

Comparison of Metamask vs Ganache [closed]

I watched some videos about Metamask but I am so confused by it Metamask: To use the final application like the end user would. Based on that, what is the purpose of React then? What are the ...
0
votes
1answer
82 views

How can I use an account created on a webpage?

I am developing an API in javascript and one of the method calls is to register an account. I use web3.js to create an account and then I return the public and private key of this account. Another ...
1
vote
1answer
2k views

Web3 server-side trouble connect with ganache

I need to create server in nodejs that will create transaction to blockchain and i have trouble to connect my nodejs app with ganache. Look at my code: const Web3 = require('web3'); var web3 = new ...
1
vote
0answers
155 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 ...
0
votes
0answers
61 views

Remix and ganache-cli | Contract override

I have a problem when developing in Remix and using my testnet as a blockchain. I have a contract that connects through an interface with an standart ERC20 contract. Everything works fine until I ...
0
votes
1answer
334 views

Metamask won't display correct balance after creating customrpc for ganache accounts

I made a customrpc network on metamask using the correct server and imported a private key from ganache, which worked but the eth balance is displaying 0 when I expected it to display 100. According ...
4
votes
1answer
934 views

Attach to ganache-cli using geth

Is it possible to attach with geth to ganache-cli? I start ganache-cli like this: ganache-cli --db ~/ganache -i 15 Then I try to attach to the chain like this: geth --datadir ~/ganache/ --...
1
vote
1answer
242 views

Uncaught TypeError: this._eth.sendTransaction is not a function

Hi I'm trying to make a voting module which the user can cast votes by pressing radio button. But when I run this error comes out. Uncaught TypeError: this._eth.sendTransaction is not a function ...
0
votes
1answer
142 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
214 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 ...
0
votes
1answer
234 views

How can we assign unique hash id to the id that created inside our smart contract in ethereum?

I am using truffle, ganache and web3. I am initializing user id in smart contract while deploying the smart contract. As of now, everything is done by account[0] of Ganache. Now, I want functionality ...
1
vote
1answer
82 views

See the contract code in Meta Mask or/and Ganache

I have set up Ganache and Meta Mask on my browser and I have deployed a sample contract in it. Just follow the steps mentioned in https://truffleframework.com/tutorials/pet-shop. As far as I found ...
0
votes
0answers
86 views

How to be sure “ethereumjs” is installed?

I installed ethereumjs library using following command: npm i ethereumjs-testrpc And here is the output: And then I tried to run an html example which uses ethereumjs-vm. The example is here : ...
2
votes
2answers
127 views

Is drizzle a contracts lib?

I'm researching about smart contracts, and been seeing a lot of truffleframework, ganache and drizzle. In the other hand, only found broad descriptions of those tools: "Drizzle is a collection of ...
0
votes
1answer
252 views

Ganache and truffle - how to set zero deployment fees

I am running a local ganache-cli node on my machine and would like to have zero transaction fees. For this reason I am starting the node using ganache-cli -g 0 which sets the gas price to zero. ...
0
votes
3answers
719 views

Ganache get the mnemonic of all accounts

When I install the Ganache a mnemonic is shown at the user interface. I think that the mnemonic which is shown in Ganache UI is for first account (account[0]). As a test I open the MetaMask select ...
2
votes
0answers
201 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 ...
0
votes
1answer
91 views

If statement in for loop not filtering out items

// @param physicalAddress - the actual address of the home a host wants to list (not the ethereum address) // @return _id - list of ids for homes function listHomesByAddress(string ...