Local execution means that the system executes some transactions only locally for data queries or calculation, without broadcasting them to the chain. Local execution parameters are the same as chain-based execution parameters. The local transaction API is of the
AbstractTransactionRequest attribute, which is the parent class of all transaction requests.
- Function prototype
// Specify the execution in the highest block on the chain.
public void setLocal()
// Specify the execution in a specific block on the chain.
public void setLocal(BigInteger blockNumber)
The following shows a local transaction example of creating an account.
CreateAccountRequest request = new CreateAccountRequest(accountId, account);
// Refer to the error message description document to check the returned data.
CreateAccountResponse result = sdk.getAccountService().CreateAccount(request);