Skip to main content

Build From Source

Advanced

These instructions are for setting up a Full node for network participation. If you just need a local development environment, you should instead follow the instructions in Create a Local IOTA Network to create a local Full node, validators, and faucet.

Minimum Hardware Requirements
  • CPUs: 8 physical cores / 16 vCPUs
  • RAM: 128 GB
  • Storage (SSD): 4 TB NVMe drive

Software requirements

IOTA recommends running IOTA Full nodes on Linux. IOTA supports the Ubuntu and Debian distributions. You can also run an IOTA Full node on macOS.

Make sure to update Rust.

Use the following command to install additional Linux dependencies.

sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends \
tzdata \
libprotobuf-dev \
ca-certificates \
build-essential \
libssl-dev \
libclang-dev \
libpq-dev \
pkg-config \
openssl \
protobuf-compiler \
git \
clang \
cmake

1. Clone the IOTA repository

  1. The first thing you need to do to set up your Full Node is clone the IOTA repository, you can use the following command or download it from GitHub:
git clone https://github.com/iotaledger/iota.git
  1. Once you have download the source code, move into the newly generated iota directory and check out the branch associated to the network you want to run, for example, testnet:
git checkout testnet

2. Configure the IOTA Full Node

Open a terminal or console in the iota directory you downloaded in the previous steps to complete the following:

  1. Install the required dependencies by running the following command:
cargo install
  1. Make a copy of the Full node YAML template:
cp crates/iota-config/data/fullnode-template.yaml fullnode.yaml
  1. Download the genesis and migration blob for the network to use:

  2. (For Testnet or Devnet) Edit the fullnode.yaml file to include peer nodes for state synchronization. Append the following to the end of the current configuration:

    p2p-config:
    seed-peers:
    - address: /dns/access-0.r.testnet.iota.cafe/udp/8084
    peer-id: 46064108d0b689ed89d1f44153e532bb101ce8f8ca3a3d01ab991d4dea122cfc
    - address: /dns/access-1.r.testnet.iota.cafe/udp/8084
    peer-id: 8ffd25fa4e86c30c3f8da7092695e8a103462d7a213b815d77d6da7f0a2a52f5
  3. (Optional, skip this step to accept the default paths to resources). Edit the fullnode.yaml file to use custom paths.

    1. Update the db-path field with the path to the Full node database.
      db-path: "/db-files/iota-fullnode"`
    2. Update the genesis-file-location with the path to genesis.blob.
      genesis:
      genesis-file-location: "/iota-fullnode/genesis.blob"
    3. Update the migration-tx-data-path with the path to the migration.blob
      migration-tx-data-path: "/opt/iota/config/migration.blob"

3. Compile the Node

Run the following command to compile the iota-node.

cargo run --release --bin iota-node

4. Start Services

At this point, your IOTA Full node is ready to connect to the IOTA network.

  1. Open a terminal or console to the iota directory and run the following command to start your node:
./target/release/iota-node --config-path fullnode.yaml
  1. (Optional) Publish/subscribe to notifications using JSON-RPC via websocket.

If your setup is successful, your IOTA Full node is now connected to the appropriate network.

Your Full node serves the read endpoints of the IOTA JSON-RPC API at: http://127.0.0.1:9000.

Troubleshooting

cannot find -lpq

If, during the compilation step, you receive a cannot find -lpq error, you are missing the libpq library. Use sudo apt-get install libpq-dev to install on Linux, or brew install libpq on MacOS. After you install on MacOS, create a Homebrew link using brew link --force libpq. For further context, reference the issue on Stack Overflow.

Listener: Address Already In Use

If you receive the following error:

panicked at error binding to 0.0.0.0:9184: error creating server listener: Address already in use (os error 98)

Update the metrics address in your fullnode.yaml file to use port 9180.

metrics-address: "0.0.0.0:9180"

Update Your Full node

Whenever IOTA releases a new version, you must update your Full node with the release to ensure compatibility with the network it connects to. For example, if you use IOTA Testnet you should install the version of IOTA running on IOTA Testnet.

Use the following steps to update your Full node:

  1. Shut down your running Full node.

  2. Move into the directory for your local iota repository and remove the database, 'genesis.blob' and 'migration.blob' files:

    rm -r iotadb genesis.blob migration.blob
  3. Fetch the latest changes by pulling from the IOTA repository:

    git pull
  4. Download the latest genesis and migration blob:

  5. (Optional) Update your fullnode.yaml configuration file, if needed.

  6. Recompile your IOTA Full node:

    cargo run --release --bin iota-node
  7. Restart your IOTA Full node:

    ./target/release/iota-node --config-path fullnode.yaml

Your Full node restarts on: http://127.0.0.1:9000.

info

If you prune transactions, Archival nodes can help ensure lagging peer nodes don't lose any information. For more information, see IOTA Archives.

Question 1/3

In the context of IOTA Full nodes, what is the significance of the 2f+1 validators during transaction processing?