How to send transactions with Web3 and NodeJS? (Backend Blockchain Development)

  Рет қаралды 57,313

EatTheBlocks

EatTheBlocks

Күн бұрын

Пікірлер: 87
@bobhammell6308
@bobhammell6308 3 жыл бұрын
Very helpful, thanks for showing all 3 methods
@marinpetrunic7475
@marinpetrunic7475 4 жыл бұрын
You should cover all cases like when infura drops transaction, when transaction is stuck, how to handle nonce on server (multiple servers with same wallet) etc...
@EatTheBlocks
@EatTheBlocks 4 жыл бұрын
Maybe for another video :)
@sujanbarman7092
@sujanbarman7092 3 жыл бұрын
Thank you so much, this is just what I was searching for a personal project of mine.
@Lanciz
@Lanciz 4 жыл бұрын
Hey man, that's a super-useful video, thank you so much! I've got one question: How can you inject Metamask to a code like that shown, considering that you can't use the 'window' function (not having a frontend side)? That's to say, how can I proceed with transaction without directly asking the users for their private key?
@chorko696
@chorko696 4 жыл бұрын
Great work! You really helped me with my networking project.
@EatTheBlocks
@EatTheBlocks 4 жыл бұрын
Great to hear!
@adnantatlis3225
@adnantatlis3225 2 жыл бұрын
make a video about signing message rszv values in etherume
@bbkrz7553
@bbkrz7553 3 жыл бұрын
Well done dude, that was an awesome tutorial. Thanks
@EatTheBlocks
@EatTheBlocks 3 жыл бұрын
No problem!
@franktimestamp
@franktimestamp 2 жыл бұрын
Nice vijeo! What IDE are you using?
@stevegremory3849
@stevegremory3849 4 жыл бұрын
this is quite literally what I needed, now all I need is some help connecting it with react native.....
@EatTheBlocks
@EatTheBlocks 4 жыл бұрын
check out Truffle boxes. These are ready-to-use starter kits for Blockchain projects. They have at least 1 box for React Native I believe.
@stevegremory3849
@stevegremory3849 4 жыл бұрын
thank you for the reply@@EatTheBlocks! I tried that already and It was great and all, But now I'm struck again, this time it's IPFS....I can't get core node modules to work with React Native and goddamnit I've been struck since a month now and my development pace has gone to hell....if anyone can help me, please do...
@joshmatthewtalplacido1644
@joshmatthewtalplacido1644 4 жыл бұрын
@@EatTheBlocks Hello would you make a tutorial on how to connect this backend with react? I can't see a proper way of doing it and the react boxes are using an outdated react. Thanks
@CoRTeKVII
@CoRTeKVII 4 жыл бұрын
@@stevegremory3849 Hi Grem, have you found a solution to make ipfs work on react-native ?
@stevegremory3849
@stevegremory3849 4 жыл бұрын
@@CoRTeKVII Kinda
@block4671
@block4671 3 жыл бұрын
how I get private key in infura ?
@Lanciz
@Lanciz 4 жыл бұрын
Hi, your video is marvelous and it's (almost) saving my life! I've got only one problem: I need to specify a 'msg.value' for my solidity function, but if I add the 'value' parameter as you show (at 10:22), when I send the transaction I always get a 'Transaction has been reverted by the EVM'. Am I missing something? Or maybe that's not where I should pass my 'msg.value'? Hope you can help, thank you so much for your video anyway!!
@Lanciz
@Lanciz 4 жыл бұрын
Never mind, I fixed this. If someone else encounters the same problem, I'll save you hours of debugging: 'tx.estimateGas({from:addres})' underestimates the real gas amount if you have to also make an inner transaction (meaning you have to transfer eth by adding the 'value' parameter.). For that reason, the transaction will be reverted. Just add some gas to that amount, to be sure the transaction will be sucessful.
@janesEDT
@janesEDT 3 жыл бұрын
@@Lanciz are u an exchange developer??
@janesEDT
@janesEDT 3 жыл бұрын
@@Lanciz if u are an exchange developer than i need you help
@SponsoredByINNBC
@SponsoredByINNBC 4 жыл бұрын
You need to explain how to use web3 package with WIX corvid
@jatingajera2085
@jatingajera2085 2 жыл бұрын
in your github repo where is build folder i didn't find that.I am getting contrct.json file error that's why i need it.
@notker88
@notker88 4 жыл бұрын
Hi, do you have a video about your vim setup? What tools for you use for the folder tree?
@EatTheBlocks
@EatTheBlocks 4 жыл бұрын
Here: kzbin.info/www/bejne/aGmqq6KVnbmSiqs I use the nerdTREE
@SuperSarang22
@SuperSarang22 4 жыл бұрын
There is also a method to construct the transaction using ethereumjs-tx. It's definitely a bit more cumbersome than the web3js methods. Ethereumjs-tx was used a lot earlier. Nice Episode!
@EatTheBlocks
@EatTheBlocks 4 жыл бұрын
Yes good call Sarang. I saw some old code snippets with ethereumjs-tx + web3#sendRawTransaction(). I believe sendRawTransaction() is now sendSignedTransaction(). So a bit similar to first method I showed, except harder, yes.
@vladimirdjukic5684
@vladimirdjukic5684 3 жыл бұрын
How to send transaction on Binance Smart Chain testnet and main net?
@joshmatthewtalplacido1644
@joshmatthewtalplacido1644 4 жыл бұрын
Hey Thank you for this! Please do more ethereum tutorials and also can you have a vim tutorial?
@EatTheBlocks
@EatTheBlocks 4 жыл бұрын
Vim: kzbin.info/www/bejne/aGmqq6KVnbmSiqs
@firencsaliaj6751
@firencsaliaj6751 3 жыл бұрын
Goodmorning . Thank for your beatiful video . I want to know if is possible to copy trade a wallet bsc that make around 400 Tx in pancakeswap. Thank you
@richardlarsson2268
@richardlarsson2268 3 жыл бұрын
Great video, thank you for sharing!
@EatTheBlocks
@EatTheBlocks 3 жыл бұрын
Thanks for watching!
@sirstroopwafel
@sirstroopwafel 2 жыл бұрын
Hey can you send the build json file? I already deployed my contract so I just need the json format
@___OmerAJ___
@___OmerAJ___ 3 жыл бұрын
I want to build something like metamask , where I start web3 , infura ?
@JFKTLA
@JFKTLA 2 жыл бұрын
Question if you were doing this with a real ether account, can the private key be discovered using the method?
@ВолодимирБарибін-е8у
@ВолодимирБарибін-е8у 3 жыл бұрын
I get an invalid sender, but data stored in a contract is available for the call. What does it mean?
@TheVideodevice
@TheVideodevice 3 жыл бұрын
How do you specify the amount I the transaction?
@overage6984
@overage6984 4 жыл бұрын
thanks for the awesome tutorial! I have been trying to listen to events in the backend using nodejs and it doesn't seem like the hdwallet supports websocket connections, any idea how I can listen for the events? I have got it to work with your first solution tho
@EatTheBlocks
@EatTheBlocks 4 жыл бұрын
this is tutorial for listening to events with web3: kzbin.info/www/bejne/pYKYqoOBmc-rfLM
@raashidjunaid1841
@raashidjunaid1841 4 жыл бұрын
@@EatTheBlocks thanks! quick question, can we handle requests in parallel with web3?
@raylovemutter
@raylovemutter 3 жыл бұрын
Hi man, about the backEnd security in a aplication express for services Url?
@nicetomeetugaming7024
@nicetomeetugaming7024 2 жыл бұрын
Generate api key and secret for clients.
@kimbo1966
@kimbo1966 2 жыл бұрын
great video! thanks
@EatTheBlocks
@EatTheBlocks 2 жыл бұрын
Glad you liked it!
@EmuelShine
@EmuelShine 2 жыл бұрын
It was so wonderful tutorial video! But I have an error: insufficient funds for gas * price + value. to solve this error, I put 6 ether in my test account and tried again. However I saw the same error again. some said it's all because of the gas price which is absurdly high. Would you give me any tips to solve this issue? Thnx!
@alekzipiales2398
@alekzipiales2398 2 жыл бұрын
thanks, you helped me a lot
@EatTheBlocks
@EatTheBlocks 2 жыл бұрын
Glad I could help!
@rahmaigakusuma9521
@rahmaigakusuma9521 3 жыл бұрын
4:26 what app is that ?
@tomdupont2378
@tomdupont2378 Жыл бұрын
Incredible!
@EatTheBlocks
@EatTheBlocks Жыл бұрын
Thx!
@nehalshrivashtava1169
@nehalshrivashtava1169 3 жыл бұрын
Thank you so much for the video. I am getting this error in my console while using 3rd method ==> {code: -32000, message: "invalid sender"} while other 2 methods are working fine. i unable to get the reason for that
@urtchmanemmanuel8083
@urtchmanemmanuel8083 3 жыл бұрын
How do we display the gas fee to the user before sending the transaction so that the user can decide whether to proceed or not?
@arunrajr12345
@arunrajr12345 3 жыл бұрын
Hi bro, how can we just use contract address?
@kiran-nambiar
@kiran-nambiar 2 жыл бұрын
Thanks for the video. I really need some help. I would really appreciate it if someone can give me some directions here. I'm a software engineer, I'm totally new to blockchain and cryptography. I have some idea about cryptography because I've implemented Authentication mechanisms in APIs and understand that there are a lot of potential applications. Currently, I feel lost learning about blockchain, it was the same when getting started with Web Development (Web 2.0 I think). Now, however, I understand Web Development (APIs, Databases, Cloud, etc) enough to translate any requirement into a working project. I can determine the technologies needed, their connections, sustain them & keep them performant. I didn't have a proper perspective about the Web back then. Now I can think of an idea and implement it from scratch (or at least design the architecture and specify requirements) I feel lost again, with blockchain technology. I've tried to watch and understand the fundamentals of Crytpgraphy and Blockchain. But things have not clicked and I'm patiently exploring more. I would love to hear from you, is there some way I can speed up this process? Maybe your story or methods might work for me, I don't want to miss out on Blockchain I understand it enough to know it's not just hype but really the future (Web 3.0 and all the great features that will come with it) Thoughts / Suggestions?
@joshmatthewtalplacido1644
@joshmatthewtalplacido1644 4 жыл бұрын
Why for some reason I can't deploy the MyContract to the ropsten network? I use the URL given by infura but it seems like only Migrations is the one getting deployed. Please help
@joshmatthewtalplacido1644
@joshmatthewtalplacido1644 4 жыл бұрын
Ah I fixed it I forgot to create a file on Migrations
@Siryetti
@Siryetti 4 жыл бұрын
this error pops up when i run my "truffle migrate --network mainnet --reset" .. any idea on why or how to solve it Error: Expected parameter 'from' not passed to function. at C:\Users\New\AppData\Roaming pm ode_modules\truffle\build\webpack:\packages\expect\index.js:5:1 at Array.forEach () at Object.options (C:\Users\New\AppData\Roaming pm ode_modules\truffle\build\webpack:\packages\expect\index.js:
@EatTheBlocks
@EatTheBlocks 4 жыл бұрын
you need to pass `from` parameter to a function call in the migration script. Look at the code on github, link in description.
@fabulusinvictus2198
@fabulusinvictus2198 4 жыл бұрын
Is insecure put you privatekeys in a javascript. This is only for development process?
@EatTheBlocks
@EatTheBlocks 4 жыл бұрын
yes
@nicetomeetugaming7024
@nicetomeetugaming7024 2 жыл бұрын
Thanks sir!
@EatTheBlocks
@EatTheBlocks 2 жыл бұрын
Most welcome!
@bilalkhann16
@bilalkhann16 3 жыл бұрын
the easier way starts at 14:43
@animyalinfini8869
@animyalinfini8869 3 жыл бұрын
hi plz can you help me my metamask has been hacked i want any method or bot to transfers my token to get an transaction fast for hackrs and thak you so much
@san1368
@san1368 3 жыл бұрын
myContract is abi ?
@rafaeldias2109
@rafaeldias2109 3 жыл бұрын
Can I pay/receive ethereum using this?
@spout37
@spout37 2 жыл бұрын
Merci 😂
@0x666x
@0x666x 3 жыл бұрын
what is truffle ?
@EatTheBlocks
@EatTheBlocks 3 жыл бұрын
A framework for smart contracts. I have a video on it.
@0x666x
@0x666x 3 жыл бұрын
@@EatTheBlocks oh i've applied it
@0x666x
@0x666x 3 жыл бұрын
is some of your file on github was missing ? like "test" and "build" at 200-send-transaction-with-web3-nodejs
@0x666x
@0x666x 3 жыл бұрын
​@@EatTheBlocks i tried to execute your code from github with your private key but it shown like this: $ node script.js D:\200-send-transaction-with-web3-nodejs ode_modules\safe-event-emitter\index.js:74 throw err ^ Error: PollingBlockTracker - encountered an error while attempting to update latest block: Error: Unknown Error: {"jsonrpc":"2.0","id":1,"error":{"code":-32002,"message":"rejected due to project ID settings"}} at Request._callback (D:\200-send-transaction-with-web3-nodejs ode_modules\@trufflesuite\web3-provider-engine\subproviders pc.js:57:23) at Request.self.callback (D:\200-send-transaction-with-web3-nodejs ode_modules equest equest.js:185:22) at Request.emit (node:events:365:28) at Request. (D:\200-send-transaction-with-web3-nodejs ode_modules equest equest.js:1154:10) at Request.emit (node:events:365:28) at IncomingMessage. (D:\200-send-transaction-with-web3-nodejs ode_modules equest equest.js:1076:12) at Object.onceWrapper (node:events:471:28) at IncomingMessage.emit (node:events:377:35) at endReadableNT (node:internal/streams/readable:1312:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) at PollingBlockTracker._performSync (D:\200-send-transaction-with-web3-nodejs ode_modules\eth-block-tracker\src\polling.js :51:24) at processTicksAndRejections (node:internal/process/task_queues:96:5) Emitted 'error' event on Web3ProviderEngine instance at: at safeApply (D:\200-send-transaction-with-web3-nodejs ode_modules\safe-event-emitter\index.js:70:5) at PollingBlockTracker.SafeEventEmitter.emit (D:\200-send-transaction-with-web3-nodejs ode_modules\safe-event-emitter\inde x.js:56:5) at PollingBlockTracker._performSync (D:\200-send-transaction-with-web3-nodejs ode_modules\eth-block-tracker\src\polling.js :53:16) at processTicksAndRejections (node:internal/process/task_queues:96:5)
@t3kil4t3x
@t3kil4t3x 4 жыл бұрын
Are you french?
@EatTheBlocks
@EatTheBlocks 4 жыл бұрын
yep!
@rattle_
@rattle_ 4 жыл бұрын
Web3py + flask
@EatTheBlocks
@EatTheBlocks 4 жыл бұрын
that works too! except I just screwed my python installation when trying to install a tool called "pipx". So... no python for a while for me unfortunately...
@rattle_
@rattle_ 4 жыл бұрын
​@@EatTheBlocks Haha dependency hell
@angry_moose94
@angry_moose94 2 жыл бұрын
lol just shows you how "decentralized blockchain" is not really decentralized.
@MrDillonowns
@MrDillonowns 2 жыл бұрын
I'm confused, what part of this video displays the block chain isn't decentralized?
How To Become A Blockchain Developer In 2023?
18:05
EatTheBlocks
Рет қаралды 172 М.
Solidity & Blockchain Development - Full Tutorial
3:59:34
Tech With Tim
Рет қаралды 28 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Don't Use Ethers.js
18:52
Jarrod Watts
Рет қаралды 10 М.
Node.js: The Documentary | An origin story
1:02:49
Honeypot
Рет қаралды 687 М.
Blockchain 101 - A Visual Demo
17:50
Anders Brownworth
Рет қаралды 2,7 МЛН
Build Your First Blockchain App Using Ethereum Smart Contracts and Solidity
1:31:07
PROOF JavaScript is a Multi-Threaded language
8:21
Beyond Fireship
Рет қаралды 295 М.
Hardhat Tutorial | Smart contract framework (Truffle alternative)
34:08
Master Ethers.js for Blockchain Step-by-Step [Full Course]
1:25:36
Dapp University
Рет қаралды 116 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН