Calls

A call does not broadcast anything to the blockchain; instead, it is a local call to a contract function and runs locally on the node. It is almost like a local function call. It does not consume any gas as it is a read-only operation. It is akin to a dry run or a simulated run. Calls are executed locally on a node VM and do not result in any state change because they are never mined.

Do not confuse a call this with a message call transaction, which in fact results in a state change. Call basically runs message call transactions in simulated mode and is available in the web3.js JavaScript API.

Get Mastering Blockchain - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.