Questions tagged [testrpc]

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

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

Why does .deployed() in truffle with testrpc return first address?

I created a simple contract and deployed in with testrpc using truffle migrate. In the contract I have a variable creator = msg.sender; When calling the contract, it shows that the contract is ...
PastAndSalmon's user avatar
0 votes
0 answers
706 views

Add accounts to truffle test environment at run time

I would like to add the keys and unlock some additional addresses at runtime for my truffle tests. Why? I have the need to create address from a seed generated elsewhere in my test so the private ...
Austin Fatheree's user avatar
0 votes
2 answers
174 views

After deployment, interaction with functions not giving desired output using Web3, Truffle

The set of contract-functions give expected behaviour when tested on Remix. But when the same functions are deployed on TestRPC using Truffle & Web3 and accessed using a Web Interface, it doesn't ...
Sharan Rajani's user avatar
1 vote
1 answer
416 views

How to unit test Quorum projects?

I'd like to build unit tests for a Quorum project including the Quorum specific part that is the privateFor attribute in the transactions. Is there a tool like testrpc specific to Quorum ?
Adil's user avatar
  • 396
1 vote
1 answer
688 views

Truffle Tutorial pet-shop with test-rpc adopt button doesn't work

I have followed the tutorial exactly like they showed in their page: http://truffleframework.com/tutorials/pet-shop except the following changes because they use "ganache" (currently bugged and ...
karmel_jd6's user avatar
2 votes
2 answers
1k views

web3.eth.accounts/web3.eth.getAccounts returns only the first account

After initiating testrpc, App.web3Provider = new web3.providers.HttpProvider("http://localhost:8545"); web3 = new Web3(App.web3Provider); it is displaying 10 accounts, but when accessing ...
Magesh's user avatar
  • 121
0 votes
3 answers
2k views

Truffle migrate to ganache-cli (testrpc) hangs on deploying Migrations.sol

I am trying to truffle migrate Metacoin to debug why Tuffle migrate is not working to testRPC/ganache-cli. It gets hung up on deploying for testRPC/ganache but if I do it from truffle develop and not ...
aquamanSam's user avatar
0 votes
1 answer
85 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 ...
goodvibration's user avatar
0 votes
1 answer
768 views

Can't deploy contracts on private network

I ran below command and my testrpc is Listening on localhost:8545 $ testrpc Next, I ran below command to open ethereum wallet using testrpc network $ ethereumwallet --rpc http://localhost:8545 ...
Tahir Yasin's user avatar
0 votes
1 answer
369 views

Testrpc command with mnemonic and account with preloaded ETH value

Im trying to startup my testrpc with the mnemonic "-m" flag while also preloading a specific account with custom ETH amount. This is the command I tried, but no luck. It starts up and preloads the ...
Nicholas Porter's user avatar
1 vote
1 answer
346 views

Different gas cost for same operation?

I'm running a smart contract locally on TestRPC and using MetaMask to interact with it. Repeatedly calling the same function with the same parameters seems to accumulate different gas consumption (...
Adam Szabo's user avatar
14 votes
2 answers
4k views

Truffle's Ganache VS Testrpc

Is there any major difference between Truffle's Ganache and TestRPC? Do they run irrespective of each other as test blockchains, are there any side effects running both at same time? Is the only ...
jamarcus_13's user avatar
3 votes
0 answers
514 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 ...
Satyam Agrawal's user avatar
1 vote
0 answers
422 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:...
João Montenegro's user avatar
6 votes
2 answers
8k views

How to configure Truffle to use the Ganache GUI instead of ganache-cli (TestRPC)?

I'm using Truffle v4.0.1 (core: 4.0.1) with the default configuration (ganache-cli aka TestRPC) on Ubuntu and it works fine, but I'd like to use the Ganache GUI. However, I can't find any ...
celeduc's user avatar
  • 161
0 votes
1 answer
1k views

Error: VM Exception while processing transaction: invalid opcode

I'm testing out the crowdsale contract from https://ethereum.org/crowdsale on a local testrpc and I can't figure out how to send funds to it. As I understand it, the anonymous fallback function ...
Jonas Ellehauge's user avatar
0 votes
1 answer
1k views

How to send several arguments to an solidity function using an array or a dictionary?

Sorry in advance for my english I am French :) I try to create a simple ethereum wallet. The idea is to allow the user to create a contract and to interact with it. I am using meteor, web3 and an ...
jehan-gabriel's user avatar
0 votes
1 answer
615 views

Test complains on 'await is reserved word'

I write test for my contract. By some reason compiler complains on await It is reserved word, but it used properly -- the rest of test functions works well. await is a reserved word (42:2) 40 | ...
Gleichmut's user avatar
  • 472
1 vote
1 answer
311 views

Failed to pass ether from one account to another in truffle with testrpc

I have a sample contract with one function: pragma solidity ^0.4.0; contract Test { function sell(address transferTo) public { transferTo.transfer(1000); } } I use testrpc and ...
Gleichmut's user avatar
  • 472
6 votes
2 answers
1k views

Skipping blocks when using testing with Mocha on Truffle and testrpc?

I have a contract that requires that things only happen at certain block numbers. I was wondering if there was a way to "skip" a set number of blocks?
Victory's user avatar
  • 1,231
-1 votes
2 answers
2k views

How to deploy a contract in web3js?

I tested in testrpc, and already learned how to create and deploy contract by geth commands, but always failed in web3js script. my very simple contract: pragma solidity ^0.4.18; contract Test { ...
Ken's user avatar
  • 1
0 votes
1 answer
97 views

Define variables inside tests for contract

I write a bit more than plain contract on solidity and working on test to it. I faced with issue to put pass variables inside. If I define variable as let I receive compilation error like this: ...
Gleichmut's user avatar
  • 472
5 votes
7 answers
25k views

Web3: How do I get just the first account on testrpc using web3.eth.getAccounts()?

When I run this code in web3 web3.eth.getAccounts().then(e => console.log(e)); The console returns this: [ '0x772f437b0f15e1F205C8BD923b5C8357e9c0c429', '...
potatoguy's user avatar
  • 179
0 votes
1 answer
589 views

Transaction receipt status failing

I have written and deployed my smart contract in Ropsten and all the calls are failing with status failed . Says out of gas but same problem if I passed additional gas argument. I am using web3 ...
Bill Goldberg's user avatar
0 votes
1 answer
505 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 ...
Arun Kumar's user avatar
1 vote
1 answer
3k views

web3js: web3.eth.defaultAccount method?

:) I am new to Ethereum technology. I am studying the web3js JavaScript library from the official documentation and I don't understand the web3.eth.defaultAccount. What is this for? Why I have to use ...
Keryanie's user avatar
  • 125
2 votes
3 answers
1k views

Doesn't have enough funds to send Tx - TestRPC and Metamask

I'm testing and creating a smart contract to send some ether to one account using TestRPC, Truffle and Metamask. I have a page with a button, when i click on the button it fires the event ...
Guilherme Flores's user avatar
0 votes
1 answer
441 views

Balance of the account doesn't change after executing payable method

I have a problem when invoking a payable method. The funds are being transferred to a contract (the balance of the contract changes). However, the balance of the account who is sending a transaction ...
David_Zizu's user avatar
1 vote
1 answer
613 views

Run "truffle test" command with auto set custom balances

I know how to set custom balance accounts on testrpc. It could be like $ testrpc --account="0x627306090abab3a6e1400e9345bc60c78a8bef57,100000000000000000000". But I don't figure out how to do that ...
ggtmtmgg's user avatar
1 vote
1 answer
722 views

Unable to transfer funds in contract

Inside Remix I'm using one address (addr1) to deploy the contract, and another (addr2) to call a function within the contract. The function is a simple transfer function. I'm transferring ...
JorahFriendzone's user avatar
0 votes
0 answers
115 views

Test RPC via Node and repeated contract calls

On the testrpc, I deploy a contract: myContract.new(.... And it works great. I get a transaction hash, a transaction reciept, and a contract created address output in the terminal. But then I ...
thefett's user avatar
  • 3,873
0 votes
2 answers
2k views

web3.eth.accounts is Empty

I'm following the tutorial here: https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-1-40d2d0d807c2 First, I got the error "Error: Invalid JSON RPC response". Then ...
Melih's user avatar
  • 121
0 votes
1 answer
2k views

Trying to run contract function returns error "invalid opcode"

Looks like there are a couple of unanswered threads about this already, though mine is a more simple setup so maybe it will be easier to debug. Running through testrpc I have a deployed contract, it ...
joe's user avatar
  • 269
8 votes
3 answers
1k 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) =&...
pabloruiz55's user avatar
  • 7,696
0 votes
1 answer
306 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://...
JorahFriendzone's user avatar
1 vote
0 answers
295 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 ...
urbanespaceman's user avatar
0 votes
2 answers
302 views

Returning byte[64] from a function works in TestRPC not in Geth

I have a smart contract which is returning a byte[64] array. In testrpc I get the correct array but in Geth I am getting array with all "0x". Here is the smart contract code: pragma solidity ^0.4.18;...
Narayan Prusty's user avatar
2 votes
1 answer
118 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 ...
Noob123's user avatar
  • 21
2 votes
4 answers
3k views

Base fee exceeds gas limit on connecting to local instance of testrpc on Remix IDE

Note: I have already visited the related links which have similar questions posted, but I didn't find any solution which I could use to solve the issue Im facing. Im following this Coursetro tutorial,...
SeaWarrior404's user avatar
2 votes
0 answers
566 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 ...
B.Mr.W.'s user avatar
  • 121
0 votes
1 answer
1k views

Why does a test that passes in Truffle fail when run against testrpc

Using Truffle and testing against both Truffle's own blockchain and against testrpc yields different results. I am trying to test that my deployed contract is setting its owner correctly (owner being ...
Dave Sag's user avatar
  • 879
1 vote
1 answer
522 views

testrpc How do I force development accounts to be unlocked?

Using Truffle and testrpc. I am launching testrpc via testrpc --port 8545 --unlock 0 But when I run truffle migrate I get Running migration: 1_initial_migration.js Deploying Migrations... ... ...
Dave Sag's user avatar
  • 879
0 votes
3 answers
2k views

User Truffle on Testrpc offline

How can I get truffle to compile contracts over my local testrpc setup without an internet connection for test purposes. I do not have the privilege of internet access at home, but I prefer working ...
GSari's user avatar
  • 21
1 vote
0 answers
139 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 ...
Franco Victorio's user avatar
11 votes
3 answers
1k 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 ...
will_durant's user avatar
  • 1,154
0 votes
1 answer
1k views

Problem connecting testrpc to remix [duplicate]

Whenever I try to use a Web3 Provider on Remix it says Not possible to connect to the Web3 provider. Make sure the provider is running and a connection is open (via IPC or RPC). I have testrpc ...
JorahFriendzone's user avatar
6 votes
3 answers
6k views

Unit tests written in Solidity, how to change msg.sender address, msg.value,

I would like to know if it's possible to change the address of the message sender of contract's function call when writing unit tests in solidity. It really should be, I was trying to find out how but ...
Marko Jakovic's user avatar
2 votes
1 answer
395 views

truffle migrate restarts from first migration after restarting testrpc

I’m trying to create sort of private chain on testrpc so i use testrpc -u 0 -d --db /path/to/db to start testrpc each time. The thing is that if I restart testrpc (kill it and start it again) truffle ...
KwahuNashoba's user avatar
0 votes
2 answers
4k views

How to send data to another address on the blockchain?

I have been practicing writing smart contracts using solidity and testrpc. How can I write and test a simple script that will send a message (e.g. "hello world") to another user on the blockchain. All ...
Abhas Arya's user avatar
1 vote
1 answer
654 views

Unable to deploy contract that uses Oraclize using Remix

I was trying to use Oraclize just for testing. I was facing problems deploying a sample contract from quick-start section of oraclize doc. I tried to use both testrpc and private network for ...
Prashant Prabhakar Singh's user avatar

1 2 3
4
5
9