Manage Ethereum Contract APIs
This document outlines the process of managing Ethereum APIs (EthAPIs) within your organization. An EthAPI provides a gateway to interact with smart contracts and other blockchain functionalities programmatically. This interface enables seamless integration of your organization's infrastructure with Ethereum-based networks.
Overview
An Ethereum API (EthAPI) is a crucial component for:
- Programmatic interaction with Ethereum smart contracts.
- Sending and receiving blockchain transactions.
- Building custom applications leveraging blockchain data and functionality.
In the EthAPI tab, you can:
- View all existing EthAPIs associated with your organization.
- Create new EthAPIs tailored to specific business needs.
Viewing EthAPIs
Existing EthAPIs
The EthAPI tab displays a list of all created EthAPIs, each associated with specific configurations:
- API Name: Identifier for the EthAPI.
- Host Details: The infrastructure VM where the API is hosted.
- Associated Network: The Ethereum network tied to the EthAPI.
This interface allows you to oversee and manage your organization's API interactions effectively.
Creating a New EthAPI
Steps to Create a New EthAPI
To create a new Ethereum API:
- Navigate to the EthAPI tab.
- Click on the + New EthAPI button.
- A pop-up screen will guide you through the creation process.
EthAPI Creation Process
Step 1: Select a Business Group
- Select Business Group: Choose a business group to associate with the EthAPI.
- If no business groups are available, click on Create Business Group to add one.
After selecting a business group, proceed to the next screen.
Step 2: Provide EthAPI Details
You will be prompted to provide the following information:
- API Name: The name of the API (e.g.,
ethapi0.Example-org
). This field is pre-set. - API Host: Select one of your infrastructure VMs where the EthAPI will be hosted.
- Network: Choose the Ethereum network (e.g., Besu network) for which the EthAPI will operate.
- Contracts: Select any uploaded or deployed contracts to associate with the API.
- Account Address: Choose an Ethereum account address to initialize the EthAPI.
- Password: Enter the password for the selected account.
Once all the fields are completed, click Submit.
Finalizing EthAPI Creation
- The system will process the provided details. This may take some time depending on the configuration and network state.
- Once the process is complete, the new EthAPI will be available and functional.
Viewing EthAPI Details
After an EthAPI is created, you can click on the newly created API to view its details. The EthAPI tab provides the following information:
Container Details
- Name: The name of the API container (e.g.,
ethapi0.Example-org
). - Platform: The operating system of the container (e.g.,
linux
). - Image: The Docker image used (e.g.,
goledger/ethapi-go:latest
). - Status: Current status of the container (e.g.,
running
). - Started At: Timestamp indicating when the container was initialized.
Environment Variables
These variables provide configuration details for the EthAPI:
- RPC_URL: The endpoint for RPC communication (e.g.,
http://54.162.33.230:8545
). - NETWORK_NAME: The name of the Ethereum network (e.g.,
Besu test net
). - NETWORK_ID: The unique identifier for the Ethereum network (e.g.,
ffca0db4-57b4-4445-90b3-b82c59ca1bdc
). - CHAIN_ID: The chain ID of the Ethereum network (e.g.,
1337
). - CURRENCY_SYMBOL: The symbol of the currency used (e.g.,
ETH
). - PATH: System paths for container execution.
Additional Features
Logs Tab
- Access detailed container logs to monitor API activity and diagnose potential issues.
Settings Tab
- Option to delete the EthAPI if it is no longer required.
Importance of EthAPIs
Creating and managing EthAPIs offers several advantages:
- Enhanced Integration: EthAPIs act as a bridge between your organization's applications and the Ethereum blockchain.
- Streamlined Operations: APIs simplify the interaction with smart contracts and enable automation of blockchain operations.
- Scalability: Organizations can manage multiple APIs for different networks and purposes.
- Security: APIs tied to specific accounts ensure controlled access to blockchain functionalities.
Use Cases
- Smart Contract Interactions: Programmatically call and execute smart contract functions.
- Transaction Management: Send transactions, query balances, and fetch transaction details.
- Custom Applications: Build applications that interact with Ethereum networks using standardized API endpoints.
Recommended next steps:
- Create Smart Contracts: Learn how to Create Smart Contracts to your network.
- Deploy Smart Contracts: Learn how to Deploy Smart Contracts to your network.