Skip to main content
info
IOTA Identity for Rebased is currently in alpha and may still be subject to significant changes

Local Network Setup

Start the Local Chain

The examples in the repository and in this getting started section require a test network running locally, so if you do not already have one, install the IOTA CLI tool.

Next, start the local network with the following command.

RUST_LOG="off,iota_node=info" iota start --force-regenesis --with-faucet

Configure IOTA Client For the Local Chain

Fresh IOTA Client

If you haven't started the IOTA CLI client features tool yet, you have to generate a config file during the first start by calling:

iota client

Agree to connect to a full node server. Now you can interactively provide the config values:

New Env

Alternatively, if you don't already have an environment pointing to the local node, create a new env for an IOTA Full node server with the same values as described above.

iota client new-env --rpc "http://127.0.0.1:9000" --alias localnet

Switch to Local Node Env

If you did one of the steps above or already have an env as described above, make sure to switch to it.

Check active env with:

iota client env

If your localnet does not have the asterisk in the "active" column, switch to it with:

iota client switch --env localnet

Request Funds for Active Accounts

Request funds for the active account, as the next step will need them. This can be done with:

iota client faucet

Publish the IOTA Identity Package

Now that you have your env pointing to a local node, and have an account, you're almost ready to put a checkmark on the last requirement for using the IOTA Identity locally: The deployment of the smart contracts used by the library.

Clone the IOTA identity repository, and switch to the tag matching the version, you're working with.

Next, publish the identity package to your local test network:

./identity_iota_core/scripts/publish_identity_package.sh

The last line of the output will be the id of the package that was just published. You'll need this ID when creating an instance of IdentityClient and IdentityClientReadOnly for a custom network, like the local network.

The create a decentralized identifier example, as well as the following examples, fetch this value from the environment variable IOTA_IDENTITY_PKG_ID, so in order to run them, set this variable, e.g. for package id 0x20f640b0dc01c50c04a84443d4320d7a77a15ed94f9bc19ebb6d0a5805045ddc with:

export IOTA_IDENTITY_PKG_ID=0x20f640b0dc01c50c04a84443d4320d7a77a15ed94f9bc19ebb6d0a5805045ddc