Node Install
Guide to Set Up a Starknet Full Node with Juno
Prerequisites
Operating System: Linux (Ubuntu 20.04 or later)
Minimum hardware requirements:
- 4 CPUs
- 32 GB RAM
- 500 GB SSD
Install Juno Binary
1. Install dependencies
sudo apt-get install -y libjemalloc-dev libjemalloc2 pkg-config libbz2-dev
make install-deps
2. Download precompiled binary (v0.15.0-rc.3)
curl -LOJ https://github.com/NethermindEth/juno/releases/download/v0.15.0-rc.3/juno-v0.14.1-linux-amd64.zip
unzip juno-v0.15.0-rc.3-linux-amd64.zip
sudo mv ./juno-v0.15.0-rc.3-linux-amd64 /usr/local/bin/juno
sudo chmod +x /usr/local/bin/juno
juno -v
3. Create systemd service
sudo tee /etc/systemd/system/juno.service > /dev/null <<EOF
[Unit]
Description=juno
After=network.target
[Service]
Type=simple
User=(user)
ExecStart=/usr/local/bin/juno --http --http-port 6062 --http-host 0.0.0.0 --db-path /home/(user)/junodata --eth-node ws://127.0.0.1:8546 --metrics --metrics-port 9097 --metrics-host=0.0.0.0 --ws --ws-port 6069 --ws-host 0.0.0.0
Restart=on-failure
RestartSec=10
LimitNOFILE=50000
[Install]
WantedBy=multi-user.target
EOF
4. Start Juno service
sudo systemctl daemon-reload
sudo systemctl enable juno
sudo systemctl start juno
sudo journalctl -fu juno
5. Restore snapshot (optional)
sudo systemctl stop juno
rm -rf /home/(user)/junodata/*
screen -S juno_snapshot
wget -O juno_mainnet.tar https://juno-snapshots.nethermind.io/files/mainnet/latest
tar -xvf juno_mainnet.tar -C /home/(user)/junodata
screen -S juno_snapshot -X quit
6. Get block number
curl --location 'http://localhost:6061' \
--header 'Content-Type: application/json' \
--data '{"jsonrpc": "2.0", "method": "starknet_blockHashAndNumber", "params": [], "id": 1}'
7. Check sync status
curl --location 'http://localhost:6061' \
--header 'Content-Type: application/json' \
--data '{"jsonrpc": "2.0", "method": "starknet_syncing", "params": [], "id": 1}'
8. Generate P2P ID
juno genp2pkeypair