0

I'm new to crypto development and trying to follow a hello world tutorial here: https://github.com/alto-io/hello-crypto

I was able to install and launch truffle, execute the contract migrations, launch the test page and connect it to my Metamask account. The balance on my truffle development network reads 0. According to the tutorial, I should be able to send myself some ETH by doing the following in the truffle console:

 web3.eth.sendTransaction({web3.eth.accounts[0], to:web.eth.accounts[1], value: 10000})

but web3.eth.accounts is not even returning an array, it returns only one object. Any advice on how to send myself some test ETH in this tutorial would be appreciated.

1 Answer 1

0

That tutorial is 3 years old. Ethereum is changing very fast so the packages.

  const accounts = await web3.eth.getAccounts();
  const accountSender = accounts[0];
  const accountReceiver=accounts[1]
5
  • Thx, it made a difference. But opened up a whole bunch of more questions that deserve a separate question.
    – Ya.
    Commented Oct 30, 2022 at 13:36
  • i would recommend you do not follow that tutorial. it is a very old tutorial.
    – Yilmaz
    Commented Oct 30, 2022 at 13:36
  • Thx. I'm not hell-bent on completing this particular tutorial, I will appreciate any newer suggestions.
    – Ya.
    Commented Oct 30, 2022 at 13:46
  • 1
    follow this: youtube.com/… 32 hours. 1 moth task for you. it s beginner friendly
    – Yilmaz
    Commented Oct 30, 2022 at 13:47
  • Good tutorial by Patrick indeed. Thx for this.
    – Ya.
    Commented Dec 21, 2022 at 23:56

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.