Skip to content

Instantly share code, notes, and snippets.

@bt4R9
Created January 9, 2018 15:46
Show Gist options
  • Save bt4R9/35da0817e00cd2d2ecc82f2aa3229daf to your computer and use it in GitHub Desktop.
Save bt4R9/35da0817e00cd2d2ecc82f2aa3229daf to your computer and use it in GitHub Desktop.
(async () => {
const account = await web3.eth.accounts.create();
console.log('new account', account);
const keystore = account.encrypt(account.privateKey, '123');
console.log('keystore for account', keystore);
const account2 = await web3.eth.accounts.decrypt(keystore, '123');
console.log(account2);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment