Questions tagged [testrpc]

Questions related to the test RPC client/simulator https://github.com/ethereumjs/testrpc

96 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
2answers
773 views

TestRPC and Metamask: hanging on pending transactions

I'm using Remix and connecting to Testrpc via Metamask. I can successfully launch contracts to testrpc, but then it hangs on the subsequent calls that Remix makes to the public methods (Remix says "9 ...
7
votes
0answers
349 views

testrpc 2.0.0 - cannot find module 'memdown'

Trying to get testrpc (2.0.0) working on an ubuntu virtualbox, and getting this error when I run it: mowliv@u4:~$ testrpc module.js:341 throw err; ^ Error: Cannot find module 'memdown' ...
4
votes
3answers
2k views

Correctly deploying contracts with web3 1.0 and testrpc (invalid opcode error)

I followed the following tutorial: https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-1-40d2d0d807c2 Now this tutorial is not using the recent version of web3 but ...
4
votes
0answers
226 views

how to get revert at the previous timestamp of evm in testrpc

I am testing my contracts so at some point i need to increase the timestamp of evm that i achieve through evm_timeIncrease but now i want to execute some functions on the basis of current timestamp ...
4
votes
1answer
173 views

Testrpc transactions are failing. How do I perform a transaction when Mist cannot estimate gas?

I am attempting to perform transactions and create contracts using EthereumJS Testrpc. I set it up by running the following: Terminal 1: testrpc Terminal 2: mist --rpc localhost:8545 Running both ...
4
votes
0answers
427 views

Deploying contracts on geth returns {“jsonrpc”:“2.0”,“error”:{“code”:-32600,“message”:“EOF”}}

I'm trying to connect geth with truffle to deploy my contracts to my testrpc. When I run truffle deploy it's running but when I do http://localhost:8545/ it's throwing {"jsonrpc":"2.0","error":{"...
3
votes
0answers
480 views

Contract not stored and out of gas in migration at Truffle ganache

I am facing this issue regularly while trying to migrate bunch of contracts but it get failed because of this issue . I am running over testrpc , i tried lot of recommendations over stack exchange and ...
3
votes
1answer
900 views

SendSignedTransaction web3 v1.0 method call stack underflow

When calling sendSignedTransaction I got: VM Exception while processing transaction: stack underflow Used code is below, using TESTRPC: const serializeTx = async (contractInstance, publicKey, ...
3
votes
1answer
637 views

How to connect to testrpc from another machine local network?

I have a testrpc running on a machine but I want to connect the Remix IDE to it which is on another machine. I can connect to the testrpc with Remix IDE if both are on the same machine. Tried with ...
3
votes
0answers
134 views

Not able to successfully do transactions of default MetaCoins(from Truffle) on local testnet on MetaMask

I have installed truffle and ran the default contract provided by truffle. I successfully compiled,migrate and put the default dapp on local testnet http://localhost:8080/.I am able to see the dapp ...
3
votes
0answers
245 views

How to change block's current time in testrpc

I created a smart contract, in that i'm assigning now to particular value. uint raisedtime=now; EmitNow(raisedtime); //event function. It return the unix timestamp of vary old date. How to change or ...
3
votes
0answers
768 views

ERC20 Transfer Event error or intended?

I'm trying to get an Event "Transfer" for the ERC20 Token with web3 function getTransactionReceipt event Transfer(address indexed _from, address indexed _to, uint256 _value) You can see the term ...
2
votes
0answers
82 views

Testrpc - How to turnoff writing messages to the console?

Is there any way to force testrpc to stop writing messages to the console ? Currently I am getting ton of messages about getBlockByNumber eth_getBlockByNumber eth_getBlockByNumber net_version The ...
2
votes
3answers
431 views

Ganache with Metamask is filling command window with “eth_getBlockByNumber” string

When connecting Metamask with Ganache-Cli, as soon it generates the accounts and keys, the command window is getting filled with "eth_getBlockByNumber" continuously, has anyone else faced the issue? ...
2
votes
1answer
75 views

Simulating the DAO attack using truffle

I'm trying to simulate the DAO attack for a research project I'm working on. I have truffle and testrpc setup on my machine. I use the sample code given in this tutorial. I try calling the BankAttack ...
2
votes
0answers
506 views

Remix Testrpc “base fee exceeds gas limit”

I am following this great tutorial from Ed Zynda. I started testrpc and tried to deploy the FuncToken.sol to a Web3 Provider. I managed to connect to the local RPC (have to change protocol from https ...
2
votes
0answers
228 views

I can't see any events triggered in tests

I'm using Truffle Framework and TestRPC. Sometimes I can see events, but not always, so how do I show events in the console when running: truffle test ?
2
votes
0answers
370 views

How to send ether from one account to another in a smart contract deployed on testrpc

I'm interested in writing a smart contract using solidity that sends ether from one account to another. What would the syntax be? If possible, could you point me to a solidity contract that sends ...
2
votes
0answers
240 views

Error when starting testRPC

I get this error when testrpc is launched. Somebody know how to solve this?
2
votes
0answers
435 views

Why is dynamic array length not updated after addition of new element?

I created a struct as follows: struct Node{ // each node models each device on the network address nodeAdress; // adress of the node uint trustValue; // trust value ...
2
votes
0answers
329 views

How to ensure correct ordering when using a for loop in truffle test

I am using truffle (javascript) to test my solidity contracts and want to automatically run my contract functions a large number of times. I can't figure out how to make a for loop work with promises ...
2
votes
0answers
233 views

Error in dapp developed using 'Truffle' framework -Smart contract function call won't get executed

I am developing a dapp using 'testrpc' and 'truffle'.I have also used ethereum-bridge for Oraclize.I have written a smart contract function which calls a url using 'OraclizeQuery'. The following is ...
1
vote
1answer
49 views

HTML interaction with blockchain

I'm collecting temperature data from user on-chain. However, since cant get exact (live) time through my html code connected via testrpc to the blockchain I do so. Where post click a button, html ...
1
vote
0answers
21 views

Why is one of my transactions using more gas when both carry out the same function of sending ether?

Below are two functions that I have in a simple lease smart contract. I am running a TestRPC node with Remix on version 0.5.1. When I call the terminate function, it executes and terminates the ...
1
vote
1answer
196 views

In the Remix Web3 Provider IDE, how do you call a function in an ERC20 token contract from another contract without getting an estimateGas error?

I am building a very basic smart contract, 'CheckAllowance', on top of the 'FiatTokenV1' ERC20 token in the Remix Web3 Provider IDE. When I try to check an address's allowance in the 'FiatTokenV1' ...
1
vote
2answers
43 views

What are contract Variables and how are they different from normal varables declaration

pragma solidity ^0.4.2; import DappToken; contract DappTokenSale { address admin; DappToken public tokenContract; function DappTokeSale(DappToken _tokenContract) public { ...
1
vote
0answers
186 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.
1
vote
0answers
211 views

Error on running any contract in online remix browser using Injected Web3 with Meta Mask

On running contract, I am getting error as shown below: creation of VFCToken pending... creation of VFCToken errored: Error: Error: [ethjs-rpc] rpc error with payload {"id":7746970824019,"jsonrpc":"2....
1
vote
0answers
278 views

How to downgrade geth version?

I'm having this error, which I doubt is because of the newer version of geth & the project being more than a year old. I'm unable to downgrde geth anything below 1.5.9, I'm using a mac. Also, I'...
1
vote
1answer
627 views

Problem with truffle console : Cannot read property 'call' of undefined

I have a problem when executing the code HelloWorld.deployed().balance.call().then(console.log) This error introduced: Cannot read property 'call' of undefined This problem is similar to this ...
1
vote
1answer
87 views

Contract testing works in solidity but fails in truffle - testrpc

I have a contract like this: PublishService.sol, the strings.sol is taken from here. pragma solidity ^0.4.0; import "./strings.sol"; contract PublishService { using strings for *; struct ...
1
vote
1answer
457 views

Cannot get web3.eth.sendTransaction() to work properly. The function does not fire

I am creating this very simple program that sends ETH from one address to another. I am using rinkeby.infura.io to get FREE ether and for testing purposes. My code seems to work fine because when I ...
1
vote
0answers
157 views

How can i increase the block number in testrpc?

I have the contract which has the dependencies on the block.number so in my javascript test cases I want block number jump. I know about the eth_mine but it will mine only the current block or work ...
1
vote
1answer
270 views

How to connect IPC and RPC to transact fake ethers?

I have setup 2 nodes, 1 on testRPC and the other on geth(using cmd and mist). How to sync both the nodes so that I can write a crowdfunding smartcontract for the accounts in both the private nodes to ...
1
vote
0answers
230 views

change web3-js version used in javascript

In the node command, the web3 version used is 1.0.0 and the function like: web3.eth.accounts.create(); is working properly but in my webpage running on ganache-cli(testrpc) the same command is not ...
1
vote
0answers
24 views

testrpc throws when I set a state variable to 0

Any idea why calling set() on this contract throws base fee exceeds gas limit when executed on testrpc 6.0.3 via Remix IDE? /* Calling set() works fine on javascriptVM, fails on testrpc/ganache-cli 6....
1
vote
0answers
376 views

'out of gas' error when running a payable function on Remix+TestRPC

I'm using Remix connected to TestRPC and I'm getting an out of gas error when calling the sendEther() function with the argument set to the address of one of the accounts created by TestRPC at startup:...
1
vote
0answers
283 views

Constantly out of gas on testprc

I am trying to connect remix to testrpc, but anything at all I run there gives me an "out of gas" message. I started the testrpc using testrpc -l 4500000000000 So I would have thought it would be ...
1
vote
0answers
128 views

Transaction consumes more gas using MetaMask's injected web3

I have a simple contract: pragma solidity ^0.4.4; contract Counter { uint public count; function Counter() { count = 0; } function inc() { count++; } } And some javascript that ...
1
vote
0answers
480 views

Send raw transaction data with contract dependencies

I have a solidity contract that creates another contract: contract Factory { function createContract () returns (address){ address newContract = new test(msg.sender); return ...
1
vote
0answers
130 views

Function consumes all gas using TestRPC, but is fine in JS VM

So here's the function that's causing trouble: function init() { require(! isInitialized); isInitialized = true; bytes32[] storage votableGroups; bytes32 fullTimeHash = keccak256('...
1
vote
0answers
80 views

Solve Git Code Error Contract Crowdsale

I am getting the following error when doing truffle migrate on the following code: https://github.com/CoinFabrik/ico/tree/9ac3487b6103c96958cdabf8b9ce2071a7250cd8 Deploying Crowdsale... Error ...
1
vote
2answers
579 views

Out of gas when calling smart contract function from web3/Meteor Dapp

The following smart contract function works when called in the Remix-Solidity IDE and connected to testrpc. function submitAsset(string ownerName, string assetName, string assetDesc, string barcode, ...
1
vote
0answers
119 views

“No such file or directory” when Executing Test RPC

I installed testrpc using the following: npm install -g ethereumjs-testrpc NPM -v: 5.3.0 NodeJS -v: v8.5.0 Now, whenever I try to initialize a random testnet by running the command: $ testrpc I ...
1
vote
0answers
56 views

TestRPC crashing

When I run my Truffle test suite locally with testrpc, testrpc sporadically fails with this error: eth_call /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:61262 db.get(key, { ...
1
vote
0answers
164 views

Get test ether in parity account

I installed parity-poa-playground from (https://github.com/dstarcev/parity-poa-playground) on Windows 10 and managed to made it working with parity configured from (https://github.com/paritytech/...
1
vote
0answers
90 views

Works on actual network but does not work on testrpc

I can get the AddPerson() work on the actual private ethereum network. But when I call AddPerson() on testrpc, it gives me : "callback contain no result Error: VM Exception while processing ...
1
vote
0answers
248 views

Parity and testrpc

I run a testrpc node on localhost:8545. Is it possible to connect Parity client to this node and work with contracts deployed to this network?
1
vote
0answers
93 views

Event triggering multiple times

window.getProjectId = function() { Bidding.deployed().then(function(instance) { instance.projectReturn({}, function(error,result) { if(!error) var pid = (result.args.projectId); ...
1
vote
0answers
232 views

testrpc throwing 'out of gas' if same number of parameters passed while deploying as constructor

When I'm trying to deploy my contract on testrpc with correct parameters, it's throwing 'VM Exception while processing transaction: out of gas' exception. I deployed same contract on Ropsten and it ...