I have looked alot for information about this and lastly i turn myself to here. I've written a smartcontract and deployed it to Ropsten . I am then using web3.js to interact with my smartcontract, i can use .call methods with no errors, but i have no idea how to fire methods that change the state, in this case mint, burn and send_X_tokens. From web3 docs it is stated in examples to be like this
myContract.methods.myMethod(123).send({from: 'ADDRESS'})
.then(console.log(receipt){
});
but that doesn't help me much. I assume i have to setup my account to be open or create and sign a transaction in order to use gas, but i cannot find anything on how to do that.
So thus far my code looks like this.
contract.methods.mint().send({ from: '0x76a9CEA17DbA8a371944d00a2E9A17AA3669B392', gas: 4000000 }).then(console.log(result))
And the error looks like this.
(node:28313) UnhandledPromiseRejectionWarning: Error: Returned error: The method eth_sendTransaction does not exist/is not available
at Object.ErrorResponse (/home/ubuntu/ethereum_website/node_modules/web3-core-helpers/src/errors.js:29:16)
at /home/ubuntu/ethereum_website/node_modules/web3-core-requestmanager/src/index.js:140:36
at XMLHttpRequest.request.onreadystatechange (/home/ubuntu/ethereum_website/node_modules/web3-providers-http/src/index.js:96:13)
at XMLHttpRequestEventTarget.dispatchEvent (/home/ubuntu/ethereum_website/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
at XMLHttpRequest._setReadyState (/home/ubuntu/ethereum_website/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
at XMLHttpRequest._onHttpResponseEnd (/home/ubuntu/ethereum_website/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
at IncomingMessage.<anonymous> (/home/ubuntu/ethereum_website/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
Help me solve this (probably) most basic puzzle.