I am using ganache which creates an ethereum blockchain with 10 accounts.
The blockchain created by ganache is linked with truffle's pet-shop box using web3. I want to add a new account in that blockchain. I used web3.eth.accounts.create()
which returns public and private key of the newly created account.
truffle(development)> web3.eth.accounts.create()
{ address: '0x53811349479671B8230BD853184AFf1e589f5A07',
privateKey:
'0x68e18d97f62a803cd6f4da1f1e00cb360d217a33c67ed4120fa3947e121b5b03',
signTransaction: [Function: signTransaction],
sign: [Function: sign],
encrypt: [Function: encrypt] }
But the new account doesn't appear in the ganache. I also used web3.eth.getAccounts()
to show all the accounts in the blockchain but I didn't get the new account.
truffle(development)> web3.eth.getAccounts()
[ '0x7771248F9Df904f5Ee684D325E9a2B4d7A413bA0',
'0x9a46234628ab69516C43826A967312ABeB36DcE7',
'0x1392BC4cdc0aB295FD18bb720218079Da3f0c73E',
'0x4459Ffc957406B682DC8Cee556c2aDf17126A147',
'0x25Ec4525E472EAf52D2bc289F5768dd57fc0FaE5',
'0xf7A0B489BeE0ee7F195e64d991802f65a6B5AdDA',
'0x77175215D7A5eedb1B5551c6bfedb8d38A415388',
'0x25F4719D0eE8cc0eBf33a7AD61C35724Bc8E1740',
'0xb6880212A8F43D4872789f8a2aEbaf8358b32f89',
'0x5D51F0fB4bEa6fec0334fA0c7BBC5C3a8dD42Db1',
'0xb037075B163a6d3772AA8a401FC8A1361b970c43' ]
I can use the new account by using its private key. But where the new account is created? How I will know that the new account is part of ethereum blockchain or not which is created by ganache?