2

Starting out with blockchain development and I'm coming across many sources/courses that recommend the Truffle/Contract class for interacting with deployed contracts because of "ease of use". But Web3^1.0.0 seems straightforward and easy to work with (PromiEvents enable async/await, etc).

Any reason not to use Web3 1.0.0-beta for simple contracts? And if not, is the Truffle Contract class still relevant in 2019? Hope this isn't too open-ended of a question...

2 Answers 2

3

I recommend using Truffle contracts when testing inside the truffle suite as it is readily available and you won't have to load ABIs and stuff manually.

When working outside the truffle project, I recommend using web3 directly as I don't see any advantage of using truffle-contract outside a truffle project.

1
  • Yes, great. Seems like we're on the same page here. :D Commented Feb 22, 2019 at 19:03
2

Look into ethers.js: https://docs.ethers.io/ethers.js/html/

The ethers.js library aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem. It was originally designed for use with ethers.io and has since expanded into a much more general-purpose library.

Quite a few people recommend ethers > web3

1
  • 1
    oh, I didn't know about this! I think I'd still prefer to limit my 3rd party dependencies, but I'm definitely going to try this out. Thanks! Commented Feb 22, 2019 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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