Created
February 4, 2022 21:06
-
-
Save cristian495/1849d012e4df8a5d98347739e771682c to your computer and use it in GitHub Desktop.
creates a new ethereum address using Web3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethNodeURL = `http://127.0.0.1:3334`; | |
const web3 = new Web3(new Web3.providers.HttpProvider(ethNodeURL)); | |
const password = "superhypermegastrongpassword" | |
const newWallet = await web3.eth.personal.newAccount(password); | |
// result example: 0x1234567891011121314151617181920212223456 | |
/* | |
there's another way to create ethereum addresses, | |
refer to the next link to find more information about it: | |
https://medium.com/@andthentherewere0/should-i-use-web3-eth-accounts-or-web3-eth-personal-for-account-creation-15eded74d0eb | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment