I'm running a private Ethereum blockchain on my computer. I've installed Metamask on my chrome as well.
I can create an account on metamask, and then interact with my smart contract deployed on my private blockchain. It works fine. Also, everything works fine when I use remix to interact with my smart contract on my private blockchain.
I'm designing my own local HTML file. My HTML file can interact with the smart contract, in the sense that it can read the contract's state.
But when I want to call a function that changes the contract state, I get this error on my HTML file:
Uncaught Error: unknown account at Object.InvalidResponse (web3.min.js:1) at s.send (web3.min.js:1) at _.e [as sendTransaction] (web3.min.js:1) at c.sendTransaction (web3.min.js:1) at register_std_num (tt.html:413) // this is the function (in my contract) I want to call at HTMLButtonElement.onclick (tt.html:20)
Also, I have tried both:
where "0x333333" is the address I have created in Metamask.
Note that when I click the related button in the HTML file, MetamasK is not invoked.
Question: Which part am I missing? Is there anything else I need to do?
Please note that, in my HTML file, if I use an account I have created in geth, then I unlock the account and send the same transaction with that account, I can see that the transaction is sent to the blockchain. But as I said above, it does not work with the account I have created in Metamask.