2

You can set the nonce with {nonce: <nonce>} but the bigger question is WHY? The nonce should be managed by the client and there are valid reasons to track it yourself. Have a look over here at "Candidate 3" that I would recommend most of the time. Concurrency patterns for account nonce However, this is not a valid design. intends to put multiple ...


2

Ganache can be configured to mine new blocks on a specific time interval. With this setting enabled you are able to include multiple transactions in a single block. To enable this functionality in the GUI, access the settings by clicking the gear icon in the top right corner. Choose "Server" settings. From there you will be able to disable auto-mining and ...


1

You will need the ABI. The .methods is an attribute of the contract instance, which you get by using the ABI. If you are using ethers.js, you can use a shorthand ABI to achieve the same goal: let abi = ["function approve(address _spender, uint256 _value) public returns (bool success)"] let provider = ethers.getDefaultProvider('ropsten') let contract = new ...


1

For the caller to be able to retrieve the desired information (the stock price), the function would have to emit an event. That's true for an off-chain caller, for example: Web3.js script Web3.py script MyEtherWallet Remix Or is there a situation where the code above is actually practical? Yes, it (the returned value) is practical for an on-chain ...


1

I see you modified the question after several valid/correct answers: Question is: how to invoke GenNextID like a regular function, that is: call to this function mutates internal state it returns result returned from the contract's code YOU DON'T You either mutate the state and get a receipt, or you get a response but you don't mutate the ...


1

You are trying to update the state of your contract and for this you have to execute blockchain transaction, but eth_call is not for firing transactions read more here. What can work for your case is using eth_sendRawTransaction read more here. In params you have to place the transaction data which have to be signed by the private key of the transaction ...


1

web3.js can be also used in a server side environment, depending of your language implementation, and it is the best way to do it. Doing it manually is possible, but you will need to encode all the parameters and the signature, and sign the transaction to. Here is an article with some detail on ethereum transaction format: Inside an Ethereum transaction ...


Only top voted, non community-wiki answers of a minimum length are eligible