Build From Source
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.
- 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
- 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
- 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:
- Install the required dependencies by running the following command:
cargo install
- Make a copy of the Full node YAML template:
cp crates/iota-config/data/fullnode-template.yaml fullnode.yaml
-
Download the genesis and migration blob for the network to use:
- Testnet genesis blob:
curl -fLJO https://dbfiles.testnet.iota.cafe/genesis.blob
- Devnet genesis blob:
curl -fLJO https://dbfiles.devnet.iota.cafe/genesis.blob
- Devnet migration blob:
curl -fLJO https://dbfiles.devnet.iota.cafe/migration.blob
- Mainnet genesis blob:
curl -fLJO TODO
- Mainnet migration blob:
curl -fLJO TODO
- Testnet genesis blob:
-
(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:- Testnet
- Devnet
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: 8ffd25fa4e86c30c3f8da7092695e8a103462d7a213b815d77d6da7f0a2a52f5p2p-config:
seed-peers:
- address: /dns/access-0.r.devnet.iota.cafe/udp/8084
peer-id: 01589ac910a5993f80fbc34a6e0c8b2041ddc5526a951c838df3037e11ab0188
- address: /dns/access-1.r.devnet.iota.cafe/udp/8084
peer-id: 32875c547ea3b44fa08a711646cedb70fa0c97959d236578131505da09723add -
(Optional, skip this step to accept the default paths to resources). Edit the
fullnode.yaml
file to use custom paths.- Update the
db-path
field with the path to the Full node database.db-path: "/db-files/iota-fullnode"`
- Update the
genesis-file-location
with the path to genesis.blob.genesis:
genesis-file-location: "/iota-fullnode/genesis.blob" - Update the
migration-tx-data-path
with the path to the migration.blobmigration-tx-data-path: "/opt/iota/config/migration.blob"
- Update the
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.
- 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
- (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:
-
Shut down your running Full node.
-
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
-
Fetch the latest changes by pulling from the IOTA repository:
git pull
-
Download the latest genesis and migration blob:
- Testnet genesis blob:
curl -fLJO https://dbfiles.testnet.iota.cafe/genesis.blob
- Devnet genesis blob:
curl -fLJO https://dbfiles.devnet.iota.cafe/genesis.blob
- Devnet migration blob:
curl -fLJO https://dbfiles.devnet.iota.cafe/migration.blob
- Testnet genesis blob:
-
(Optional) Update your
fullnode.yaml
configuration file, if needed. -
Recompile your IOTA Full node:
cargo run --release --bin iota-node
-
Restart your IOTA Full node:
./target/release/iota-node --config-path fullnode.yaml
Your Full node restarts on: http://127.0.0.1:9000.
If you prune transactions, Archival nodes can help ensure lagging peer nodes don't lose any information. For more information, see IOTA Archives.