Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ganache]

For questions about using the Ganache personal blockchain testing environment.

1
vote
2answers
15 views

How truffle selects the address with which it deploys a smart contract with and where does it gets it's private keys?

I am reading truffle tutorials for deployment smart contract to gauche, I've never deployed any smart contract to real network. Now when migrate (deploy) a smart contract I get these info: ...
1
vote
0answers
14 views

Processing gas cost on a sidechain

I am developing a sidechain that will store data and I want to evaluate the processing of this data in the ethereum network to get the cost in gas. I'm going to develop a smart contract that will ...
2
votes
1answer
9 views

How to add Truffle signing keys to MacOS keychain

Debated what Stack Exchange to go to for this, but I thought I'd start here since it's related to setting up a local Ethereum dev environment. I downloaded and have been using the Ganache command-line ...
0
votes
2answers
41 views

web3.utils.fromWei(web3.eth.getBalance(web3.eth.coinbase), 'ether').toNumber() gives error

web3.utils.fromWei(web3.eth.getBalance(web3.eth.coinbase), 'ether').toNumber() gives this error: > /usr/local/lib/node_modules/truffle/build/cli.bundled.js:369506 > throw new Error('...
2
votes
1answer
33 views

Can't access test network's accounts

So I've updated my framework and with it the web3,js lib. When I run the console and attempt to get an account from my test network by web3.eth.accounts, it won't display a list of the accounts like ...
2
votes
1answer
19 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....
0
votes
0answers
29 views

Invalid opcode on estimateGas 'code': -32000

this is my contract : pragma solidity >=0.4.21 <0.6.0; contract CloudProject { uint public nbCandidates = 0; uint public nbBureau = 0; uint public nPartiPouvoir = 0; ...
2
votes
1answer
53 views

Oraclize a restfullAPI using a specific number represented by the variable z

Hello I made a restfull API on my own (python file jsonify + localtunnel) on a localhost using a specific number (in this case 141) represented by the variable z. This variable should go into DevCoin ...
1
vote
0answers
28 views

What can be the difference between Remix VM, Ganache win, ropsten?

I cannot share the code, but in short something based on a payable fallback in a complicated multi contract application has this behavior: 1) tested in remix using VM: perfect 2) tested in remix on ...
0
votes
1answer
13 views

SC Truffle Testing: Domain Object Returned?

Working through some tests in Truffle to become more acquainted with the environment but am running into an issue. What I am trying to do Test a smart contract with, among others, the following ...
0
votes
1answer
41 views

Truffle and Ganache-cli test case fails

So I have this setup : truffle and ganache-cli I'm sending some ether to my contract, here is the related part of my contract: mapping(address => uint256) public balanceOf; function () ...
1
vote
0answers
36 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 ...
-1
votes
0answers
27 views

msg.sender function call from external contract works on JS VM but not on Ganache v1.2.2 GUI

There are 2 contracts. One creates a sample token and another contract uses that token within itself. Token creation contract uses a function to initialize tokens: contract Token { . . . function ...
0
votes
1answer
43 views

Solidity test file reaches gas limit due to imports

I have a sol contract X.sol and a sol test file TestX.sol. X.sol is large: ~4m Gas after optimisation TextX.sol compiles, migrates and executes tests fine when just executing a single test - testY, ...
0
votes
1answer
38 views

Set up backup from private Ethereum (Ganache) [duplicate]

I have created an ethereum application with Ganache and truffle js. i have installed ganache in a server, and th application work. but when i stop the server i lose the the smart contract that i have ...
2
votes
0answers
32 views

issue with persistence of blockchain data in ganache-cli [duplicate]

I am trying to use the persistence of blockchain data across invocations of ganache-cli. In summary, Invoke ganache with --db and -m flags like so: ganache-cli --db /xyz/ganachedata -m <same ...
0
votes
1answer
92 views

ALERT: [ethjs-rpc] rpc error with payload

I am trying to create transaction local blockchain using ganache on When i confirm the transaction i get the error as "{"id":4818399857527,"jsonrpc":"2.0","params":..", please refer screenshot for ...
1
vote
0answers
23 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
32 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-...
4
votes
1answer
84 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 ...
0
votes
1answer
29 views

InterfaceImp constract defined success,but interface function called failed

I'm trying to call a interface function for testing, but it can't work. Here is my test contract: pragma solidity ^0.4.24; interface InterfaceTest{ function testInterface() external pure ...
5
votes
1answer
1k views

Member function “transfer” not found or not visible after argument-dependent lookup in contract?

I am having a problem with my smart contract making value transfers. My current environment: Truffle v5.0.0-beta.2 (core: 5.0.0-beta.2) Solidity v0.5.0 (solc-js) Node v8.11.1 I created the ...
0
votes
0answers
56 views

Using transfer() method but don't see payment in Ganache or Metamask?

I'm using the .transfer() method in my smart contract to pay a particular address. I've checked the Ganache logs and the transaction does not revert and is auto-mined successfully. But I don't see a ...
0
votes
3answers
20 views

Truffle wrapper

ExampleContract { address public miner; constructor(){ address miner = msg.sender; } } I am using truffle and ganache-cli and I executed the following command: truffle migrate --...
0
votes
1answer
27 views

Can I get geth.ipc if I use ganache-cli to deploy a default private test ethereum env

When I test my golang code which subscribes/filter/parse log from a local ethereum test env built by myself, The way I communicate with eth is by using geth.ipc. But another test env is based on ...
1
vote
1answer
25 views

Where goes eth cost in private chain

I have a private test blockchain with ganache. I deploy one contract and make a couple transactions. Looking at the ganache UI I realized that the first account haves a ether consume to make the ...
2
votes
0answers
33 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 ...
1
vote
1answer
23 views

How to test time-dependent contracts on the mainnet?

In Ganache, I use evm_mine to simulate the passage of time. Assuming block times are accurate enough, what are the best practices to test some contracts on the mainnet or a testnet which depend on ...
0
votes
1answer
41 views

Meta Mask - Breaking Change and Ganache

I have seen the announcement about the privacy changes that Meta Mask has made about no longer injecting Web3. And the article post they made gave a snip of code to include to request Web3 to be ...
1
vote
2answers
47 views

How to set maximum block gas in ganache-cli

I'm running ganache-cli which seems to have a block gas maximum of around 6.5 million. All the research I've done about this question seems to provide answers of the user themselves setting the user ...
1
vote
1answer
48 views

Is Ganache GUI real EVM?

I was wondering whether Ganache GUI is real EVM or just a replica of it. Because its throughput and latency are way better than Geth client. Any comments on it?
0
votes
1answer
51 views

Truffle develop vs Ganache. Is there a reason to prefer one over the other?

Now that Ganache is usable, I don't see a reason to use truffle develop anymore. Is there still a scenario where the latter is preferred?
2
votes
0answers
41 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 ...
1
vote
1answer
59 views

Creation of test network using ganache

Can we reuse the values stored in the ganache test network which is running in the local machine, even if the terminal which is running ganache test network is closed or what are the possible ways to ...
0
votes
1answer
76 views

Transaction throughput: POA vs POW in private blockchain networks

I know that proof of work is resource intensive, while proof of authority is much faster as no consensus is required since the network is validated by the proper authorities. But in terms of the ...
1
vote
0answers
70 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 = ..., ...
1
vote
0answers
41 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....
2
votes
1answer
326 views

How to get private keys on Truffle from Ganache accounts

Doing some ERC-735 tests on truffle+ganache I got stuck when creating claim signatures. They need to be signed from my ganache account, but I don't know its private key. The code to be used is this: ...
1
vote
1answer
87 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 ...
0
votes
1answer
121 views

Remix IDE + Ganache vs Truffle + Ganache

I have an issue migrating a smart contract from Truffle into Ganache. However, when I run the same smart contract from Remix IDE via MetaMask into Ganache, everything works fine. To bypass the ...
1
vote
1answer
41 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 ...
0
votes
1answer
97 views

How to use Ganache, Remix IDE, MetaMask, and Web3js without Truffle

I am having an issue migrating a contract using Oraclize API to Ganache from Truffle. However, everything is working fine when running the contract from Remix IDE via MetaMask. As I want to write the ...
1
vote
1answer
107 views

How to find out the number of blocks in Ganache?

I have tested a contract on truffle using the command: truffle test I got following message: D:\Funding4\contracts>truffle test Compiling .\contracts\Funding4.sol... Compiling .\contracts\...
2
votes
0answers
51 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 ...
2
votes
0answers
77 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
21 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
94 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
53 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
1answer
204 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
41 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 ...