Skip to content

Can't get account on 01 - Hello World #1

@HGyllensvard

Description

@HGyllensvard

Apologies if this is wrong but I tried to execute the and learn using the 01 - Hello World example but I ran into an issue settings the name.

The function

web3.eth.getAccounts(function (error, accounts) {

Never returned any accounts in the callback.

Looking online I found this thread mentioning to use requestAccounts instead.

Now requestAccounts is not available in the project's current web3 version but upon upgrading web3 and changing the function I now get the metamask account and can successfully interact with the contract.

As I am just starting here I don't know if this is the right or safe alternative, hence why I'm opening an issue to inform you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions