Questions tagged [testrpc]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
490 views

Simple event watching with testrpc - unexpected output

Working with this example, I've been attempting to utilise event watching from the web js api. Window 1 (a testrpc instance with filled account): testrpc -a 1 Window 2 geth attach rpc:http://...
0
votes
1answer
438 views

Pass address[] array to Truffle deployer (MultisigWallet)

I am trying to deploy the MultisigWallet contract on testrpc. However, I can't figure out how to provide the address[] _owners constructor parameter in the deployment command. I've tried several ...
4
votes
1answer
644 views

geth vs ganache (testrpc): failed transactions produce different results

It seems that geth and ganache-cli (testrpc) have differing behaviour on failed transactions. Suppose (1) I have a trivial smart contract with a variable, a getter&setter, and an event. The ...
-1
votes
2answers
1k views

Error: listen EADDRINUSE :::8545

C:\Users\Kane>testrpc EthereumJS TestRPC v6.0.3 (ganache-core: 2.0.2) C:\Users\Kane\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\build\cli.node.js:74143 ... ... ******Error: listen ...
0
votes
1answer
21 views

Html interaction with smart contract via web3.js

I have a html code interacting with my smart contract via a local test rpc local host. I was just wondering if I deploy this contract to the main network instead of using test rpc, what should be the ...
0
votes
1answer
23 views

Testrpc on ubuntu

I have a .php website on my ubuntu virtual machine. I want to start the testrpc in this machine, so I can interract with my smartcontract with this web interface. Is this possible?
0
votes
1answer
20 views

Gas estimation failed when using web3 provider testrpc

Gas estimation failed error while invoking a simple function pragma solidity ^0.5.9; contract sample{ uint number; function setNumber(uint _number) public{ number = _number; } ...
3
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 ...
8
votes
1answer
564 views

Filtering on events of the entire blockchain not possible in testrpc via truffle

A contract I wrote has an event in its constructor. Since I want to find it back in the logs it doesn't seem possible to start listening to the latest block. Because the event is already 'fired' ...
-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 ...
7
votes
2answers
2k views

Simulating the passage of time with testrpc

Any tips on how to simulate real network conditions on the testrpc testing client using truffle? I have some functions that look at blocknumber and try to deal with passing time. Has anyone come up ...
7
votes
2answers
673 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 ...
0
votes
1answer
39 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
1answer
32 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 ...
3
votes
1answer
835 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
2answers
3k views

Error: Error: [ethjs-rpc] rpc error with payload {“id”:6223335088050,“jsonrpc”:“2.0”,“params”:

I have deployed a smart contract in Remix IDE using MetaMask and test rpc. I got the below error: Error: Error: [ethjs-rpc] rpc error with payload {"id":6223335088050,"jsonrpc":"2.0","params":["...
0
votes
1answer
49 views

Do we have to compile and deploy our contract to ethereum each time we start a test rpc?

I'm trying to develop a voting application, I have successfully compiled the app and also deployed it to ethereum blockchain. Now I've closed the test rpc and node console, and when I restarted node ...
4
votes
6answers
7k views

Could not connect to your Ethereum client

When I type testrpc cmd in console, client is working, then many many "eth_getBlockByNumber" appear, why ??? please give me some advice. Then I open other window, type "truffle test" cmd, it can ...
0
votes
1answer
52 views

Unable to change the length of a global 2D storage array

I am facing difficulties changing the length of a global 2D storage array. It seems to be working correctly on Remix IDE, but when I try to test it on ganache-cli (formerly known as testrpc) - either ...
1
vote
1answer
137 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
1answer
48 views

Metamask “Unknown props error”?

I am using Metamask on Chrome. While I was clicking to send ETH on Private Network (localhost: 8545), I have been getting an error about "Unknown props network, identities, addressBook on tag. Remove ...
0
votes
1answer
60 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 ...
10
votes
3answers
5k views

Truffle invalid address

With Truffle 3.0 when I call one of my contract's function, in console I have this error: Uncaught (in promise) Error: invalid address I found this workaround, and in my code I try this with no ...
1
vote
1answer
281 views

address.send (msg.value) returning false but ethers got transfered

This is function I am using to transfer ethers from user account to contract account. function addEathersToContractAccount(address contractAddress)public payable returns(bool){ ...
0
votes
1answer
940 views

“UPDATED : ” “VM Exception while processing transaction: revert”

I tested signature verification of the code presented HERE as follows: running testRPC : root@ubuntu:/home/s# testrpc EthereumJS TestRPC v6.0.3 (ganache-core: 2.0.2) Available Accounts =============...
0
votes
1answer
180 views

How to read previous blocks data?

I'm new to block chain technology. I'm trying to store and read blocks using testRPC along web3.js. I'm able to get the latest block data but not able to fetch previous blocks data. Please some one ...
0
votes
1answer
97 views

Is there any version of ethereumjs-testrpc for ethereum classic? How to launch geth --rpc in geth classic version on linux?

I was wondering if there is any version of that local test version but for ethereum classic. Another question is, in order to use web3.py and geth in my VPS ubuntu terminal...how can I open a geth --...
0
votes
1answer
364 views

inject web3 in electron-ethereum-react desktop application

I am trying to make ethereum-electron-react application. when I try to inject web3 it does not get detected. import Web3 from 'web3'; console.log (Web3); this shows an empty object even though ...
0
votes
0answers
94 views

Error: The data field must be HEX encoded data

I am trying to make a simple dApp by using a tutorial. I am using the following command ; npm install ganache-cli web3 so that we can use web3 to get fake ethereum nodes/accounts by connecting it ...
2
votes
1answer
67 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 ...
0
votes
0answers
75 views

Can't connect to localhost:8545 while using ethereumjs-testrpc web3?

I am developing a simple Voting dApp by following a tutorial. In this tutorial we are using npm install ethereumjs-testrpc web3 so that we can get the fake nodes of Ethereum. For that i first ...
0
votes
1answer
157 views

Why I do not get returned value of function of my smart contract using testRPC and a Graphical User Interface?

I have a smart contract that is tested with remix and it works well. Its code is as follows : contract Weechain: pragma solidity ^0.4.15; // --------------------------------------------------------...
0
votes
1answer
198 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
0
votes
1answer
207 views

Trouble running node to test Web3

I'm trying to test basic web3 with node. I have testrpc running and I have the following in a javascript file: var Web3 = require('web3'); var web3 = new Web3(new Web3.providers.HttpProvider("http://...
0
votes
1answer
186 views

Unable to install ethereumjs-testrpc on AWS Cloud9 (Closed Issue)

I was able to install truffle and as a follow up was trying to install ethereumjs-testrpc on the Amazon AWS Cloud9 dev environment. While running the following install command sudo npm install ...
0
votes
1answer
227 views

testrpc --account private key length is invalid even though its my account

I tried to initiate a testrpc account and passing my account with value to test the transactions but when I keyed in my key 0x94fd019eeb92780477b01ce5555513d3755b5193 it says that the key is invalid. ...
4
votes
1answer
168 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 ...
1
vote
2answers
36 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
1answer
235 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
2answers
477 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, ...
2
votes
1answer
212 views

How would one use stubs for unit testing solidity code?

Given some contract A, that depends on another contract B, what would be the best way to unit test functions from A without inadvertently testing code from B. Normally, we could use stubs to return ...
0
votes
1answer
290 views

Passing command-line arguments to 'truffle test'

I have a JS script which I pass to truffle test from command line: truffle test my_script.js I would like this script to take an input argument (retrieved via process.argv[2]). Does `truffle ...
0
votes
1answer
315 views

Metamask won't display correct balance after creating customrpc for ganache accounts

I made a customrpc network on metamask using the correct server and imported a private key from ganache, which worked but the eth balance is displaying 0 when I expected it to display 100. According ...
1
vote
1answer
518 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 ...
3
votes
1answer
546 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 ...
19
votes
6answers
10k views

truffle has not been deployed to detected network

Is it possible to referer to a contract that has been deployed with Contract.new() with Contract.deployed() ? When referencing .deployed() in my test it throws : has not been deployed to detected ...
1
vote
1answer
348 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 ...
9
votes
2answers
13k views

How do Enums work?

I am just starting out with Solidity and JavaScript and am trying to understand Enums. I have a simple contract pragma solidity ^0.4.4; contract SimpleEnum { enum SomeData {Channel} SomeData ...
0
votes
1answer
247 views

Oraclize : Ethereum-bridge on my local private chain

I can work with oraclize only using a private chain created with testrpc. If I try to use the ethereum-bridge over my locally created private chain it doesn't answer, nether I get message in the ...
0
votes
0answers
19 views

Can't Connect Metamask to Ballot Dapp?

I want to connect Ballot Dapp to Metamask but it Shows "rpc error with payload" and "ALERT: Trying to call a function on a non-contract address".