Questions tagged [truffle]

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

2922 questions
27
votes
14 answers

Truffle Webpack starts with error: MetaCoin has not been deployed to detected network

I seem to have followed the truffle guide to a T. But when I open my app in a browser for the first time, I'm getting this error in the console: Error: MetaCoin has not been deployed to detected network (network/artifact mismatch) I'm brand new to…
Daniel Patrick
  • 393
  • 1
  • 3
  • 8
19
votes
6 answers

what is a standard .gitignore for truffle?

I'm using the latest Truffle. Very nice, after having to roll my own dev environment in early 2016! But there is no obvious documentation as to what parts of the project need to be checked into Github. For example, I'm unsure if the build directory…
Paul S
  • 4,271
  • 1
  • 22
  • 48
19
votes
4 answers

I want to know how to quit the truffle console?

just like the question!! I always kill the progress by kill the main shell. I want to change this way.
bingyu
  • 441
  • 1
  • 4
  • 6
18
votes
3 answers

How to send ether to a contract in truffle test?

For some reason I cant figure out how to send ether to a contract when testing in truffle. This is my attempt: await myContract.send(10, {from: accounts[0]}); the error message is: Error: VM Exception while processing transaction: revert I get…
mak
  • 193
  • 1
  • 1
  • 4
17
votes
2 answers

How do I control compiler settings with truffle?

I'm using truffle development environment for prototype contract development and I need to change compiler setting (e.g. turn optimization on and off). The documentation for the development environment does not say how to control the compiler…
Paul S
  • 4,271
  • 1
  • 22
  • 48
16
votes
3 answers

Truffle console - How can I get and print the value returned by a contract function?

This is an absolute newbie question. Given this simple Hello World contract: pragma solidity ^0.4.4; contract Greeter { function Greeter() {} function sayHello() returns(string) { return "hello"; } } I deploy it and try to…
codependent
  • 415
  • 1
  • 6
  • 11
12
votes
3 answers

Deploy multiple contracts using truffle

I am very new to developing smart contracts. I have a simple question, do i need to write migration file separately for each contract i deploy from an account using truffle or can i deploy multiple contracts using a single migration file. How to…
K Kolluru
  • 467
  • 7
  • 18
12
votes
4 answers

Running truffle migrate just opens my truffle.js file and does nothing

I am following this tutorial: http://truffleframework.com/tutorials/building-dapps-for-quorum-private-enterprise-blockchains. I am trying to run truffle migrate on my project but it just opens my file in VSCode and nothing seems to happen. Any…
Evan
  • 125
  • 1
  • 5
11
votes
2 answers

How to run a multiline script in truffle console?

I'm following truffle tutorial to interact with a deployed contract and have a naive question. How do I run this block of multiline scripts in truffle(development)> without collapsing it into a single line? var account_one = "0x1234..."; // an…
sinoTrinity
  • 377
  • 2
  • 8
11
votes
4 answers

difference between "deploy" and "new"?

So I'm using truffle and I notice that I seem to be able to deploy a contract's bytecode by calling deployer.deploy(MyContract); But I've also seen people run: myContract = await MyContract.new(); in a unit test without ever calling…
mark
  • 209
  • 1
  • 7
10
votes
9 answers

Error : Could not connect to your Ethereum client with the following parameters:

Im creating my dapp with following below tutorial. http://www.dappuniversity.com/articles/the-ultimate-ethereum-dapp-tutorial however Im facing an error when I run truffle console it shows >truffle console Could not connect to your Ethereum client…
Trey
  • 103
  • 1
  • 1
  • 5
9
votes
1 answer

Truffle gas price and gas limit on demand instead of using fixed amount

I use truffle. When I deploy contracts, sometimes I encounter gas related errors. I always set fixed value of gas price in truffle.js. I want to change it. I think we can use web3.eth.estimateGas and web3.eth.gasPrice before sign and deploy.…
zono
  • 1,473
  • 5
  • 17
  • 30
9
votes
3 answers

truffle migrate fails with: Error encountered, bailing. Network state unknown

Could someone point out what is happening with truffle. "truffle compile" works fine. Please find the below truffle migrate reset output Ubuntu#truffle version Truffle v3.1.2 Ubuntu#truffle migrate --reset Using network 'development'. Running…
sun
  • 545
  • 1
  • 9
  • 19
8
votes
1 answer

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 with a fallback function that calls a library…
Raine Revere
  • 3,600
  • 2
  • 23
  • 34
8
votes
2 answers

Run truffle test without recompile every time?

Is there a way to run truffle test and not recompile the solidity code each time? It takes a lot of time if i just want to play around with the javascript tests... Thanks!
Richard Garfield
  • 1,017
  • 2
  • 10
  • 14
1
2 3
10 11