Hi. I'm still new to web3 development. Help me to understand the next case. I deployed my contract to the test network and I can interact with it via my dapp without any node provider like Infura. But all the tutorials that I watched say that you have to connect Infura or others to be able to interact with the contract. So, the question is how does it happen that my dapp interacts with the contract without infura?

Nov 11, 2023, 3:14 PM
You’re probably using injected web3 like MetaMask wallet
MetaMask will allow you to interact with the blockchain also
Nov 11, 2023, 3:22 PM
yes, you are right, I use web3.js, in this case, if I can interact via Metamask then when will I need Infura and do I need it it at all? Because other users will also have metamask installed
Nov 11, 2023, 3:34 PM
No you don’t strictly need infura
Nov 11, 2023, 3:36 PM
so, am I understanding it correctly? we can use Infura if we want to interact with the contract from the backend, because there is no such thing as metamask on the backend side
Nov 11, 2023, 3:39 PM
Correct. You can also use another rpc (infura, llama, ankr etc) to read from the blockchain for read only functions
For example if your user goes to your dapp you can use one of these rpcs to read from your contract and display information from it
Then when he connects, you can change the provider to a signer so he can interact
Nov 11, 2023, 3:42 PM

© 2024 Draquery.com All rights reserved.