Questions tagged [ganache]

For questions about using the Ganache personal blockchain testing environment.

Filter by
Sorted by
Tagged with
1
vote
1answer
11 views

Uncaught (in promise) Error: Contract has not been deployed to detected network (network/artifact mismatch)

The client side application always throws the above error. I have connected the ganache account(by copying the private key)also with the correct port number in Metamask extension as well as in the ...
1
vote
2answers
38 views

Ganache GUI installation error

node version v12.8.0,npm version 6.10.2 I followed the below steps to install the ganache GUI but I got the error $mkdir ~/ganache $git clone https://github.com/trufflesuite/ganache.git $npm install ...
1
vote
2answers
20 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 ...
1
vote
2answers
38 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
1answer
23 views

How to set allowUnlimitedContractSize in Ganache V2.1.0 with windows 10

while following this or this solution I found nowhere any file to make change for allowUnlimitedContractSize = true so my problem is same as in link but how I can change this in Ganache v 2.1.0
2
votes
0answers
28 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-...
2
votes
0answers
41 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'...
-3
votes
0answers
22 views

What is correct test script for testing “transferPreSigned” as in code below

I have Ganache-cli installed with Truffle, I need to test a delegate pre-signed transfer function through test script without involving any metamaks ( or browser etc) so may I have example and guide ...
0
votes
1answer
49 views

Confusion around Truffle, Ganache and Meta Mask

I am building a simple contract. In truffle when I give 'truffle develop' command, I get following information: On the Ganache, I have this: And finally on Meta Mask, I see this: here, Shikhar is ...
0
votes
0answers
14 views

Ganache does not show the transferred amount.but it shows theme in account section

as shown in the picture the amount of value which is transferred to contract is shown in the transaction section of Ganache. I mean it shows the amount which is transacted to the address. in the my ...
0
votes
0answers
15 views

Help etc20 ganache

Good morning, I can't solve the problem at all: Not possible to connect to the Web3 provider. Make sure the provider is running and a connection is open (via IPC or RPC) can anybody help me? I am ...
0
votes
1answer
25 views

i'm creating new account and when i get the balance for that account it returns 0 and cant do any transaction saying dont have enough funds

How to load funds/ether into newly created account. I'm using Ganache and Web3js var web3 = new Web3("HTTP://localhost:7545"); var privateAccount = await web3.Personal....
1
vote
1answer
30 views

Request to http://localhost:8545 from https website

I am building a website that should interact (from the browser, not back-end) with custom Ethereum nodes, including local, something like MyEtherWallet. I can connect to ganache http://localhost:8545 ...
0
votes
0answers
11 views

Getting error when importing, no error when using code in single file: Failed to execute 'postMessage' on 'Window'

I am trying to access the web3 object injected into my browser by Metamask. I am using custom rpc (). I can see my accounts and correct balances in Metamask. I have the following code: //web3.js ...
0
votes
1answer
10 views

Problem with loading my front end local host due to metamask

I have been trying this Dapp university tutorial online and after following it meticulously I've come across this problem. I suspect it's metamask as the video said if I get this loading message I ...
0
votes
0answers
71 views

web3.eth.getAccounts() returns empty array

I'm trying to get accounts like that: window.web3.eth.getAccounts( (error, accounts) => { console.log(accounts, error) } ); but it keeps returning an empty array. I'm running Ganache and I can ...
0
votes
0answers
48 views

can I change the network id in ganache GUI? is it work for calling the functions in solidity?

1.can I change the network id in ganache GUI? is it work for calling the functions in solidity? I am running the private network using ganache Gui in localhost and I checked by changing network id ...
0
votes
0answers
32 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
1answer
18 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
2answers
22 views

Truffle error missmatch artifact

What does this means?network/artifact mismatch Contract has not been deployed to detected network but when i write truffle network i can see mine.
-1
votes
1answer
22 views

Truffle ganache error

I have this error~! Contract has not been deployed to detected network (network/artifact mismatch) Can you help me thank you!
0
votes
1answer
44 views

Getting Error:VM Exception while processing transaction: revert', 'code': -32000. when deploying to Ganache using Web3.py

I get the following error message: Getting Error:VM Exception while processing transaction: revert', 'code': -32000 I am connected to Ganache. Here is my code: import json from web3 import Web3 ...
0
votes
1answer
25 views

Web3 event listener - timing issue when immediately retrieving contract values

I'd like to be able to immediately get a struct value from a mapping after calling a function that updates the struct, however, when testing with Ganache, sometimes the event arrives to the listener ...
0
votes
1answer
32 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 ...
0
votes
1answer
18 views

“new” Solidity keyword deploying the “Factory” contract again instead of “MyContract”

I have been trying to develop a parent contract that will deploy other contracts on request with different parameters. I came across the "new" keyword which seemed like a perfect choice. But when I ...
0
votes
2answers
103 views

Can not install Ganache GUI on Ubuntu?

I am trying to install Ganache GUI on my ubuntu 18.04. I downloaded the Ganache-2.0.1.AppImage from the site. On the site it says that the package installs automatically when double clicked. But it is ...
0
votes
0answers
27 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
36 views

When do you use ganache-cli and when do you use ganache-core?

I have seen two usages over the internet 1. const ganache = require("ganache-cli"); web3.setProvider(ganache.provider()); 2. const ganache = require("ganache-core"); web3.setProvider(ganache....
0
votes
3answers
46 views

Solidity Compatibility Configuration

I am a cyber security analyst who is new to ethereum and working on a project to study crypto security. It's a series of 22 vulnerable smart contracts that you're supposed to exploit. For anyone who ...
1
vote
1answer
215 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 ...
2
votes
2answers
63 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 ...
1
vote
1answer
33 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.
1
vote
1answer
74 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"), ...
3
votes
1answer
86 views

Ganache + Truffle: how to deploy a contract without considering the gas

I am working with Ganache and Truffle. I am trying to deploy kind of a huge smart contract, but most of the functions in this smart contract are pre-prod functions, so I do not really worry about real-...
0
votes
0answers
45 views

Contract has no network id set, cannot lookup artifact data

I am using web3 v1.0.0-beta.37 and truffle contract for server.js configuration. I have defined two contracts FlightSuretyData.sol and FlightSuretyApp.sol FlightSuretyApp contract access functions ...
0
votes
1answer
117 views

problem of call() returns null

contract permission{ struct transaction { address payable sender; address receiver; string datatype; Status status; } function getTransactionCount() public view ...
1
vote
3answers
122 views

Increase block number on Ganache

How can we increase block.number on Ganache for testing purpose ? If not possible do you know an alternative like passing X fake transactions to artificially increase block.number. Or if we have to ...
1
vote
3answers
77 views

A single exception in Truffle test causes every other test cases to fail

I'm making test script for my contract and it looks likes contract('...', async () => { let token = null; before('deploy', async () => { token = await MyContract.new(...); })...
0
votes
2answers
99 views

web3 1.0 events never fire

First off, my setup. System: ArchLinux Ganache: v2.0.0 (correction, v1.3.1) Solidity: 0.5.8 web3: 1.0.0-beta.37 (anything higher than 37, contract wont deploy) Node: 'latest' Some background and ...
0
votes
1answer
34 views

Create a large number of contracts with different addresses

I'm developing a performance test where I check the time a gateway spends to find a contract in a blockchain. I'm using ganache-cli to simulate the blockchain, my doubts are: 1) Is it possible to ...
0
votes
2answers
272 views

Solc error invalid opcode, but works in truffle

I am trying to compile solidity code in solc(nodejs) but unsuccessful so far. I have created a sample app for demo. Here is sample's directory structure (node.js and truffle combined): │ app.js │ ...
1
vote
1answer
35 views

Can ganache-cli connects to another ganache-cli?

Is it possible to create a private network using ganache-cli? Can a ganache-cli running on port 8545 connect to ganache-cli running on port 9545? Can we use ganache-cli as a node? Or it is a ...
0
votes
1answer
82 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') ...
0
votes
2answers
202 views

Metamask not returning current account address with web3js and ganache

How to return the address of my current account from Metamask? I have tried with web3.eth.getCoinbase() but this and metamask has two different address. web3.eth.getCoinbase() returns me the first ...
0
votes
0answers
32 views

Manage accounts in Remix Web3 Provider env connected to a TestRPC client node

When I run the TestRPC client (ganache-cli), it provides me with 10 different accounts and private keys along with a local server at localhost:8545 Available Accounts (0) ...
0
votes
0answers
14 views

Can ganache serve at a directory in addition to a port?

Using the ganache command line interface I can set a seed and a port: ganache-cli --seed 2048 --port 2020 Which serves to Listening on 127.0.0.1:2020 Can I get it to serve to a directory of my ...
0
votes
1answer
74 views

Can't connect Android app to Ganache using retrofit

I'm have deployed contracts on ethereum blockchain. I have ganache running on server I'm tring to connect to it from android with this code: private BlockChainService() { Retrofit retrofit =...
1
vote
1answer
128 views

How to save new account in ganache-cli [duplicate]

I use ganache-cli --db to create a private test chain and save it on my computer, and the result is below: I use web3py w3.personal.newAccount('1') to add a new address, and I use print(len(w3....
0
votes
0answers
44 views

Invalid OPCode on passing address parameter through Java wrapper on smart contract using Ganache

I have been facing this issue for some time and I realized there must be a problem with Ganache or maybe someone has any idea why it doesn't work. I have created a very simple contract as below, it ...
1
vote
0answers
20 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 ...