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
292 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 ...
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 ...
8
votes
2answers
698 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 ...
2
votes
3answers
2k views

Unable to execute web3.eth.accounts[0]

I'm following along with this short tutorial and ran into a few problems. I'm running testrpc in my console. However, every time I run my index.html I get an error. My index.html file is the following:...
12
votes
2answers
4k views

Truffle migrate fails

I am using testrpc. While running truffle migrate I get the following error: /usr/local/lib/node_modules/truffle/node_modules/truffle-contract/contract.js:671 throw new Error(this....
2
votes
2answers
33 views

How to test chain reorganization with testrpc?

I am working on blockchain synchronization script. I need a way to make reorganization programmatically for testing purposes. Is there such functionality in some testrpc?
0
votes
1answer
28 views

Metamask TestRPC shows 0 Ether while connecting to Ganache- CLI

I've gone through various Q/A(s) of the problem of ganache-cli and metamask not linking but after trying all the solutions, still doesn't work for me. As soon as I type ganache-cli in windows cmd ...
0
votes
1answer
45 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 ...
0
votes
1answer
52 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 ...
3
votes
1answer
863 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, ...
1
vote
1answer
156 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
49 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
55 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 ...
0
votes
1answer
72 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
78 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
3answers
3k views

Metamask not connecting to localhost

I have started an rpc server as follows : geth --datadir ./chaindata --rpc --rpcapi="db,eth,net,web3,personal,web3" It says that an http endpoint is started . But i cant access this endpoint ...
2
votes
2answers
226 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 ...
2
votes
3answers
384 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? ...
12
votes
2answers
14k 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
2answers
356 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 ...
0
votes
1answer
197 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
1k 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
2answers
26 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
141 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 ...
2
votes
1answer
70 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
1answer
100 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
166 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; // --------------------------------------------------------...
7
votes
3answers
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 ...
0
votes
1answer
202 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
8
votes
2answers
316 views

Is there the opposite function for evm_increaseTime?

I'm using the following function in my JS tests (with truffle) to move forward in time to test time dependent functions: const timeTravel = function (time) { return new Promise((resolve, reject) =&...
0
votes
1answer
217 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
234 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. ...
0
votes
1answer
192 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 ...
1
vote
2answers
526 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
2answers
37 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 { ...
4
votes
1answer
171 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
1answer
250 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 ...
0
votes
1answer
324 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
0answers
20 views

Can't install `eth-tester` Python Package

I am trying to install [eth-tester][1] Python Package so that I can use it to load test ethereum in my account by using its get_balance() function. First when i installed this package using; pip ...
1
vote
1answer
404 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 ...
3
votes
1answer
572 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 ...
1
vote
1answer
557 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 ...
0
votes
1answer
300 views

Interacting with the smart contract from Java application (We3j)

I have many questions about the workflow ( sequence ) of interacting with the smart contract from Java application, so I will first explain what I have done and then put my questions, and if something ...
0
votes
1answer
340 views

Truffle testrpc - public variable getter method error

I'm running into a weird issue where I couldn't retrieve the value of a public variable in truffle console. It's a public variable used as a counter to track the number of records added. I spent ...
0
votes
1answer
458 views

Fetching all the accounts from Genache

I'm using Ganache to generate dummy accounts but every time I try to access the list of accounts using web3.eth.accounts or the web3.eth.getAccounts method, I only get access to the first account in ...
0
votes
2answers
1k views

ALERT: [ethjs-rpc] rpc error with payload

I am trying to create transaction local blockchain using ganache on When i confirm the transaction i get the error as "{"id":4818399857527,"jsonrpc":"2.0","params":..", please refer screenshot for ...
0
votes
2answers
75 views

Having trouble figuring out Truffle testing with Javascript

I've started unit testing my contracts with Truffle (using Javascript). I'm fairly new to Truffle and Mocha both, and while I've tried to follow the tutorials, I'm struggling to follow exactly what's ...
0
votes
1answer
492 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
464 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 ...
5
votes
1answer
695 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 ...