[Ethereum] What are providers in the Ethereum

web3-providers

The below given code is from the a tutorial given here at one of the tutorials on Truffle

// Set the provider for our contract
App.contracts.Adoption.setProvider(App.web3Provider);

I see we set up a Web3 provider for the contract.

What basically are providers? What do they do?

Best Answer

web3 is a client to connect to the blockchain. But

1- you need to tell web3 which blockchain you are connecting to.

2- After you are connected to the specified blockchain, you need to send messages or data to the web3

those 2 tasks are done by a provider.

Related Topic