Skip to main content

Connect to an IOTA Network

info

The Network Overview section lists all the networks available in the IOTA ecosystem.

IOTA CLI

IOTA provides the IOTA command line interface (CLI) to interact with IOTA networks, it does the following and more:

  • Create and manage your private keys
  • Call and publish Move modules
  • Compile and test Move modules
  • Create and execute programmable transaction blocks (PTBs)
  • Interact with testnet/devnet faucets

You can use the CLI or SDKs to send transactions and read requests from using the JSON-RPC and the following endpoint: https://api.<IOTA-NETWORK-VERSION>.iota.cafe:443.

Stardust Protocol

The IOTA Mainnet runs the Stardust Protocol.

Environment Set Up

First, Install IOTA. After you install IOTA, request IOTA test tokens for the network you are using. If connected to Localnet, use cURL to request tokens from your local faucet.

To check whether IOTA is already installed, run the following command:

which iota

If IOTA is installed, the command returns the path to the IOTA binary. If IOTA is not installed, it returns iota not found.

Release Info;

See the IOTA Releases page to view the changes in each IOTA release.

Connect Your CLI to a Network

You can connect to an IOTA network using the following command that will start the IOTA CLI Client:

iota client

First Run

If this is the first time you run the command, you will be prompted to configure the client.

1. Create client.yaml

Config file ["<FILE-PATH>/.iota/iota_config/client.yaml"] doesn't exist, do you want to connect to a IOTA Full node server [y/N]?

Enter y to proceed. You receive the following response:

2. Select the Network

IOTA Full node server URL (Defaults to IOTA Testnet if not specified) :

If you want to connect to the Testnet, you can simply press Enter.

If not, specify your desired node URL. If you choose to add a custom URL, you should also add an alias for ease of access:

Environment alias for [<URL-ENTERED>] :

3. Generate Keys and Address

Select key scheme to generate keypair (0 for ed25519, 1 for secp256k1, 2: for secp256r1):

Finally, you will be prompted to select the key scheme you want to use. After this, you will receive a message that states the selected key-scheme, the generated address and your secret recovery phrase.

Signature scheme selection

If you are unsure which scheme to use just go with the default ed25519 scheme (option 0).

Generated new keypair for address with scheme "ed25519" [0xb9c83a8b40d3263c9ba40d551514fbac1f8c12e98a4005a0dac072d3549c2442]
Secret Recovery Phrase : [hat become demise beyond history wood stage add nice list jaguar legend]

Add a Network Environment

The IOTA CLI Client allows you to add any number of network environments.

Check the Current Network ENVs

You can easily check the currently configured environments using the following command, which will output the environment alias and URL, as well as indicate the currently active environment:

iota client envs

The command outputs the available environment aliases, with (active) denoting the currently active network.

localnet => http://0.0.0.0:9000 (active)
testnet => https://https://api.testnet.iota.cafe:443

You can add a new environment using the iota client new command. You should specify and alias and rpc URL, for example:

iota client new-env --alias local --rpc http://0.0.0.0:9000

Switch Network Environment

You can switch the current environment using the following command:

iota client switch --env <EnvAlias>
  • Where <EnvAlias> is one of your currently set environments. You can use the following networks to develop on IOTA. If you are still developing your application, you should use the Devnet or Testnet, as these networks provide convenient faucets for test tokens.

IOTA Networks

Devnet

The latest stable release. As such, it has the latest features that were tested in the development branch of the repository.

Testnet

Once a release has been battle-tested in the Devnet, it moves to the Testnet. You can use this network to test your software in real-world conditions.

Data persistence is not guaranteed on the Testnet and Devnet

Devnet data is wiped regularly as part of scheduled software updates.

The data on Testnet persists through the regular update process, but might be wiped when necessary. Testnet data wipes are announced ahead of time.

Testnet node validators

The IOTA Testnet and Devnet networks consist of four validator nodes operated by the IOTA Foundation.

Mainnet

The fully operational production network, with data persistence and where tokens have real value.

Local Networks

You can also spin up a local IOTA network for local development.

Question 1/4

Which command is used to start the IOTA CLI Client?