Web3 Tutorial Project | Build a web3js dApp for a smart contract

Поделиться
HTML-код
  • Опубликовано: 31 дек 2024

Комментарии • 104

  • @MrDuff158
    @MrDuff158 2 года назад +19

    This video is a rare gem hidden in the depths of the yt algorithm.. I wish I had found it sooner. Great video, very helpful. Way more helpful than a lot of stuff hidden behind a paywall. Thank you for your time!

    • @comosaycomosah
      @comosaycomosah 2 года назад

      Just started it and this comment is lit hope it's good as it seems it will be shall report back lol

    • @cryptotoken768
      @cryptotoken768 Год назад

      what do u mean ?

    • @rvbvbaservices
      @rvbvbaservices 6 месяцев назад

      Same thinking here! Great in dept video

  • @saurabhjaswal21
    @saurabhjaswal21 2 года назад +8

    It really helps me alot, i have lot of confusion regarding the integration but this video solved all my doubts. Thanks man and great work. Keep doing 👏👏

  • @shivangsaini3940
    @shivangsaini3940 2 года назад +1

    Really, this is Best tutorial i ever seen on RUclips.

  • @ayencoscolfield3312
    @ayencoscolfield3312 7 месяцев назад

    fantastic am new to blockchain and have seen lots of videos that was so confusing but this my friend killed it for me awesome stuff and it's so clear, thanks so much for your time and may God bless you👍

  • @PhillipWilliams
    @PhillipWilliams 2 года назад +3

    Fantastic video, thank you. To get the fund as the owner, I would have a withdrawal function. I would set it to have an optional _amount to allow the owner to take a portion of the fund (as passed via the _amount parameter) or all the funds by default.

  • @gokuljagannath2481
    @gokuljagannath2481 2 года назад +2

    Great tutorial, Thank you.
    And the reason the purchase count was not increasing is because you were doing post increment(++). It can be solved by doing setPurchases(purchases+1) instead of setPurchases(purchases++).
    Anyway thanks a lot for the tutorial, learnt a lot.😀

    • @cryptotoken768
      @cryptotoken768 Год назад

      No bro, if you do in your way it will end up with assign value the to a constant error. This is the workaround `
      useEffect(() => {
      if (vmContract) getInventoryHandler();
      if (vmContract && address) getMyDonutCountHndler();
      }, [vmContract, address, purchases])
      const buyDonutsHandler = async () => {
      try {
      await vmContract.methods.purchase(buyCount).send({
      from: address,
      value: web3.utils.toWei('2', 'ether') * buyCount
      });
      let _purchases = purchases + 1;
      setPurchases(_purchases);
      setSuccessMessage(`${buyCount} donuts purchased!`);
      } catch (error) {
      setError(error.message);
      }
      }`

  • @khan_dev
    @khan_dev 2 года назад +2

    awesome, thanks, it worked here on my side too, yeee! The only thing I changed I cleared the dependency array for useEffect and values updated after purchasing.

  • @david-patton
    @david-patton 2 года назад

    So in my contract I keep getting stack too deep. Im not sure where its too deep at.

  • @LOVEFACT360
    @LOVEFACT360 2 года назад +4

    Hello boss, I finally fixed the error. I love your channel so much. It is filled with so much knowledge and I look forward to following all the tutorials here to become a blockchain expert like you. Please I will need tips on how to send the ethers to my metamask account as the owner of the vending machine. Your reply will be greatly appreciated, thanks in advance

  • @sukiratwarring6219
    @sukiratwarring6219 2 года назад +1

    what a video!!...thanks for the information!!!waiting for much more tutorials....and pls don't stop!

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад

      thanks Sukirat!

    • @sukiratwarring6219
      @sukiratwarring6219 2 года назад

      @@BlockExplorerMedia when is the new video coming out…gassed up for it..lacking patience!!😁😁

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад +1

      hey Sukirat, I am doing a bit of traveling and taking a little time off so it might be another week or so. thanks for the support my friend!

    • @sukiratwarring6219
      @sukiratwarring6219 2 года назад

      @@BlockExplorerMedia ohk no worries!!

  • @Wespam25
    @Wespam25 7 месяцев назад

    Amazing stuff. But i have an issue im trying to code along with you but when i create a next app i dont ger the pages folder

  • @yassinehzami1670
    @yassinehzami1670 2 года назад

    What a great video, helps A LOT in the beginning.

  • @Fep_Aguilar
    @Fep_Aguilar 2 года назад

    loved this video! Kudos for the old school alert btw! :D kudos

  • @arghavan9325
    @arghavan9325 2 года назад

    In 46:30 how can we add a central database to this architecture? For example, to send email to the wallet owners when their favorite donut is restocked?

  • @codewithxohii4987
    @codewithxohii4987 Год назад

    hi mentor appreciate your way of simplfying the huge complex stuff to an easy way. i had a tiny problem when we creating the getinventoryhandler and the setting the value inside the state i am not getting my vlaue on the page while in the console its showing 100n any possible soultion ?

  • @johanwahab
    @johanwahab 2 года назад

    Hello, I have followed your video tutorial smoothly. But at 39:30 minutes I can't find the ENDPOINTS : Rinkeby option.
    Is there any other solution?
    Thank you.

  • @KidannyBM
    @KidannyBM Год назад

    Amazing video bro! Great job! On explaining everything!

  • @VinaySharma-ed6fy
    @VinaySharma-ed6fy Год назад

    From where did you restocked the wallet to get more ethers?

  • @jo-mengo9756
    @jo-mengo9756 2 года назад

    new update, when you deploy the contract on rinkeby the HDWalletprovider format is not the same anymore as shown on the video that is why it may not deploy, follow the commented part in the file exactly to deploy the contract

  • @RossPfeiffer
    @RossPfeiffer 2 года назад

    great tutorial.
    solid tech stack. feels good to have my powers back

  • @C00K1E-dev
    @C00K1E-dev 2 года назад +1

    This video is great! However Rinkeby is deprecated... I have used instead of rinkeby the goerli network and changed the chain id also but when i use truffle migrate i get like 5 errors including some npm_modules not working ... any fix for that?

  • @vicentemunoz9157
    @vicentemunoz9157 Год назад +1

    Awesome tutorial !! Thank you!
    Is there a github repo ??

  • @manojnavinjamuri5867
    @manojnavinjamuri5867 2 года назад +1

    I am unable to run the rinkeby command

  • @BobRobinson
    @BobRobinson 2 года назад +1

    I'm having trouble with the truffle install if I copy your files for vending-machine file direct into my folder would that work or is there another solution ty very much I'd be lost without your video

  • @triviapartypatel845
    @triviapartypatel845 2 года назад

    Very nice tutorial.... Need more tutorial.....

  • @hristohristov4047
    @hristohristov4047 Год назад

    How did you resolve this - "
    Property 'ethereum' does not exist on type 'Window & typeof globalThis'."?

  • @Baddack8
    @Baddack8 2 года назад

    Great video, this helped me a lot. When I try to do a write to the blockchain, I get estimated gas can't be determined. I think because I need to do a APPROVE first? How were you able to write without approving the dapp to use your funds first?

  • @syedowaisahmed4347
    @syedowaisahmed4347 2 года назад +1

    can u share github link if u have uploaded it there?

  • @sinakheiri
    @sinakheiri 9 месяцев назад

    I was following along until i realized rinkeby is not available anymore and truffle is basically deprecated and not maintained anymore. this was a bummer
    good info anyway

  • @Lerxsty2112
    @Lerxsty2112 6 месяцев назад

    I would love to follow the vid but I keep getting errors at "npx create-next-app vending-machine-app". Node JS is installed (and rebooted). Created a PROJECTS\vending-machine-dapp folder and ran OPEN GIT BASH HERE from inside the folder just like the vid shows. 7 npm errors stating various things like "no such file or directory". I don't know what else to do besides just try to code everything in VS Code but then I wouldn't have the other dependencies installed. Anyone?

  • @RobertCraig12
    @RobertCraig12 2 года назад

    I am using the rospten test network via infura and get this error whenever I try to send a transaction using the contract.
    Error: Returned error: The method eth_sendTransaction does not exist/is not available
    Is it only rinkby that allows the eth_sendTransaction method on infura or do I need to do something else. I note that this video was made in Jan 2022 so I am unsure if there has been a change at infura since?

  • @ronaldsena9078
    @ronaldsena9078 2 года назад

    I would be grateful for a video explaining INFURA and why export METAMASK private key

  • @lequent1682
    @lequent1682 2 года назад +2

    Hello, thank you for your video ! Great inspiration !
    I've got an issue to call the get method. In my javascript page I have created the {inventory} variable but nothing is displayed on the front page. ABI / ADDRESS and URL Infenora are well created and configured.
    Even If I download your github project (by changing address and url) , I've got nothing ... :/

    • @codewithxohii4987
      @codewithxohii4987 Год назад

      same here did u got any solution for this inventory variable issue ?

    • @lequent1682
      @lequent1682 Год назад

      @@codewithxohii4987 No really sorry, I abandoned the project ahaha

    • @HenKPvP
      @HenKPvP Год назад

      @@codewithxohii4987 @lequent1682 any solution guys?

    • @HenKPvP
      @HenKPvP Год назад

      hey buddy did you got how to fix this issue?

  • @ykd3529
    @ykd3529 2 года назад

    When I tried "truffle migrate --network rinkeby" I get the following error:
    "Error: PollingBlockTracker - encountered an error while attempting to update latest block:"
    I did some searching and even after changing https to wss, I get a different error:
    "Error: Unexpected server response: 404"

  • @seydayoncac294
    @seydayoncac294 2 года назад

    thank you so much but please help, I can't install truffle on my computer.

  • @TheThaiLife
    @TheThaiLife 2 года назад

    Really well done! Thank you.

  • @AdamRubiks
    @AdamRubiks 2 года назад

    Thanks man loved it!!

  • @syedmuhammaddanish8511
    @syedmuhammaddanish8511 2 года назад

    Bruh... Amazing. Loved it

  • @jasonriggs1227
    @jasonriggs1227 2 года назад

    Great video! but how do you do a restock button?

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад

      Thanks! The smart contract has a 'restock' method that is callable by the owner, so you could create a button with a click handler that calls it. Something like this:
      const restockHandler = async () => {
      const amount = 100;
      try {
      await vmContract.methods.restock(amount).send({
      from: address,
      })
      } catch(err) {
      setError(err.message)
      }
      }
      Or make the amount dynamic and pass in from a user input. Hope this helps.

    • @jasonriggs1227
      @jasonriggs1227 2 года назад

      @@BlockExplorerMedia Thanks so much for the response! I added the restock button and made it able to have user input. this is an amazing tutorial Thank You!

  • @maharajanp1320
    @maharajanp1320 2 года назад +1

    can u pls share the github code url

  • @Dre-man100
    @Dre-man100 11 месяцев назад

    Great vid fam!

  • @namanmanjkhola3419
    @namanmanjkhola3419 2 года назад

    Hey! anyone knows when we purchase a donut where is the spend amount going?

  • @malikforz9490
    @malikforz9490 2 года назад

    thanks for the video but can you please zoom more ? I couldnt code because that

  • @ИгорьКрысов-р8ь
    @ИгорьКрысов-р8ь 2 года назад

    Thank you very much. It's great job!

  • @whatsgoingon4078
    @whatsgoingon4078 2 года назад

    You lost me at... 2:36 Git Bash Here . How is this achieved ?

  • @souravmajumder4630
    @souravmajumder4630 2 года назад +1

    If you provide the source code, it would be great for us.

  • @Techcetera377
    @Techcetera377 2 года назад

    ITS REALLY WORKED LOL THANK YOU DUDE

  • @DavidBarlow-v1i
    @DavidBarlow-v1i 3 месяца назад

    Good stuff

  • @Ro_builds
    @Ro_builds 2 года назад

    could I create this without nextjs and just use vanilla javascript?

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад +1

      Yes, you could even just use a single HTML file. The frontend framework (or lack of) is not important. I just usually use React or Next because it helps me quickly stand a simple site up.

  • @mileycrypto
    @mileycrypto 2 года назад +1

    Any github link?

  • @holiday-smith
    @holiday-smith 2 года назад

    for whatever reason I wasn't able to get the .env variables working for me, but I was able to proceed by just putting them in there directly (this is only for testing and private use)

    • @cody_code
      @cody_code 2 года назад

      Seems like I'm having the same issue, I'll have to try that

    • @cody_code
      @cody_code 2 года назад +1

      I think I may have had the same issue, did you omit the quotation marks around the strings in your .env variables?

    • @holiday-smith
      @holiday-smith 2 года назад +1

      @@cody_code I did not try that lol thank you

  • @zakstev786
    @zakstev786 2 года назад

    Excellent

  • @cpetrozza21
    @cpetrozza21 2 года назад

    thank you for this!

  • @LOVEFACT360
    @LOVEFACT360 2 года назад

    Great video, thank you so much for the content. I am having issues deploying my smart contract please can I get your assistance

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад +1

      sure - please let me know what specific errors or problems you're facing.

    • @LOVEFACT360
      @LOVEFACT360 2 года назад

      @@BlockExplorerMedia I am using windows and I cant install truffle on my computer. it is giving me errors

    • @LOVEFACT360
      @LOVEFACT360 2 года назад

      @@BlockExplorerMedia I have fixed the error. Will really appreciate it if you can give me a guide to receive the ethers as the owner in the smart contract. Thank you so much for this precious knowledge you have shared

  • @ivanlagade
    @ivanlagade 2 года назад

    great job!

  • @TheCosmicThrust
    @TheCosmicThrust 2 года назад

    ethers.js didn't work for me, but now I know the basics so Im watching this as 2x speed xD

  • @skirianov
    @skirianov 2 года назад

    Bro, really important question...Who's Zhenya? :D

  • @toureibrahiman5435
    @toureibrahiman5435 2 года назад

    so sweet of you

  • @yecai8442
    @yecai8442 2 года назад

    The donuts are really pricey🤣

  • @ioanap3602
    @ioanap3602 2 года назад

    Hello, I have an error with deploying the contract : "Message: insufficient funds for gas * price + value " ; I am connected with an Ganash account with 100ETH. Please help, I am blocked

    • @krokadilly
      @krokadilly 2 года назад

      remove the gas property

    • @paspel6472
      @paspel6472 2 года назад

      @@krokadilly not worked

    • @paspel6472
      @paspel6472 2 года назад

      How you resolve it?

  • @0xccd
    @0xccd 2 года назад

    Love it!!
    new sub

  • @fomodog2698
    @fomodog2698 2 года назад

    Great, thank you!

  • @s-wind2398
    @s-wind2398 2 года назад

    Awesome content, mate! Subscribed! Pleasee add timestamps, to make the video even easier to track...I can help you with stamps if you want. Let me know. Kudos to you!

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад

      Thanks and welcome! You're right I should start adding timestamps. I'll figure out how to do it and implement going fwd. Sure, any help on the existing videos would be awesome!

  • @binhhoang333
    @binhhoang333 2 года назад

    greate job, pls share with me github repo

  • @bhok5228
    @bhok5228 2 года назад

    Thank you very much, but still dont get why no one have created a visual smart contract interface creator

  • @bikechainapp2964
    @bikechainapp2964 2 года назад

    Can we talk, would love to collaborate on you helping us build a web3 dapp :) ?

    • @BlockExplorerMedia
      @BlockExplorerMedia  2 года назад +1

      Thanks BikeChainApp. I'm struggling to find time for side projects these days but if you wanna shoot me an email I'd be glad to take a look!

    • @bikechainapp2964
      @bikechainapp2964 2 года назад

      @@BlockExplorerMedia Will do! Where can I find your email?

    • @bikechainapp2964
      @bikechainapp2964 2 года назад

      @@BlockExplorerMedia email has been sent :)

  • @ronaldsena9078
    @ronaldsena9078 2 года назад

    Excellent content, too bad I'm Brazilian and I don't speak English and RUclips subtitles don't translate your speech, I learned a lot, but without the audio or translation, some steps are hard to understand

  • @originalbinaryhustler3876
    @originalbinaryhustler3876 Год назад

    i install it but my directory does not get pages