GithubHelp home page GithubHelp logo

Comments (3)

miglaros avatar miglaros commented on July 17, 2024 1

Truffle 2.0 uses a different folder structure. The config directory has been replaced with a migrations directory. To get this project to deploy:

  1. mkdir conference
  2. cd conference
  3. Run truffle init
  4. cd contracts. If you do an ls, you will notice three Solidity files (ConvertLib.sol, MetaCoin.sol and Migrations.sol) I deleted ConvertLib.sol and MetaCoin.sol. You need Migrations.sol. Do not edit this contract. Create a new file and dopy the conference.sol contract from this repository into this file and save as Conference.sol.
  5. cd ../migrations and do an ls. You should see two files (1_initial_migration.js and 2_deploy_contracts.js) These are crucial to deploying the truffle dapp. They need to be numbered in sequence. The 1_initial_migrations file deploys the Migrations contract and the 2_deploy_contracts deploys all your other contracts. 2_deploy_contracts needs to be edited so that it knows about your Conference contract. Edit this file - here's how mine looks:
    module.exports = function(deployer) {
    deployer.deploy(Conference);
    };
  6. truffle compile
  7. truffle migrate
  8. truffle build
    and everything should deploy without errors.

Where I am current stuck is when I run truffle test, I get
Contract: Conference
1) Initial conference settings should match
> No events were emitted
2) Should update quota
> No events were emitted
3) Should let you buy a ticket
> No events were emitted
4) Should issue a refund by owner only
> No events were emitted

0 passing (1s)
4 failing

  1. Contract: Conference Initial conference settings should match:
    Error: Invalid address passed to Conference.at(): undefined
    at Function.Contract.at (/tmp/test-11675-13276-1a2cod1.r1ucakmx6r/Conference.sol.js:275:13)
    at Context. (test/conference.js:7:24)

  2. Contract: Conference Should update quota:
    Error: Invalid address passed to Conference.at(): undefined
    at Function.Contract.at (/tmp/test-11675-13276-1a2cod1.r1ucakmx6r/Conference.sol.js:275:13)
    at Context. (test/conference.js:25:24)

  3. Contract: Conference Should let you buy a ticket:
    Error: Invalid address passed to Conference.at(): undefined
    at Function.Contract.at (/tmp/test-11675-13276-1a2cod1.r1ucakmx6r/Conference.sol.js:275:13)
    at Context. (test/conference.js:42:24)

  4. Contract: Conference Should issue a refund by owner only:
    Error: Invalid address passed to Conference.at(): undefined
    at Function.Contract.at (/tmp/test-11675-13276-1a2cod1.r1ucakmx6r/Conference.sol.js:275:13)
    at Context. (test/conference.js:68:24)

from conference.

manindra23 avatar manindra23 commented on July 17, 2024

I did exactly as said in the above comments and it worked fine till step - 6(truffle compile) but when i run truffle migrate, I get the error:

test@test-ubuntu:~/Blockchain/Ethereum/conference$ truffle migrate
Running migration: 1_initial_migration.js
  Deploying Migrations...
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Server error
    at Object.module.exports.InvalidResponse (/usr/local/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/web3/lib/web3/errors.js:35:16)
    at /usr/local/lib/node_modules/truffle/node_modules/ether-pudding/node_modules/web3/lib/web3/requestmanager.js:86:36
    at [object Object].request.onreadystatechange (/usr/local/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:114:13)
    at [object Object].dispatchEvent (/usr/local/lib/node_modules/truffle/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
    at setState (/usr/local/lib/node_modules/truffle/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/truffle/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:447:13)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:905:12)
    at nextTickCallbackWith2Args (node.js:441:9)
    at process._tickDomainCallback (node.js:396:17)

testrpc is up and running, and I see following two lines when I run truffle migrate:

127.0.0.1 - - [2016-10-21 09:38:17] "POST / HTTP/1.1" 200 718 0.001741
127.0.0.1 - - [2016-10-21 09:38:17] "POST / HTTP/1.1" 200 493 0.042596

Am I missing anything in the configuration?
Source Code is at https://github.com/manindra23/conference-contract/tree/develop

from conference.

teogenesmoura avatar teogenesmoura commented on July 17, 2024

@miglaros as for the first test, I think this reference might be useful:
trufflesuite/truffle#276

from conference.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.