Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
1answer
7 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 ...
0
votes
1answer
16 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
0answers
14 views

truffle unbox react - front end is unable to read / set state of the contract

I am experiencing problems with the Truffle React boilerplate code that the front end is unable to read / set state of the contract. Here are the details: I unboxed the React boilerplate using ...
2
votes
2answers
25 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
20 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
0answers
34 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
26 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
14 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
44 views

problem of call() returns null

contract permission{ struct transaction { address payable sender; address receiver; string datatype; Status status; } function getTransactionCount() public view ...
0
votes
2answers
36 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 ...
0
votes
1answer
28 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
37 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
31 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
45 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
13 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
25 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
71 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
18 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
13 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
27 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
44 views

How to save new account in ganache-cli

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
26 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
19 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 ...
0
votes
0answers
35 views

Smart contract hanging in react

I'm trying to make a call to my smart contract and write data to my blockchain, which is successful. However, after that completes I want to make an entry in a firebase database. The code appears to ...
0
votes
1answer
23 views

Solidity <address>.send() doesn't create a separate transaction?

I am new to Ethereum and I deployed a contract in Ganache which has a function like this: function withdraw(uint256 amount) public payable returns(bool) { require(accounts[msg.sender].balance &...
0
votes
0answers
22 views

Unable to install Mocha Web3 and Ganache-cli

I have been trying to install mocha,Web3 and ganache all through one command but I am facing an issue while installing can someone help me in sorting our this error. Quick response will be appreciated ...
0
votes
0answers
10 views

Ganache batch tx input (crashing)

I created a script that inputs data into my mysql db as well as hash each record and store it in my deployed contract on ganache. However midway ganache crashes and obviously the script fails. Did ...
0
votes
0answers
26 views

Why does my private network transaction use a different amount of gas than my mainnet transaction performed immediately after?

I am forking the mainnet from my own geth node with ganache-cli --fork option. Immediately after the fork, I simulate a transaction to a contract on the forked, private network. I then immediately ...
0
votes
0answers
18 views

Run multiple nodes on same Ganache blockchain [duplicate]

I am trying to run two nodes on the same ganache blockchain. I tried using the localhost link in the other node which was connected to the same network but it sort of had a mirroring effect. Any idea ...
0
votes
0answers
42 views

IPFS dapp hosting

I have uploaded the dapp frontend folder along with contracts json files on the IPFS using ipfs add <path> ipfs name publish <hash> commands. I am running Ganache for in-memory virtual ...
2
votes
1answer
49 views

Calling payable state changing function on client side with metamask in ethereum infura testnet

I can't seem to find an answer for my problem, or it's either impossible and I'm missing something, or it's trivial and I'm missing something. I have this function on client side: const bet = web3....
0
votes
1answer
21 views

Monitor transactions on private chain

I have a consortium chain (I have access to all machines where the nodes are running, but can't stop or restart them), and want to monitor what's happening on a high level. Similar to what ganache ...
1
vote
2answers
34 views

How use Truffle Framework [closed]

Anyone please help me to understand what is exactly Truffle & Ganache ? How to install & use Truffle ? Please reply who are know this.
1
vote
1answer
72 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", ...
0
votes
1answer
63 views

truffle migrate --network ropsten issues

When i run truffle migrate --network ropsten i don't see the contract deployment but just Compiling your contracts... =========================== > Everything is up to date, there is nothing to ...
0
votes
1answer
49 views

Dapp on Ganache and Truffle but… what about Remix?

My dapp runs well with Ganache and Truffle but how to deploy with Remix and connect the contract to web GUI without abi? I mean, i created a Dapp that runs really good on Ganache and i run the web ...
0
votes
0answers
40 views

Test requires block gas limit much higher than deployment cost

Im testing a really big smart contract using Truffle and Ganache-cli for my test blockchain. The Ganache-cli configuration im using is this: ganache-cli --allowUnlimitedContractSize -l 471238800 -d ...
3
votes
2answers
22 views

How to test a function call that should fail?

Im using Truffle to test my smart contracts written in Solidity and I would like to mark test as passed if function call/execution fails. Example: await instance.cancelOrder({from: accounts[1]}); ...
0
votes
0answers
37 views

Ganache-cli EADDRINUSE 127.0.0.1:8545 error?

when i start ganache-cli with command, it gives this error : ❯ ganache-cli Ganache CLI v6.4.1 (ganache-core: 2.5.3) Error: listen EADDRINUSE 127.0.0.1:8545 at Server.setupListenHandle [as ...
1
vote
1answer
101 views

How to compile Solidity ^0.5.5 contract with Node.js?

I am terribly new in Solidity and now I try to learn how to compile a contract in Solidity ^0.5.5 (No versions below). I have the contract as follow (UsersContract.sol) pragma solidity ^0.5.5; ...
0
votes
1answer
25 views

truffle test get different results between ganache-cli and local geth

When I run truffle test on ganache-cli, it will pass the test but when I run the same truffle test commnad on local geth node, it will fail with error saying invalid address at the method which takes ...
1
vote
1answer
52 views

Doubt in terminologies used in Ganache Interface

I am developing a DApp (an e-commerce app) based on Ethereum. I wrote the solidity contract and interact it with a NodeJS server/web3js API. I am running a Ganache Ethereum RPC client locally. The app ...
1
vote
1answer
65 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
2answers
143 views

How do I implement simple JS code to deploy a compiled smart contract to ganache-cli? [closed]

Everything I've tried results in strange errors, and it's been difficult to get this working. I've been struggling with this for a while, especially having problems determining which versions of web3 ...
0
votes
2answers
463 views

Truffle compile and migrate not working

I have a geth node running on my laptop. This is the command I used to start geth. geth --port 4321 --networkid 1234 --datadir=./dataDir --rpc --rpcport 8543 --rpcaddr 127.0.0.1 --rpcapi "eth,net,...
2
votes
2answers
467 views

Cannot create property 'from' on string

I'm trying to call a contract method from web3js. The contract is deployed in a local ganache. This is my full code // Instantiate contract const provider = new Web3.providers.HttpProvider("http://...
1
vote
0answers
39 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, ...
0
votes
0answers
145 views

Truffle migrate not working with 2_deploy_contracts.js

I have made a sample contract using Truffle's pet-shop. I have also added the 2_deploy_contracts.js file. I have changed the solidity version and also the constructor() public {} to comply with the ...
0
votes
0answers
36 views

Issue with truffle migrate

I'm trying to migrate a simple contract on the ganache blockchain.But when I type 'truffle migrate' command in the terminal.It freezes for some time and then command execution stops without showing ...
0
votes
2answers
126 views

web3 erroneously returning error

This is strange. My web3 script to deploy a contract seems to work, but always activates the .on('error', fcn) clause even though there is no error. The message says Transaction has been reverted by ...