Questions tagged [truffle]

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

3
votes
3answers
464 views

Contract inheritance? Need some help to understand certain things

I'm using testrpc, and truffle. I created a simple token as seen in many tutorials which shall be used to buy or enable certain actions when clicking a button on an UI. contract MyToken { mapping ...
2
votes
0answers
643 views

reference a deployed contract in truffle or node.js

I have a previously deployed contract on my PRIVATE-NET which I know its address. Now I am using truffle. How do I reference this contract in truffle console using its address? I looked through web3....
1
vote
1answer
1k views

Setting up private network w Geth, can't unlock account and deploy contracts

I have set up a private network with Geth with the following command: geth --datadir="PathToDatadir" --mine -minerthreads 2 -verbosity 3 -maxpeers 5 --ipcapi "admin,debug,eth,miner,net,personal,shh,...
4
votes
1answer
592 views

Out of gas exception: error when using GUI/JS but not within truffle

I'm trying something with Ethereum and my current testing environment is Truffle. In the smart contract I have a struct with 5 fields (bytes32, bytes32, bytes32, address, bool). If a call a function (...
2
votes
1answer
291 views

Using eth-lightwallet and truffle

I've tested with accounts created and unlocked in geth and my sample app works fine. I'm now going distributed with my accounts and have added eth-lightwallet and HookedWeb3Provider to put the account ...
1
vote
1answer
1k views

How to send Metacoins to other accounts with truffle console and testrpc local blockchain?

Playing around with the default project provided by truffle. I compiled the contracts with truffle compile.Then deployed with truffle migrate and after that switched to the console via truffle console....
1
vote
1answer
205 views

Error : BlockGasLimitReached: <Transaction(45f6)>: 'gaslimit' actual:4712388 target:3141592

I am using testrpc & truffle to build a test local blockchain. I am getting below exception while I run 'truffle test'. I even tried to manually set the gas_limit variable in tester.py to ...
1
vote
1answer
116 views

testrpc throwing error “This has not yet been implemented”

I am using testrpc & truffle to build a test local blockchain. I am getting below exception while I run 'truffle test'. Could you please help me. Thanks, ERROR:jsonrpc.manager:API Exception: {'...
1
vote
2answers
812 views

truffle account lock

I was trying to deploy the default truffle project following this guide: https://steemit.com/ethereum/@brennanhm/ethereum-smart-contract-testing-installing-truffle-and-testrpc I am running the sample ...
3
votes
1answer
232 views

TestRPC - Pythereum - No handlers could be found for logger “jsonrpc.manager”

I am trying to get the standard init tests to work but I am getting the subject error. could you please help me to resolve this. Thanks, TestRPC/0.8.7/linux2/python2.7.12 Available Accounts ...
2
votes
1answer
248 views

In javascript, what does the line var meta = MetaCoin.deployed(); mean and what does it return?

I am following the official Truffle docs to create a Dapp and am reviewing the code. I am repeatedly seeing the line var meta = MetaCoin.deployed(); What is the deployed function? What does it ...
1
vote
0answers
752 views

Web3 sending transaction fails, works in truffle console

Developing an application which relies on a blockchain. Have test chain running with help of testrpc and I'm using truffle to compile and deploy contracts. This way I've created some contracts and ...
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 ...
4
votes
1answer
2k views

Error: VM Exception while executing transaction: out of gas

I'm new to smart contracts, so please be gentle ;) I'm having trouble deploying a contract to testrpc using truffle. $ truffle deploy Error deploying LFC: Error: VM Exception while ...
3
votes
1answer
148 views

Different return value Truffle & online compiler

Using the online solidity compiler startGame() returns false, but using truffle this function returns a long hex string: 0xf697bd4ff4f5574f3cf73cd46a18087a5a0cf1aa1580fd4992ab20f574a808fe function ...
3
votes
1answer
423 views

Problem with `truffle init`

I can't start truffle, this is the Error: truffle init /usr/local/lib/node_modules/truffle/node_modules/ether-pudding/index.js:182 for (var file of files) { ^^ SyntaxError: ...
3
votes
2answers
2k views

Truffle test - Timeout during out-of-the-box metacoin.js test

Been trying to get the standard init tests to work for a couple of hours, but no joy. Would be grateful for any assistance. Steps taken so far truffle init Fine. So far, so good. truffle ...
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,...
3
votes
1answer
616 views

Assigning a 2D byte array and accessing via Web3

So I'm trying to work with two-dimensional byte arrays and am experiencing some results that I don't quite understand. I am using Truffle v2.0.4 for compiling/deploying my contracts with ethereumjs-...
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
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 ...
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
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 ...
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
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 ...
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 ...
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 ?:...
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 ...
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 ...
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. ...
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 ...
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?
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;...
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 (...
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)?
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 ...
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 ...
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 ...
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 ...
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
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)?
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)...