Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetAccounts (Capstone Project Pt. 2-UI Setup) #28

Open
RaynHarr opened this issue Dec 28, 2019 · 0 comments
Open

GetAccounts (Capstone Project Pt. 2-UI Setup) #28

RaynHarr opened this issue Dec 28, 2019 · 0 comments

Comments

@RaynHarr
Copy link

Hi Hoping to get some eyes on this. Trying to get through the Capstone project and for some reason my array of accounts is coming up blank [] in the console:

import React, { Component } from 'react';
import './App.css';
import Web3 from 'web3'

class App extends Component {
    componentWillMount() {
      this.loadBlockchainData()
    }

    async loadBlockchainData() {
      const web3 = new Web3(Web3.givenProvider || 'http://localhost:7545')
      const network = await web3.eth.net.getNetworkType()
      const accounts = await web3.eth.getAccounts()
      console.log('accounts', accounts)
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant