Contest Blockchain Feb 23rd

Discussion in 'Other Courses & Certifications' started by Pavithra Santhosh, Feb 24, 2019.

  1. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
    Blockchain
     
    #1
    RUPAYAN BHAKTA and _56600 like this.
  2. AMITH K S

    AMITH K S Member
    Alumni

    Joined:
    Jul 12, 2017
    Messages:
    2
    Likes Received:
    0
    In your "bitcoin controlled supply" from session 2 slide, there are 3 points. my question is regarding the 2nd point.

    The rate of block creation is adjusted every 2016 blocks.
    So is it the speed of transactions to be picked up to create the block, normally when we say the rate of creation, we map it to the time taken.
    or
    Is it the complexity for finding the nuance is adjusted.

    If either of the cases, is it normally decreased or increased?
     
    #2
  3. _45441

    _45441 New Member

    Joined:
    Oct 26, 2018
    Messages:
    1
    Likes Received:
    1
    its related to difficulty. the difficulty will be increased or decreased according to the miners rate of creating blocks. if 2016 blocks creation in the chain took less than 20160 minutes, then the difficulty gets increased, so does the finding nuance difficulty increases, and vice versa. @Pavithra, is it right?
     
    #3
    AMITH K S likes this.
  4. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
    Steps to create Blockchain
     

    Attached Files:

    #4
  5. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
    Blockchain.js
     
    #5
  6. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
    Blockchain.js rename the file extension
     

    Attached Files:

    #6
  7. RUPAYAN BHAKTA

    RUPAYAN BHAKTA New Member

    Joined:
    Feb 9, 2019
    Messages:
    1
    Likes Received:
    0
    Dear Pavitra mam, I had asked for links of best free courses in NODE JS, JAVASCRIPT and SOLIDITY for mastering coding part.
    I request you to send those links as soon as possible. Thank you.
     
    #7
  8. Gagandeep Singh_9

    Joined:
    Jan 30, 2019
    Messages:
    4
    Likes Received:
    0
    Hi pavithra,

    I was following the steps to use truffle for compiling the smart contracts. I am first trying to build the basic smart contract which comes along with truffle.init command but while using truffle.compile command nothing happens. It seems that truffle.compile has a dependency on some other tool which is not properly installed. Can you please suggest me what are the dependencies and pre-requisites for truffle.?
     
    #8
  9. Jyothsna Pachigolla

    Jyothsna Pachigolla New Member

    Joined:
    Jan 30, 2019
    Messages:
    1
    Likes Received:
    0
    Hi Pavithra,

    I remember you talking about Ethereum, giving example of Medical reports. Does the public network tool like ethereum gives such data security? If not which is the best for such multi users with least say 2 organisations in the network, but users play more role in it. Because when doctor gives a report for a particular patient, it has to be visible only to the doctor and patient until unless the Patient goes to the next hospital doctor and the doctor is authorized to view this patients report he should be able to view it .. Can you explain.. thanks
     
    #9
  10. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
    #10
  11. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
    Pls paste the exact error here and also the OS type.
     
    #11
  12. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
  13. Gagandeep Singh_9

    Joined:
    Jan 30, 2019
    Messages:
    4
    Likes Received:
    0
    What was the command to create a new truffle project with UI. index.html and index.js??
     
    #13
  14. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
  15. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
    Geth Install
     

    Attached Files:

    #15
  16. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
  17. _56919

    _56919 New Member

    Joined:
    Jan 22, 2019
    Messages:
    1
    Likes Received:
    0
    Hi Pavithra,

    Good Morning.

    Yesterday when I have tried to work on Truffle in Lab system, I am getting an error. When I give command Truffle compile. I am getting "spawn ENOMEM" error attached the screenshot for your reference. I have raised a ticket in the Help Desk waiting for their reply.

    Can you please check and let us know what could be the possible reason for this error and what is the solution for the same.
     

    Attached Files:

    #17
  18. Gagandeep Singh_9

    Joined:
    Jan 30, 2019
    Messages:
    4
    Likes Received:
    0
    Hi Pavithra,

    When i am running sudo npm run dev. It is returning error.:
    "Cannot find module copy-webpack-plugin"

    My system info:
    ubuntu 64 bit on ubuntu.
    <Truffle Project Path>/app
    Tille truffle migrate --network rinkeby , i am getting success message but for deploying i am getting this error.

    Also can you brief about webpack?
     
    #18
  19. Gagandeep Singh_9

    Joined:
    Jan 30, 2019
    Messages:
    4
    Likes Received:
    0
    Some how installed the above utility: But still unable to understand use of webpack??

    After that got another error:

    ERROR in ./src/index.js
    Module not found:
    Error: Can't resolve 'web3' in '/home/gagan/truffle/app/src'
    @ ./src/index.js 1:0-24 66:19-23 71:19-23 71:28-32
    @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.js


    Some documentation says that webpack needs local directory and some says that global directory. There is a lot of confusion around the usage of webpack. Please spend some 20-25 mins on this
     
    #19
  20. Naufal Basheer

    Naufal Basheer New Member

    Joined:
    Feb 4, 2019
    Messages:
    1
    Likes Received:
    0
    Im facing this issue while migrating this sample contract Hear is the error

    ++++++++++++++++++
    naufal@ubuntu:~/turffle$ truffle migrate

    Compiling your contracts...
    ===========================
    > Everything is up to date, there is nothing to compile.


    Could not connect to your Ethereum client with the following parameters:
    - host > 127.0.0.1
    - port > 7545
    - network_id > 5777
    Please check that your Ethereum client:
    - is running
    - is accepting RPC connections (i.e., "--rpc" option is used in geth)
    - is accessible over the network
    - is properly configured in your Truffle configuration file (truffle-config.js)

    Truffle v5.0.8 (core: 5.0.8)
    ++++++++++++++++++
    Env Setup , Ubuntu 16.4 , Oracle VM , 10 GB Vertual GB (16 Gb on Base OS) , using 10 Mbps connection
    I have some other issues,

    When I try to installing Parity, its keep continuing ' syncing snapshot' (its been 2nd day )
    Geth also had the same issue, so i stoped installation ( this also i tried 2 days).

    how long it will take to install these components
     
    #20
  21. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
    Composer
     

    Attached Files:

    #21
  22. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
    Multichain
     

    Attached Files:

    #22
  23. Shekhar Pawar

    Shekhar Pawar Member

    Joined:
    May 18, 2018
    Messages:
    2
    Likes Received:
    0
    I have created a sol file in truffle visual studio. Its has a constructor.

    pragma solidity ^0.5.0;

    contract MovieRatings
    {
    mapping (bytes32 => uint) public rating;
    bytes32[] public lstMovies;
    constructor(bytes32[] memory lstMovieNames) public
    {
    lstMovies = lstMovieNames;
    }


    Below is my deploy file. 2_deploy_MovieRatings.js

    const MovieRatings = artifacts.require("MovieRatings");

    module.exports = function(deployer) {
    deployer.deploy(MovieRatings);
    };



    It compiles well, but when I am trying to migrate it, it gives below error.



    > Total cost: 0.00569688 ETH


    2_deploy_MovieRatingsContract.js
    ================================

    Deploying 'MovieRatings'
    ------------------------
    Error: *** Deployment Failed ***

    "MovieRatings" -- Invalid number of parameters for "undefined". Got 0 expected 1!.

    at C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-deployer\src\deployment.js:364:1
    at process._tickCallback (internal/process/next_tick.js:68:7)
    Truffle v5.0.8 (core: 5.0.8)
    Node v10.15.3
    PS D:\BlockChainProjects\Truffle_Projs\Movie_Ratings> truffle migrate

    Compiling your contracts...
    ===========================
    > Everything is up to date, there is nothing to compile.


    Starting migrations...
    ======================
    > Network name: 'development'
    > Network id: 5777
    > Block gas limit: 6721975


    2_deploy_MovieRatings.js
    ========================

    Deploying 'MovieRatings'
    ------------------------
    Error: *** Deployment Failed ***

    "MovieRatings" -- Invalid number of parameters for "undefined". Got 0 expected 1!.

    at C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-deployer\src\deployment.js:364:1
    at process._tickCallback (internal/process/next_tick.js:68:7)
    Truffle v5.0.8 (core: 5.0.8)
    Node v10.15.3
    PS D:\BlockChainProjects\Truffle_Projs\Movie_Ratings>
     
    #23
  24. Shekhar Pawar

    Shekhar Pawar Member

    Joined:
    May 18, 2018
    Messages:
    2
    Likes Received:
    0
    I am again going one by one step.

    Compile is successful. Ganache client is open at my windows 10.
    While migrating sol file, I am getting error - Error: Returned values aren't valid, did it run Out of Gas?

    Refer below from TerminalPrompt.


    PS D:\BlockChainProjects\Truffle_Projs\Movie_Ratings> truffle compile

    Compiling your contracts...
    ===========================
    > Compiling .\contracts\MovieRatings.sol

    > compilation warnings encountered:

    /D/BlockChainProjects/Truffle_Projs/Movie_Ratings/contracts/MovieRatings.sol:11:5: Warning: Function state mutability can be restricted to
    view
    function TotalRatingForMovie(bytes32 movieName) public returns(uint)
    ^ (Relevant source part starts here and spans across multiple lines).
    ,/D/BlockChainProjects/Truffle_Projs/Movie_Ratings/contracts/MovieRatings.sol:20:5: Warning: Function state mutability can be restricted to view
    function ValidMovie(bytes32 movieName) public returns (bool)
    ^ (Relevant source part starts here and spans across multiple lines).

    > Artifacts written to D:\BlockChainProjects\Truffle_Projs\Movie_Ratings\build\contracts
    > Compiled successfully using:
    - solc: 0.5.0+commit.1d4f565a.Emscripten.clang

    PS D:\BlockChainProjects\Truffle_Projs\Movie_Ratings> truffle compile --reset

    Compiling your contracts...
    ===========================
    > Everything is up to date, there is nothing to compile.

    PS D:\BlockChainProjects\Truffle_Projs\Movie_Ratings> truffle migrate

    Compiling your contracts...
    ===========================
    > Everything is up to date, there is nothing to compile.

    Error: Returned values aren't valid, did it run Out of Gas?
    at ABICoder.decodeParameters (C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-eth-abi\src\index.js:226:1)
    at Contract._decodeMethodReturn (C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-eth-contract\src\index.js:465:1)
    at Method.outputFormatter (C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-eth-contract\src\index.js:818:1)
    at Method.formatOutput (C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-eth-contract\~\web3-core-method\src\index.js:163:1)
    at sendTxCallback (C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-eth-contract\~\web3-core-method\src\index.js:473:1)
    at C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3-eth-contract\~\web3-core-requestmanager\src\index.js:147:1
    at C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-provider\wrapper.js:112:1
    at XMLHttpRequest.request.onreadystatechange (C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\web3\~\web3-providers-http\src\index.js:96:1)
    at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request-event-target.js:34:1)
    at XMLHttpRequest._setReadyState (C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:208:1)
    at XMLHttpRequest._onHttpResponseEnd (C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:318:1)
    at IncomingMessage.<anonymous> (C:\Users\shekhar.pawar\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\xhr2-cookies\dist\xml-http-request.js:289:47)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1125:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    Truffle v5.0.8 (core: 5.0.8)
    Node v10.15.3
    PS D:\BlockChainProjects\Truffle_Projs\Movie_Ratings>
     
    #24
  25. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
  26. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6

    Based on the network you are running it depends on network speed and disk space it will take some time to sync if it is prod environment.
    Try running using the truffle develop in the local terminal and change the port based on the running port and network id to *
    This will successfully do the deployment.
     
    #26
  27. Pavithra Santhosh

    Customer

    Joined:
    Aug 28, 2018
    Messages:
    38
    Likes Received:
    6
    Movie rating project
     

    Attached Files:

    #27

Share This Page