You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't find a way to retrieve the private key / public key / public address for a web3 account loaded via a provider. I have tried the web3.eth.accounts command but I am not getting the private key / public key / public address .
const web3 = new Web3(provider);
web3.eth.accounts
What I am trying to do in details
I would like to have a HD wallet for receiving ethers on different public keys (and later selling them)
Following the advice in the doc, I am using truffle/hdwallet-provider for the HD wallet. So now I am trying to retrieve the private key, the public key and possibly the public address via web3js for the provider created via truffle/hdwallet-provider wallet
Steps to Reproduce
This is my code which I run several time in different node console in a cmd.
Before starting the node console, I start a cmd with geth --rpc --rpcport 8545 while internet is turned off so that I don't have to download/sync the blockchain
In brief
I can't find a way to retrieve the private key / public key / public address for a web3 account loaded via a provider. I have tried the
web3.eth.accounts
command but I am not getting the private key / public key / public address .What I am trying to do in details
I would like to have a HD wallet for receiving ethers on different public keys (and later selling them)
Following the advice in the doc, I am using
truffle/hdwallet-provider
for the HD wallet. So now I am trying to retrieve the private key, the public key and possibly the public address via web3js for the provider created viatruffle/hdwallet-provider wallet
Steps to Reproduce
This is my code which I run several time in different node console in a
cmd
.Before starting the node console, I start a
cmd
withgeth --rpc --rpcport 8545
while internet is turned off so that I don't have to download/sync the blockchainExpected behavior and Actual behavior
There should be a way to retrieve the private/public key via web3.eth.accounts but I am only getting a single address
Thanks a lof for your help!
Environment
truffle version
): @truffle/hdwallet-provider@1.4.0 (web3@1.3.6)node --version
): v14.16.1npm --version
): 6.14.12P.S: sorry for posting here but I have already asked on stackoverflow but I didn't get any answer and I have been stuck on this for more than 2 weeks.
The text was updated successfully, but these errors were encountered: