5

I use truffle develop. It seems to me that the accounts in truffle develop are persistent. Pleas correct me if I'm wrong. How can I import the accounts from truffle develop into MetaMask?

  • How do you connect to your node with truffle ? is it testrpc or mainstead ? – Rangesh Nov 13 '17 at 10:16
  • I use truffle develop which was introduced in truffle 4.0.0 instead of tesrpc. It has the same functionality like testrpc but it runs on port 9545. – Bumblebee Nov 13 '17 at 10:20
  • yup,if its testrpc it does not mean persitent,every time you run truffle develop a new node is created for you to deploy changes and deployed contract address would also change. Your question seems like you want to import between nodes i.e from testrpc to metamask which i think is not feasible. TestRpc has its own node setup and account while Metamask has its own account and node setup. One possible way is to make Metamask point to your testrpc account but not the reverse. – Rangesh Nov 13 '17 at 10:53
10

With release V4.0.x of the Truffle framework, whenever you start Truffle using truffle develop it starts a new local in-memory Ethereum private network using the same 12 word mnemonic:


candy maple cake sugar pudding cream honey rich smooth crumble sweet treat

It is, therefore, possible to import the accounts into MetaMask by following the following simple steps.

When you open MetaMask in your browser, there is an option to "restore from seed phrase":

restore link in metamask

Enter the truffle develop phrase and then click on okay:

enter mnemonic

Press the "create account" up to 10 times (as many as you want access to) - it will generate the same addresses as seen in the truffle develop console (it's a deterministic process):

restore the accounts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.