1

would like to build a blockchain simulator with web3 interface. I use ganache and solidity. my simulator is a microgrid simulator (autonomous energy community) where a house is represented by an eth address (with ganache) However, as soon as I make a transaction or interact with a contract, a metamask notification appears. is it possible to remove this notification in order to run my simulator which will proceed to multiple transactions without the user having approved these transactions.

Thank’s for response

0

It is not possible to disable MetaMask's prompt. It is a security measure to prevent access to a wallet without the user intervention.

If you are using ganache you should connect directly without passing through Metamask.

| improve this answer | |
0

For the simulation purposes, you want to use a programmatical wallet and not MetaMask.

You can emulate wallet with with web3.js or web3.py code.

  • Store raw private keys as hexadecimal format (the private key is just a random uint256)

  • Import private keys to web3.js or similar

  • Sign any transactions directly with these private keys

truffle-hdprovider package allows you to use hierarchically deterministic keys in your JavaScript / TypeScript code. Then you can just send() transactions without triggering any prompts.

| improve this answer | |

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.