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
1answer
9 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
20 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
26 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
52 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('...
1
vote
1answer
58 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
51 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
69 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
28 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 ...
2
votes
2answers
60 views

How to test chain reorganization with testrpc?

I am working on blockchain synchronization script. I need a way to make reorganization programmatically for testing purposes. Is there such functionality in some testrpc?
3
votes
1answer
50 views

Difference between Puppeth and Ganache

I am trying to set up a local blockchain and started to read about Puppeth to manage the blockchain and also read about Ganache (this one I already tested a bunch of stuff), but never heard about a ...
0
votes
1answer
61 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
96 views

Connecting to a blockchain started with ganache-cli with Ganache GUI

I start a blockchain with ganache-cli, then I create a workspace in Ganache GUI the same seed phrase and port, but I keep getting this error in Ganache: I get and error this port is being used by ...
0
votes
0answers
55 views

How to manually close a websocket connection to ganache-cli

I am trying to reproduce a bug which happens after my websocket connection restarts. To pinpoint the problem I am trying to manually close (and then restart) the ws connection to my ganache-cli node. ...
0
votes
0answers
40 views

Can't create eth accounts on wifi by using ganache-cli@v7.0.0-beta.0

I was previously getting out of gas error which was resolved by following this issue. Now i installed ganache-cli@v7.0.0-beta.0 . It creates ethereum accounts on localhost if i write the following ...
4
votes
0answers
108 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 ...
1
vote
1answer
15 views

ganache test returns characters instead of numbers

mapping(uint256 => uint256) public amount; function saveAmount(uint256 _id, uint256 _amount) public { amount[_id] = _amount; } I have a function that saves amount in mapping. When I test ...
2
votes
2answers
84 views

How do I specify the network ID in the config file when migrating/testing contracts on my local ganache?

So my issue is when I run the compile and then migrate commands everything goes smooth, then I try to test by running the truffle test command and it gives me an error saying 'Error: The network id ...
2
votes
2answers
100 views

Understanding ganache timestamps

Sometimes, when I use the ganache specific evm_increaseTime method and advance to the next block, the next timestamp is NOT: current timestamp + advanced time But instead: current timestamp + ...
0
votes
2answers
51 views

Store/retrieve data doesn't work using node

i trying something simple, store and retrieve a data in a smart contract, but when i want to retrieve the data, nothing is returned. solc version is 0.4.24 web3 version is 1.2 Solidity code: pragma ...
0
votes
0answers
26 views

Why is the filter ID different ganache-cli and geth

request {"jsonrpc":"2.0","method":"eth_newFilter","params":[{"topics":["0x100791de9f40bf2d56ffa6dc5597d2fd0b2703ea70bc7548cd74c04f5d215ab7"]}],"id":0} ganache-cli`s response {"jsonrpc"='2.0', "id"=...
0
votes
0answers
51 views

How to fix? Tx nonce go out of sync when using multiple unit tests on the same contract under Ganache+Truffle

Here is my example contract (ignore the fact this could be pure, this is a simplified example and my real example is not a pure function, it changes state, but I can reproduce the bug with this simple ...
0
votes
0answers
59 views

Running Migrate in Truffle does not work

I have been using Remix for developing my dapp but decided I should use Truffle to make things a little more robust and professional. I have truffle and ganache installed. I run truffle migrate and ...
0
votes
1answer
55 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
117 views

Can I pass my mnemonic to ganache/ ganache-cli when it is starting up?

I am wondering if I can pass the mnemonic that I created using metamask to boot up my local ganache network so that I do not have to log out and login metamask with different mnemonic everytime for a ...
1
vote
1answer
394 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
1answer
94 views

Why do my events not emit the correct value?

When testing a contract with Truffle, I have found that the variables that are emitted by the event do not match the values that are passed into the event emission. Why does the event not return the ...
1
vote
0answers
70 views

Is it possible to access MetaMask functionality for integration testing?

I'd like to be able to access MetaMask to test potential user actions. I doubt it's possible to directly simulate sending transactions, but what I hope I can at least confirm is that transactions are ...
0
votes
2answers
652 views

Uncaught TypeError: e is not a function from getAccounts() + web3 1.0.0-beta.37 + truffle + React Dapp

I am creating my first Dapp by using web3 1.0.0-beta.37 and trufflfe While getting the accounts in app.js by using ganache-CLI and Metamask, I am getting following error. Uncaught TypeError: e is ...
1
vote
2answers
361 views

Can't deploy contract with web3.js and ganache-cli

I'm using the solc module to compile a Solidity contract. The compilation step looks to be working correctly, however, when I attempt to deploy the contract to the Ganache network (in a Mocha test), ...
0
votes
0answers
73 views

It is an error to execute ERC20 contract token using ganache / go-ethereum

I use go-ethereum.Error: nonce generation function failed or private key is invalid [Execution environment] ・node:11.6.0-alpine ・ganache-cli@6.3.0 Please tell the person who understands the cause. ...
1
vote
1answer
53 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.