6

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?

5

https://api.myetherapi.com/eth is a provider. Web3 provider is a website running geth or parity node which talks to Ethereum network.

1
  • Link is broken... – whamsicore May 19 at 22:37
3

A provider links to a running node. For instance parity or geth.

A node has the ability to view and interact with the blockchain.

-1

Initial guess is that this is a web3.js Strategy Pattern to allow an underlying protocol e.g. https to provide access to a node. I will confirm later.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.