Questions tagged [ganache]

For questions about using the Ganache personal blockchain testing environment.

Filter by
Sorted by
Tagged with
2
votes
1answer
788 views

How to connect ethereum wallet to ganache? [closed]

Can anyone list out the steps on how to connect the ethereum wallet to ganache? Thanks in Advance
0
votes
2answers
151 views

Batch processing of contracts

Is there a way of defining contract data to be deployed and then running in a batch to deploy to the Blockchain? I am developing an application and would like to have the ability to load up test data ...
1
vote
1answer
268 views

Not displaying ether on Metamask on importing address from Ganache

I'm following PetShop tutorial, and everything works fine until Metamask came to the picture. I've restored vault using mnemonic, added RPC URLHTTP://127.0.0.1:7545, it displaying Private Network at ...
1
vote
0answers
242 views

Mocha timeout, not resolving promise of large array from method.mymethod.call()

I'm trying to test a contract getter method that returns a large array. I am testing using the web3 library in Mocha with ganache-cli provider. My contract deploys alright, but trying to call the ...
1
vote
2answers
944 views

Is it possible to run multiple Ganache nodes for private test network?

I wonder if i can create my own private cluster as it can be done with Geth for development & test purposes : https://github.com/ethereum/go-ethereum/wiki/Setting-up-private-network-or-local-...
0
votes
0answers
71 views

Unable to check for msg.value

Here is my code: pragma solidity ^0.4.24; contract TRY{ uint public temp=0; function transfer_ether() public payable{ require(msg.value>=60); temp=60; ...
3
votes
1answer
447 views

Ganache (UI) save blockchain

I am running a testnet on Ganache UI. But when I deploy a contract and close and reopen ganache, there are no blocks and the contract deployment is gone. Is it possible to save/load a blockchain ...
2
votes
0answers
180 views

Couldn't estimate the gas when running Mist against ganache-cli

I am running ganache-cli locally, then connecting Mist with /Applications/Mist.app/Contents/MacOS/Mist --rpc http://localhost:8545 Then, when I try to send from one test acccount to another in the ...
1
vote
0answers
39 views

Same Transaction is getting mined twice

I have a smart contract which generates a random number and compares it with the user's input to check if both are equals, and based on that it updates a mapping. But anyhow the same transaction is ...
0
votes
1answer
198 views

Ganache not working

I am developing on a testnet on ganache and using remix. I am working with web3 and working on the user interface. when trying to fetch a function with web3/ganache, I get the following error: "...
1
vote
2answers
488 views

Truffle test error: Cannot create instance of Vault; no code at address

I'm trying to make a simple test in Truffle using Ganache where I call a function from a smart contract instance. This component will create a Vault and return me its address. My truffle test does ...
1
vote
1answer
597 views

Difference between `0x01` and `0x1` status code?

Sometimes when running Ganache I receive status code 0x01, sometimes 0x1. Should I treat both as successful executions?
1
vote
0answers
116 views

How can I import the Accounts from ganache-cli into Nethereum?

Is there a way to automatically load the Accounts created by ganache-li into a project which uses Nethereum?
0
votes
0answers
19 views

How to use bytes to get the same hashed output [duplicate]

I previously asked a question here: link to previous question. Found out the answer is to use string instead of bytes here: pragma solidity ^0.4.18; contract C { bytes32 public temp; ...
0
votes
1answer
239 views

adress.transfer fails in ganache

I am calling address.transfer() from the one of the deployed contract. While, this works fine with remix(JavaScript VM environment), the same fails if I deploy and run the same contract on 'ganache'. ...
0
votes
1answer
340 views

Truffle test not working when I add migration.js

I have written javascript tests that run fine with truffle test ./test/Token.js However, when I have the following: var UTO = artifacts.require("./uto.sol"); module.exports = function(deployer) { ...
1
vote
1answer
189 views

Is Geth a better client to begin with understanding ethereum world?

When developing a dapp, is Geth a better choice to start with for a beginner? I see there's other options which are ganache and truffle, but not so sure which one to begin with. I guess beginners ...
1
vote
1answer
172 views

How do OpenZeppelin ERC721 tests pass?

I don't understand how the following test can pass. I tried it in my application and it fails. The entry point is the description 'when called by the owner'. In this function two test cases are ...
0
votes
1answer
47 views

Gas amount to store a contract?

i'm trying to run truffle migrate and it gives me always this error. Error: The contract code couldn't be stored, please check your gas amount. MBP-de-Alicia-2:smartContracts alicialombarte$ truffle ...
2
votes
2answers
855 views

Cannot read property '2' of null

pragma solidity ^0.4.23; import'./ID.sol'; import'./Whitelisted.sol'; contract IDFactory is Ownable { Whitelisted whitelist; event IDCreated(uint id, address idContractAddress); ...
3
votes
1answer
293 views

Can't send data to non-contract address using web3 1.0.0 and ganache

Problem According to this question, it is possible to send data to a non-contract address in Ethereum. However, if I run my code which sends ether from the first account to the second account on ...
0
votes
2answers
725 views

Viewing Tokens on Ganache or an alternative

I'm currently working with the truffle suite and so am using ganache as my test blockchain. Is there something I can do with it or with a similar product to see token balances?
0
votes
0answers
62 views

Why account balance can decrease when gasPrice is 0 and msg.value is 0?

It also spends pretty large amount, which doesn't seem to be related to gasUsed Contract: pragma solidity ^0.4.24; contract Test { bool i; function hello() public { i = true; } }...
1
vote
0answers
178 views

How can I watch my contract using Ganache testRPC?

I want to get the transaction hash + contract address ... using Ganache testRPC. since I don't have the option of using etherscan because testrpc of ganache use everything locally.
0
votes
1answer
174 views

Web browser (Chrome and firefox) is able to connect with ganache but not able to connect with local ethereum (geth)node

Firefox browser is able to connect with ganache and I am able to execute DAPP using browser. However, I am not able to connect with local geth client using web browser. Geth node is all ready up same ...
0
votes
1answer
126 views

truffle-contract: cannot test method before real consume ether method

I am using truffle-contract for connecting between frontend and smart contract. Currently, I can call method on smart contract and can consume ether successfully. const result = await instance....
0
votes
0answers
169 views

Ganache cli transaction hash collision

I am making couple of forwarding transactions (i.e. to contract address that just receives funds and proxifying it to main contract) locally on Ganache CLI running (old testrpc does the same result) ...
1
vote
1answer
236 views

Truffle test remain in “pending” status

I've a smart contract under test, which exposes a public property of type address bestSeller: contract Club { address public owner; uint public price; //price to join the Club uint public ...
1
vote
1answer
131 views

Testing ethereum smart-contracts that work with oraclize

I'm new in Ethereum and I have a smart-contract that receive exchange rate from API through oraclize. But I have problems with testing my smart-contract. For testing I use truffle + ganache. Could ...
1
vote
1answer
785 views

JSONRPC error on sendSignedTransaction

I run ganache, truffle and metmask. If I run the code below I get an error on the this.web3.eth.sendSignedTransaction() function: EDIT: changed my code to the following.. Error remained the same ...
0
votes
1answer
254 views

Can I edit genesis.json file of ganache

I want to configure ganache for using proof of authorisation consensus mechanism instead of using proof of work. I want to edit genesis.json file for the same. I want to know where ganache stores its ...
0
votes
0answers
125 views

Smart contract storage doen't work with ganache

I have this smart contract contract Ballot { struct Prop { uint votes; bytes32 data; address[] validators; } mapping (bytes32 => Prop) props; function ...
2
votes
1answer
769 views

How do I work with the latest version of solidity?

A new version of Solidity was added fairly recently, and one of the feature it adds is messages on require. I would like to use them but I'm not sure how I can do that. I'm using Ganache and truffle, ...
0
votes
1answer
452 views

How to call Smart Contract functions?

i'm deploying a smart contract which contains several functions as well as properties. The ABI looks as follows: [ { constant: false, inputs: [Array], name: 'vote', outputs: [], payable: ...
2
votes
0answers
110 views

Import contracts, compiling and deployment

quick question. I have a set of contracts A,B,C. A contains import 'B' and import 'C'. Should I just compile A and then deploy it on the blockchain for the functions in B and C to be implemented ...
2
votes
1answer
2k views

web3js sender account not recognized

Under Ganache, I created some APIs with nodejs to managing a Smart Contract. One API is for the creation of new accounts with newAccount = web3.eth.accounts.create(web3.utils.randomHex(32)); Then, ...
1
vote
0answers
353 views

Ganache Cli private network, all ethers on the network go to 0 after a while

I create a ganache cli and initialize my accounts to have ethers using ganache-cli -h "159.89.119.189" -a 3 -e "1000000000000000000000000000" --secure -u 0 -u 1 -u 2 -s 20 but after a couple of ...
2
votes
1answer
250 views

Dealing with block delays in unit tests

Consider the following Truffle Unit Test written in JavaScript: const Lease = artifacts.require("./Lease.sol"); contract("Lease", async (accounts) ...
4
votes
2answers
768 views

Solidity Error: Exceeds block gas limit

When I start ganache-cli in one terminal window and run ./node_modules/.bin/solidity-coverage (command from documentation) in another I get Error: Exceeds block gas limit at Object....
2
votes
1answer
157 views

Alternatives to listen Events contract with web3.py?

I'm facing some issue/bug on web3.py, I need to listen my event contract, but event logs are always empty. I know the following issue on Ganach-CLI but may be there is other alternative. I already ...
0
votes
1answer
24 views

Transactions encompassed by contract creation?

Given below is a simple token contract being migrated using truffle. What are the constituting transactions that make up this contract creation and why are these steps discrete? Ignore the top ...
0
votes
1answer
408 views

Build Java based application which act as front end and ethereum smart contract as back end

I have developed one app in ethereum which contains smart contract, js and html (for web app). I have developed it using truffle, ganache and solidity. I am accessing it in html and call the ...
0
votes
1answer
767 views

How to synchronise Ganache-CLI accounts with Ganache-UI?

When I launch ganache-cli for Port 7545, it will create 10 accounts by default. ganache-cli -p 7545 However, when I then open the Ganache-Desktop-App, it will show different accounts and the ...
3
votes
2answers
2k views

Solidity Exceeds block gas limit during Mocha Tests with Ganache-cli

How can I increase the gas limit in this case? The error message is "n: Exceeds block gas limit" or "base fee exceeds gas limit". I think there is some kind of api I need to set the block gas limit ...
0
votes
1answer
338 views

Solidity Ganache/Mocha test error: base fee exceeds gas limit

I got this when I was running the Mocha test with Ganache package to test the Solidity smart contracts. Then I got base fee exceeds gas limit error. Is that because my contracts are too large? Should ...
0
votes
2answers
88 views

Fetch the last state of particular asset for particular date

I have one smart contract, in which I am doing mapping of machine id and user id mentioned as below: mapping(bytes32 => uint256) public machineAllocs; machineAllocs[machineId] = userId; Now, I am ...
6
votes
1answer
757 views

Is there a maximum number of public functions in a contract?

I have two contracts A and B, both deploy and work correctly in ganache (they both use less than 6M gas). Now I want to create a third contract C that inherit both A and B. contract C is A, B { } ...
1
vote
0answers
86 views

Truffle migrate hangs when I run ganache with the --db flag

From the command line, when I run the following command: ganache-cli --db ~/Documents/Ethereum/ --mnemonic "bride forest screen jazz injury grit rather seek also donate media mechanic" and I run "...
0
votes
1answer
199 views

which wallet is usable with ganache test-rpc?

I tried metamask, but unable to send ether between accounts because metamask is trying to estimate gas and gets stuck :( myetherwallet doesn't save my seed so I need to enter it all the time
1
vote
0answers
373 views

“truffle migrate” running all migrations everytime

I have a very weird behavior happening whenever I run "truffle migrate". Ideally, as per the documentation, it states: This will run all migrations located within your project's migrations ...