Resources
Service Providers

Service Providers

'Service Providers' are defined as entities that provide services for end-users that involve some form of interaction with the AIOZ Network. More specifically, this document is focused on interactions with tokens.

Service Providers are expected to act as trusted points of contact to the blockchain for their end-users. This Service Providers section does not apply to wallet builders that want to provide Light Client functionalities.

This document describes:

Connection Options

There are four main technologies to consider to connect to the AIOZ Network:

  • Full Nodes: Interact with the blockchain.
  • REST Server: Serves for HTTP calls.
  • REST API: Use available endpoints for the REST Server.
  • GRPC: Connect to the AIOZ Network using gRPC.

Running a Full Node

What is a Full Node?

A Full Node is a network node that syncs up with the state of the blockchain. It provides blockchain data to others by using RESTful APIs, a replica of the database by exposing data with interfaces. A Full Node keeps in syncs with the rest of the blockchain nodes and stores the state on disk. If the full node does not have the queried block on disk the full node can go find the blockchain where the queried data lives.

Installation and Configuration

This section describes the steps to run and interact with a full node for the AIOZ Network.

First, you need to install the software.

Consider running your own AIOZ Network Full Node.

Command-Line Interface

The command-line interface (CLI) is the most powerful tool to access the AIOZ Network and use aioz. To use the CLI, you must install the latest version of aioz on your machine.

Compare your version with the latest release version (opens in a new tab)

aiozd version --long

Available Commands

All available CLI commands are shown when you run the aiozd command:

aiozd 
AIOZ Node App

Usage:
  aiozd [command]

Available Commands:
  add-genesis-account Add a genesis account to genesis.json
  collect-gentxs      Collect genesis txs and output a genesis.json file
  config              Create or query an application CLI configuration file
  debug               Tool for helping with debugging your application
  export              Export state to JSON
  gentx               Generate a genesis tx carrying a self delegation
  help                Help about any command
  init                Initialize private validator, p2p, genesis, and application configuration files
  keys                Manage your application's keys
  query               Querying subcommands
  rollback            rollback cosmos-sdk and tendermint state by one height
  rosetta             spin up a rosetta server
  start               Run the full node
  status              Query remote node for status
  tendermint          Tendermint subcommands
  testnet             Initialize files for a simapp testnet
  tx                  Transactions subcommands
  validate-genesis    validates the genesis file at the default location or at the location passed as an arg
  version             Print the application binary version information

Flags:
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --chain-id string          Specify Chain ID for sending Tx (default "testnet")
      --fees string              Fees to pay along with transaction; eg: 10attoaioz
      --from string              Name or address of private key with which to sign
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10attoaioz)
  -h, --help                     help for aiozd
      --home string              directory for config and data (default "/home/user/.aioz")
      --keyring-backend string   Select keyring's backend (default "os")
      --log_format string        The logging format (json|plain) (default "plain")
      --log_level string         The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --trace                    print out full stack trace on errors

Use "aiozd [command] --help" for more information about a command.

For each displayed command, you can use the --help flag to get further information.

aiozd query --help
Querying subcommands

Usage:
  aiozd query [flags]
  aiozd query [command]

Aliases:
  query, q

Available Commands:
  account                  Query for account by address
  aiozrc20                 Querying commands for the aiozrc20 module
  auth                     Querying commands for the auth module
  authz                    Querying commands for the authz module
  bank                     Querying commands for the bank module
  block                    Get verified data for a the block at given height
  bonus                    Querying commands for the minting module
  distribution             Querying commands for the distribution module
  evidence                 Query for evidence by hash or for all (paginated) submitted evidence
  evm                      Querying commands for the evm module
  feegrant                 Querying commands for the feegrant module
  feemarket                Querying commands for the fee market module
  gov                      Querying commands for the governance module
  ibc                      Querying commands for the IBC module
  ibc-transfer             IBC fungible token transfer query subcommands
  interchain-accounts      interchain-accounts subcommands
  mint                     Querying commands for the minting module
  params                   Querying commands for the params module
  slashing                 Querying commands for the slashing module
  staking                  Querying commands for the staking module
  tendermint-validator-set Get the full tendermint validator set at given height
  tx                       Query for a transaction by hash, "<addr>/<seq>" combination or comma-separated signatures in a committed block
  txs                      Query for paginated transactions that match a set of events
  upgrade                  Querying commands for the upgrade module

Flags:
  -h, --help   help for query

Global Flags:
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --chain-id string          Specify Chain ID for sending Tx (default "testnet")
      --fees string              Fees to pay along with transaction; eg: 10attoaioz
      --from string              Name or address of private key with which to sign
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10attoaioz)
      --home string              directory for config and data (default "/home/user/.aioz")
      --keyring-backend string   Select keyring's backend (default "os")
      --log_format string        The logging format (json|plain) (default "plain")
      --log_level string         The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --trace                    print out full stack trace on errors

Use "aiozd query [command] --help" for more information about a command.

Remote Access to aiozd

When choosing to remote access a Full Node and aiozd, you need a Full Node running and aioz installed on your local machine.

aiozd is the tool that enables you to interact with the node that runs on the AIOZ Network, whether you run it yourself or not.

To set up aiozd on a local machine and connect to an existing full node, use the following command:

aiozd config <flag> <value>

First, set up the address of the full node you want to connect to:

aiozd config node <host>:<port
 
// example: aiozd config node https://rpc-dataseed.aioz.network:443

If you run your own full node locally, use tcp://localhost:26657 as the address.

Set the default value of the --trust-node flag:

aiozd config trust-node false
 
// Set to true if you run a light client node

Finally, set the chain-id of the blockchain you want to interact with:

aiozd config chain-id aioz_168-1

Next, learn to use CLI commands to interact with the full node. You can run these commands as remote control or when you are running it on your local machine.

Create a Key Pair

The default key is ethsecp256k1 elliptic curve. Use the aiozd keys command to list the keys and generate a new key.

aiozd keys add <your_key_name>

You will be asked to create a password (at least 8 characters) for this key-pair. This will return the information listed below:

  • NAME: Name of your key
  • TYPE: Type of your key, always local.
  • ADDRESS: Your address. Used to receive funds.
  • ADDRESS_HEX: Your address in hex format. Used to receive funds.
  • PUBKEY: Your public key. Useful for validators.
  • MNEMONIC: 24-word phrase. Save this mnemonic somewhere safe. This phrase is required to recover your private key in case you forget the password. The mnemonic is displayed at the end of the output.

You can see all available keys by typing:

aiozd keys list

Use the --recover flag to add a key that imports a mnemonic to your keyring.

aiozd keys add <your_key_name> --recover

Check your Account

You can view your account by using the query account command.

aiozd query account <YOUR_ADDRESS>

It will display your account type, account number, public key and current account sequence.

'@type': /ethermint.types.v1.EthAccount
account_number: "xxxx"
address: aioz____
pub_key:
  '@type': /ethermint.crypto.v1.ethsecp256k1.PubKey
  key: xxx
sequence: "x"

Check your Balance

Query the account balance with the command:

aiozd query bank balances <YOUR_ADDRESS>

The response contains keys balances and pagination. Each balances entry contains an amount held, connected to a denom identifier. The typical $AIOZ token is identified by the denom attoaioz. Where 1 attoaioz is 0.000000000000000001 AIOZ.

balances: 
- amount: "12345678"
  denom: attoaioz
pagination:
  next_key: null
  total: "0"

When you query an account that has not received any token yet, the balances entry is shown as an empty array.

balances: []
pagination:
  next_key: null
  total: "0"

Send Coins Using the CLI

To send coins using the CLI:

aiozd tx send <from_key_or_address> <to_address> <amount> \
    --chain-id=<your_chain_id> 

Parameters:

  • <from_key_or_address>: Key name or address of sending account.
  • <to_address>: Address of the recipient.
  • <amount>: This parameter accepts the format <value|coinName>, such as 1000000000attoaioz.

Flags:

  • --chain-id: This flag allows you to specify the id of the chain. There are different ids for different testnet chains and mainnet chains.
  • --gas-prices: This flag allows you to specify the gas prices you pay for the transaction. The format is used as 1000000000attoaioz

REST API

The REST API documents (opens in a new tab) list all the available endpoints that you can use to interact with your full node. Learn how to enable the REST API on your full node.

Listen for Incoming Transactions

The recommended way to listen for incoming transactions is to periodically query the blockchain by using the following HTTP endpoint:

/cosmos/bank/v1beta1/balances/{address} (opens in a new tab)