I am learning ethereum and I have setup a private node with geth. And have a simple client written to create account (web3 1.0 beta34) and list. While the account creation is successful, but it does not get listed,
code for account creation
var web3I = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
var accountI = new Accounts(new Web3.providers.HttpProvider("http://localhost:8545"));
var createAccount = async () => {
var {address, privateKey, signTransaction, sign} = await accountI.create();
var password = "password";
var keyStore = accountI.encrypt(privateKey, password);
};
code for account listing
var getAccounts = async () => {
var accounts = await web3I.eth.getAccounts();
console.log("accounts address ", accounts);
};
getAccounts();
Q: Why does the account does not get listed?