Native IoTeX Development

This documentation is provided for backward compatibility support. IoTeX is fully Ethereum-compatible; therefore, developers are encouraged to utilize Ethereum tools to build dApps on IoTeX.

Overview of Antenna SDK

Antenna is the IoTeX native SDK, enabling direct interaction with a local or remote IoTeX node using a gRPC connection. It is available for the most popular programming languages. The key difference between developing with Antenna versus the Web3 SDK is that Antenna wraps the full gRPC Native API of the IoTeX protocol and uses the native representation of IoTeX addresses.

While IoTeX fully supports the Ethereum API, allowing the use of Web3 tools for dApp development, IoTeX's architecture is more complex than Ethereum's. This makes Antenna the necessary choice when leveraging IoTeX's unique features. For example, concepts such as "Delegates," "Block Producers," "Staking Transactions," "Buckets," and "Voting" have no equivalents in Ethereum. Therefore, to utilize these features in your dApp, you need to use Antenna instead of tools like Web3.js.

The Example Code section includes samples for each supported language.

Supported Languages

antenna-js (Javascript)

GitHub

In your JS project root, use npm install or yarn add.

npm install iotex-antenna

or add the following line to your html.

<script src="https://cdn.jsdelivr.net/npm/iotex-antenna@0.29.1/lib/iotex-antenna.browser.min.js"></script>

A few useful links:

  • Reference Code: the docs section with reference implementation for most common blockchain requirements.

  • Integrate IoPay Wallet: the docs section explaining how to integrate your web client with IoPay Wallet

  • Antenna-JS Reference: the API reference documentation for Antenna-JS

antenna-java (java):

GitHub

Install By Maven

<dependency>
  <groupId>com.github.iotexproject</groupId>
  <artifactId>iotex-antenna-java</artifactId>
  <version>0.5.8</version>
</dependency>

Install by Gradle

implementation 'com.github.iotexproject:iotex-antenna-java:0.5.8'

antenna-go (go lang):

GitHub

In your Golang project root, use go dep or go mod.

go get -u github.com/iotexproject/iotex-antenna-go

A few useful links:

  • Reference Code: the docs section with reference implementation for most common blockchain requirements.

  • Code Examples section for most common SDK use case in Go.

antenna-swift (iOS):

GitHub

In your JS project root, use npm install or yarn add.

pod 'iotex-antenna-swift', '~> 0.1'

A few useful links:

  • Reference Code: the docs section with reference implementation for most common blockchain requirements.

antenna-embedded (C):

GitHub

Download the latest release of Antenna Embedded, then in your C file include the following:

#include "u128.h"
#include "iotex_emb.h"

int main(int argc, char **argv) {

    int ret;
    iotex_st_config config = {0};

    config.ver = 1;
    config.cert_file = "cacert.pem";

    /* Initialize Antenna-c lib */
    if ((ret = iotex_emb_init(&config)) != 0) {
        fprintf(stderr, "Initialize iotex emb failed, error code: %d\n", ret);
        return -1;
    }

    // Interact with the blockchain
    // ...

Features

  • Crypto: Provides cryptographic functions to generate public/private keys, sign transactions and data, and other utility functions.

  • RPC-Methods: Allows calling any RPC method provided by an IoTeX Blockchain Gateway.

  • Account: Functions to create and manage blockchain accounts.

  • Action: Enables creation and management of blockchain actions.

  • Contract: Facilitates interaction with contracts deployed on the IoTeX Blockchain, given the contract address and ABI.

  • XRC20: Supports sending, receiving, and querying wallets for XRC20 tokens deployed on the IoTeX Blockchain.

Last updated

Logo

This documentation portal is currently undergoing updates to align with the IoTeX 2.0 Whitepaper release. Information provided here may be incomplete, or out-of-date. Please use this portal for preliminary reference only, and check out the official IoTeX 2.0 Whitepaper for updated information.

.

2024 | IoTeX