Blockchain Explorer
Actions22
- Account Actions
- Block Actions
- Contract Actions
- Gas Actions
- Stat Actions
- Token Actions
- Transaction Actions
Overview
The node interacts with multiple blockchain networks through their explorer APIs that are compatible with Etherscan. Specifically, for the Contract resource and the Verify Contract operation, it allows users to verify and publish the source code of a smart contract on a selected blockchain network. This is useful for developers or auditors who want to confirm that a deployed contract's source code matches what is published on the blockchain explorer, enhancing transparency and trust.
Practical examples include:
- Publishing verified source code after deploying a new smart contract.
- Automating contract verification as part of a CI/CD pipeline.
- Checking if a contract’s source code has been successfully verified on a blockchain explorer.
Properties
| Name | Meaning |
|---|---|
| Network | The blockchain network to query. Options: Arbitrum, Avalanche, Binance Smart Chain, Celo, Cronos, Ethereum, Fantom, Moonbeam, Optimism, Polygon. Default is Ethereum. |
| Contract Address | The address of the smart contract to verify and publish its source code on the blockchain explorer. Must be a valid contract address (e.g., starting with "0x..."). |
Output
The output JSON contains the following fields:
network: The blockchain network used for the query.resource: The resource type, here always"contract".operation: The operation performed, here"verifyContract".- Additional fields returned by the blockchain explorer API response, which typically include:
status: Status code from the API indicating success or failure.message: A message describing the result of the verification request.result: Details about the verification process, such as success confirmation or error details.
If the verification fails, the node throws an error with the API error message unless "Continue On Fail" is enabled, in which case the error message is included in the output JSON under an error field.
The node does not output binary data.
Dependencies
- Requires an API key credential for the blockchain explorer service compatible with Etherscan APIs.
- The node supports multiple blockchain networks; the base URL for the API is determined dynamically based on the selected network and environment.
- Uses the Axios HTTP client library internally to make API requests.
Troubleshooting
Common issues:
- Invalid or missing API key credential will cause authentication errors.
- Incorrect contract address format or non-existent contract address will lead to API errors.
- Network selection mismatch (e.g., contract deployed on Polygon but querying Ethereum) will cause verification failures.
- API rate limits may cause temporary failures.
Error messages:
"API Error: <message>"indicates the blockchain explorer API returned an error. Check the contract address, network, and API key validity.- If the node returns an error JSON object with an
errorfield, enabling "Continue On Fail" can help debug without stopping the workflow.