Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Is there a way to unlock all the accounts form a forked chain? #3603

Answered by MicaiahReid
surajsjain asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @surajsjain, thanks for the question! You can add any arbitrary account to Ganache using the evm_addAccount method:

const address = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"; // any address can go here :)
const passphrase = "passphrase"
const result = await provider.send("evm_addAccount", [address, passphrase] );
console.log(result);

The address is now added to the personal namespace in Ganache, which means that sending and and signing transactions can be done via personal_sendTransaction and personal_signTransaction. These methods are identical to eth_sendTransaction and eth_signTransaction, except they have an additional parameter for the passphrase that was originally used to add…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by surajsjain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants