Questions tagged [truffle]

Questions regarding the implementation and use of the Truffle development and testing environment.

8
votes
1answer
556 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' ...
25
votes
3answers
9k views

What are truffle migrations?

As written in Truffle docs: Migrations are Javascript files that help you deploy contracts to the Ethereum network. These files are responsible for staging your deployment tasks, and they're ...
0
votes
2answers
1k views

truffle and metacoin. How can I send a transaction?

I am trying to learn truffle, and I have compiled, migrated, and test the example contract. I load the example Dapp in my browser from local host, and I have the lists of addresses created by testRPC,...
8
votes
1answer
1k views

sendTransaction results in double send with arbitrary library call

I have a situation I have isolated that seems very bizarre to me and I cannot figure out. I am running truffle v1.0.2 (not latest) and testrpc v2.0.5. When I send ETH from an account to a contract ...
2
votes
0answers
108 views

Minimal contract testing setup using truffle

This question is a follow up onto this one. I have tried following the suggestion in the answer of adding a done() method that fires when an error occurs (an exception is raised) but it doesn't when I ...
2
votes
1answer
4k views

Testing contracts with truffle

I'm trying to write tests for contracts using truffle; I have opened an issue here. The workflow is as follows: mkdir truffle_testing truffle init rm -r tests/* contracts/* build/* Next, I create ...
1
vote
1answer
359 views

Setting up a truffle project

I'm reading truffles's docs and am trying to build a custom project with a contract and a few test cases (written in a js file). I need to do this because testrpc is (considerably) faster than geth. ...
4
votes
0answers
418 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":{"...
2
votes
1answer
23 views

Issue with using “this” statement to get current value

I am trying to get the current value for my int variable counterforindex in the check function. However this doesn't seem to happen. uint public counterforindex; function Check(string hdata, string ...
2
votes
1answer
664 views

How to configure a default parameter for a deployed contract in truffle?

This is a follow-up question to How can I use deployed with a constructor argument For testing purposes with mocha, I would like to configure my default deployed contract so that it is instantiated ...
3
votes
2answers
859 views

Contract deployment workflow with truffle/ether-pudding

I've managed to deploy a contract on geth by unlocking the account of the node. (How this would work in production I have no idea, as I think it would pose a security risk) Now I connect with my ...
4
votes
3answers
1k views

Deploying contracts on geth returns Error: connect ECONNREFUSED 127.0.0.1:8545

I'm using truffle (which uses pudding) to deploy contracts to my testrpc. No I'm running a geth instance locally with: geth --mine -rpccorsdomain "*" --ipcapi "admin,eth,miner" --rpcapi "eth,...
9
votes
1answer
2k views

Custom balance accounts testrpc?

I am setting up unit tests with for my contracts using truffle. I am using also testrpc, but having accounts with 2.123...... *10^37 Wei is not very helpful to visualise and debug things. I am trying ...
5
votes
1answer
3k views

What is the difference between Truffle and Remix?

Please list the differences between Truffle and Remix. Where is the use of both applicable? Can somebody list this using an example?
4
votes
2answers
441 views

How to connect two truffle instances?

How can we connect two truffle applications with each other? E.g., if we have two metacoin applications, how can these two communicate with each other?
2
votes
1answer
140 views

.new() does not work in jQuery click handler

I am using truffle as my Dapp development platform together with testrpc. When I attempt to create a new instance of the my contract using the .new() method, I am having an issue with printing out the ...
1
vote
2answers
735 views

Truffle WebPack problem

I'm trying to use webpack in a truffle project. I follow this guide https://github.com/ConsenSys/truffle/wiki/Using-Truffle-and-Webpack-(beta). At point 8 in my app.js I add this line: var TestRPC =...
2
votes
1answer
504 views

Use Hooked-Web3-Provider and Lightwallet on android app?

I'm trying to make a demo app where I can make an account through the app and store the private key. and simply send a signed transaction and from the app to a hosted blockchain on my computer any ...
5
votes
3answers
4k views

Build an application with Truffle + React + Redux

I'm looking for some examples about how to build a Dapp with Truffle + React + Redux. I'm able to only find this old tutorial https://www.youtube.com/watch?v=GPP6uAq15d8. Does anyone have some other ...
9
votes
2answers
5k views

Manually execute transactions using testrpc and truffle

I started doing a bit of work in the geth console: geth --dev console but have moved to developing using truffle. To debug in the geth console, I'm used to executing the following: eth....
2
votes
0answers
294 views

How to work with MeteorJS in Truffle?

Truffle has not out of the box support for MeteorJS. Does this mean that meteor is not supported by Truffle? How easy is it to bring it together?
2
votes
0answers
100 views

Get truffle contracts Global Method names

Right now you can access each deployed contract method with Truffle because each is exposed globally. But I need a way to enumerate each contract say like: Object.keys(contracts) But since all ...
4
votes
1answer
4k views

Get block address through web3.eth.getBlock(1)

I'm getting a list of the last few blocks like described here. Now I can't seem to get the address of each block or the associated contract, through web3.eth.getBlock. A lot gets returned, but no ...
26
votes
4answers
6k views

Error while compiling: Stack too deep

When trying to compile, I am getting the following error: "Internal compiler error: Stack too deep, try removing local variables." Is there any way around this? I'm not sure if I'll be able to ...
3
votes
0answers
25 views

No event after a struct push in solidity [duplicate]

I am testing a contract with Truffle, which code is : Contribution[] public contributions; struct Contribution { address participantAddress; string name; uint timestamp; uint amount;...
5
votes
3answers
1k views

Does deploying a contract mean it will overwrite the last instance?

I must have missed something about deploying contracts, but to be sure: I'm using Truffle, Does deploying a contract mean it will overwrite the last instance? Since I see that it gets a new address ...
1
vote
1answer
345 views

Storing an address in nested mapping does not work

Why doesn't this work? contract NameRegistry { function NameRegistry() { // names["users"]["stefreak"] = 0x123; } function register(address record, string namespace, string name) returns (...
4
votes
1answer
584 views

How to use IPFS with truffle framework [duplicate]

How to use IPFS to get the hash of the document and store it on private blockchain (using go-ethereum )? consider truffle framework and solidity as contract oriented language.
6
votes
1answer
501 views

Workflow for Dapp Development

There is so much information out there that turns around this point that I decided to make a post, can someone please help out? Does that sound correct as a work-flow for medium/large size projects ?:...
2
votes
2answers
751 views

Can I write API endpoints with Truffle?

Does anybody knows how to write an API inside a Truffle application?
8
votes
2answers
7k views

How do you get the balance of an account using truffle/ether-pudding?

Is there an ether-pudding way to get the balance of a contract/account, or should I just use web3.eth.getBalance(account)?
2
votes
1answer
2k views

How do you send ether using truffle/ether-pudding?

How do you do a sendTransaction to simply send ether from one account to another in ether-pudding? In web3 I would do this: web3.eth.sendTransaction({ from: a, to: b, value: 100 }) I would like the ...
2
votes
1answer
348 views

Dapp Communication using smart contract written in solidity in truffle framework [duplicate]

How will two Dapps, developed using truffle framework, will communicate with the contract deployed by one Dapp ( Consider testnet using geth)?
1
vote
0answers
191 views

Truffle Dapp Development [closed]

Is there anybody who has developed the Dapp using truffle framework and ethereum testnet ? I am getting some alien errors and i am not getting the solution on internet.So i need a person who has done ...
5
votes
0answers
164 views

Dapp Development using Truffle framework getting error

I am using truffle framework, which has pudding functionality. I have compiled the same contract on the both Dapps and deployed it on the one Dapp. Now i am trying to access it from another Dapp using ...
4
votes
1answer
958 views

Truffle Dapp Deployed Contract Access

Which function we need to use in truffle for the communication of second Dapp to the contract deployed on blockchain by first Dapp, because contract deployed by truffle is not accessible by geth node. ...
3
votes
1answer
379 views

Did anyone succeed in using Truffle with Node v6?

Truffle looks to be buggy when using with Node v6 (installed from homebrew). There's a ticket on Truffle github, but none seems to take it into account. Are people not using Node v6 or is there a ...
3
votes
1answer
276 views

Truffle Dapp Communication

In truffle, a dapp is deployed using the port of running geth node (in testnet). Then how will another machine node will communicate to that dapp because it is impossible to run a node on same port ...
4
votes
3answers
918 views

Iterating through an array in JS and simple promises (web3/pudding)

This might be more to do with my lack of understanding some JS basics however it's in ethereum/web3 context so here it goes. I have a public array posts in my contract and a global variable in JS of ...
4
votes
1answer
512 views

How do you provide a GasPrice and GasLimit to overcome the “low tx nonce or out of funds” log message

I am getting the following logged by my private chain geth node when running a test in truffle: removed tx ( TX(ff8ec4f713e64fb25df07d153607e29629c9276b57e0b7e331f17b5a3c31fdd1) Contract: ...
2
votes
1answer
308 views

Is it possible to change the coinbase dynamically?

I'm testing the following contract using Truffle framework and deploying on TestRPC network. contract MetaCoin { mapping (address => uint) balances; function MetaCoin() { balances[tx....
6
votes
1answer
2k views

How do I manage unlocking accounts in a test in Truffle

I have a test that exercises a contract function across different accounts. How do I unlock these accounts in the context of the test? contract('MyContract', function (accounts) { it("should ...
4
votes
2answers
1k views

truffle deploy to geth failing, generating “receipt not found” repeatedly from geth

I've just installed truffle on an ubuntu virtualbox, and it is failing to deploy to a geth dev setup. Geth gives me a never-ending receipt not found for transaction ...
8
votes
1answer
4k views

How to pass arbitrary bytes to a function (2016)

I'm trying to implement a contract which will store bytes blob, a dynamic bytes array. For example I have following struct: Sign { address signer; bytes16 signType; bytes sign; } plus ...
6
votes
1answer
591 views

Event.watch gets fired infinitely many times

I am trying out truffle + web3 + ethereumjs-testrpc. In the app I have the following code: window.onload = function() { var meta = MetaCoin.deployed(); var event = meta.Transfer({}, {fromBlock: 0,...
3
votes
1answer
907 views

How to get the running instance of a Contract

I have a contract with name AuxContract and imported it in my Dapp.sol. In my Dapp.sol I have a variable of type AuxContractwhich I want to initialize with a running instance of an ...
3
votes
1answer
142 views

Migration between frameworks

How much effort would it be to migrate a Dapp written in embark to truffle or vice-versa? Which parts of the code can be preseved (would work in both frameworks)?
9
votes
1answer
646 views

Truffle framework with storage

How can I integrate truffle with swarm or ipfs for permanent document storage? Are there any libraries?
6
votes
1answer
839 views

Not enough components (4) in value to assign all variables (6)

This is an exception on compilation I am getting with truffle. The code I am running builds a store from a container contract and then makes a call to get a product from it. Store s = Store(saddress)...
18
votes
1answer
4k views

What is truffle?

What is the truffle framework? Who can use it, who should use it? And what are the benefits?