|
| 1 | +--- |
| 2 | +sidebar_position: 8 |
| 3 | +title: Node Management |
| 4 | +description: Essential commands and tools for managing your Mina Rust node |
| 5 | +--- |
| 6 | + |
| 7 | +# Node Management |
| 8 | + |
| 9 | +This guide covers essential commands and tools for managing your Mina Rust node, |
| 10 | +including version verification, monitoring, and troubleshooting. |
| 11 | + |
| 12 | +## Checking Build Information |
| 13 | + |
| 14 | +It's important to verify the version and build information of your node to |
| 15 | +ensure you're running the correct version and to help with troubleshooting. |
| 16 | + |
| 17 | +### Using Docker |
| 18 | + |
| 19 | +To check the build information of your Docker-based node: |
| 20 | + |
| 21 | +```bash |
| 22 | +# Get build information |
| 23 | +docker run --rm o1labs/mina-rust:latest build-info |
| 24 | +``` |
| 25 | + |
| 26 | +Example output: |
| 27 | + |
| 28 | +``` |
| 29 | +Version: 0341fff |
| 30 | +Build time: 2025-09-10T18:11:40.953050700Z |
| 31 | +Commit SHA: 0341fffedba4900371504ad4b30853674960a209 |
| 32 | +Commit time: 2025-09-10T19:30:31.000000000+02:00 |
| 33 | +Commit branch: release/v0.17.0 |
| 34 | +Rustc channel: stable |
| 35 | +Rustc version: 1.84.1 |
| 36 | +``` |
| 37 | + |
| 38 | +For a specific version: |
| 39 | + |
| 40 | +```bash |
| 41 | +docker run --rm o1labs/mina-rust:v0.17.0 build-info |
| 42 | +``` |
| 43 | + |
| 44 | +### Using Native Binary |
| 45 | + |
| 46 | +If you've built from source or are running the binary directly: |
| 47 | + |
| 48 | +```bash |
| 49 | +# Get build information |
| 50 | +mina build-info |
| 51 | + |
| 52 | +# Or with the full path if not in PATH |
| 53 | +./target/release/mina build-info |
| 54 | +``` |
| 55 | + |
| 56 | +### Understanding Build Information |
| 57 | + |
| 58 | +The build info provides critical details: |
| 59 | + |
| 60 | +- **Version**: Short commit hash identifying the exact code version |
| 61 | +- **Build time**: When the binary was compiled |
| 62 | +- **Commit SHA**: Full Git commit hash for precise version tracking |
| 63 | +- **Commit time**: When the source code commit was made |
| 64 | +- **Commit branch**: The Git branch used for the build |
| 65 | +- **Rustc channel**: Rust compiler channel (stable/beta/nightly) |
| 66 | +- **Rustc version**: Exact Rust compiler version used |
| 67 | + |
| 68 | +### Verifying Your Installation |
| 69 | + |
| 70 | +Always verify your node version after installation or updates: |
| 71 | + |
| 72 | +```bash |
| 73 | +# For Docker users |
| 74 | +docker run --rm o1labs/mina-rust:latest build-info | grep "Version\|branch" |
| 75 | + |
| 76 | +# For native binary users |
| 77 | +mina build-info | grep "Version\|branch" |
| 78 | +``` |
| 79 | + |
| 80 | +## Monitoring Your Node |
| 81 | + |
| 82 | +### View Logs |
| 83 | + |
| 84 | +For Docker Compose setups: |
| 85 | + |
| 86 | +```bash |
| 87 | +# View all logs |
| 88 | +docker compose logs -f |
| 89 | + |
| 90 | +# View only node logs |
| 91 | +docker compose logs -f mina-rust-node |
| 92 | + |
| 93 | +# View last 100 lines |
| 94 | +docker compose logs --tail=100 mina-rust-node |
| 95 | +``` |
| 96 | + |
| 97 | +For Docker containers: |
| 98 | + |
| 99 | +```bash |
| 100 | +# View container logs |
| 101 | +docker logs -f mina-rust-node |
| 102 | + |
| 103 | +# View with timestamps |
| 104 | +docker logs -f -t mina-rust-node |
| 105 | +``` |
| 106 | + |
| 107 | +### Check Node Status |
| 108 | + |
| 109 | +```bash |
| 110 | +# Check if containers are running |
| 111 | +docker compose ps |
| 112 | + |
| 113 | +# Or for individual containers |
| 114 | +docker ps | grep mina |
| 115 | +``` |
| 116 | + |
| 117 | +### Resource Usage |
| 118 | + |
| 119 | +Monitor CPU and memory usage: |
| 120 | + |
| 121 | +```bash |
| 122 | +# Docker stats |
| 123 | +docker stats mina-rust-node |
| 124 | + |
| 125 | +# System resources |
| 126 | +htop |
| 127 | +# or |
| 128 | +top |
| 129 | +``` |
| 130 | + |
| 131 | +## Common Management Tasks |
| 132 | + |
| 133 | +### Restart Your Node |
| 134 | + |
| 135 | +```bash |
| 136 | +# Using Docker Compose |
| 137 | +docker compose restart |
| 138 | + |
| 139 | +# Or stop and start |
| 140 | +docker compose down |
| 141 | +docker compose up -d |
| 142 | +``` |
| 143 | + |
| 144 | +### Update Your Node |
| 145 | + |
| 146 | +```bash |
| 147 | +# Pull latest images |
| 148 | +docker compose pull |
| 149 | + |
| 150 | +# Restart with new images |
| 151 | +docker compose up -d --force-recreate |
| 152 | +``` |
| 153 | + |
| 154 | +### Backup Configuration |
| 155 | + |
| 156 | +Always backup your keys and configuration: |
| 157 | + |
| 158 | +```bash |
| 159 | +# Backup producer key (if running block producer) |
| 160 | +cp -r mina-workdir/producer-key ~/mina-backup/ |
| 161 | + |
| 162 | +# Backup entire working directory |
| 163 | +tar -czf mina-backup-$(date +%Y%m%d).tar.gz mina-workdir/ |
| 164 | +``` |
| 165 | + |
| 166 | +### Managing File Permissions |
| 167 | + |
| 168 | +Docker containers often run as root, creating files owned by root on your host: |
| 169 | + |
| 170 | +```bash |
| 171 | +# Check file ownership |
| 172 | +ls -la mina-workdir/ |
| 173 | + |
| 174 | +# Fix ownership for all files in mina-workdir |
| 175 | +sudo chown -R $(id -u):$(id -g) mina-workdir/ |
| 176 | + |
| 177 | +# Set appropriate permissions for the producer key |
| 178 | +chmod 600 mina-workdir/producer-key |
| 179 | +``` |
| 180 | + |
| 181 | +<!-- prettier-ignore-start --> |
| 182 | + |
| 183 | +:::tip |
| 184 | + |
| 185 | +Best Practice Always fix file ownership after Docker operations to ensure your |
| 186 | +local user can properly access, backup, and manage the files. This is especially |
| 187 | +important for sensitive files like producer keys. |
| 188 | + |
| 189 | +::: |
| 190 | + |
| 191 | +<!-- prettier-ignore-stop --> |
| 192 | + |
| 193 | +## Troubleshooting |
| 194 | + |
| 195 | +### Node Won't Start |
| 196 | + |
| 197 | +1. Check build info to verify correct version |
| 198 | +2. Review logs for errors: |
| 199 | + ```bash |
| 200 | + docker compose logs --tail=100 |
| 201 | + ``` |
| 202 | +3. Verify ports are available: |
| 203 | + ```bash |
| 204 | + netstat -tuln | grep -E "8302|3000|8070" |
| 205 | + ``` |
| 206 | + |
| 207 | +### Missing .env File Error |
| 208 | + |
| 209 | +If you see an error like "env file .env not found", Docker Compose needs |
| 210 | +environment variables: |
| 211 | + |
| 212 | +**For regular node and block producer:** |
| 213 | + |
| 214 | +```bash |
| 215 | +# Quick fix: Create an empty .env file (has defaults) |
| 216 | +touch .env |
| 217 | + |
| 218 | +# Or create with custom settings |
| 219 | +cat > .env << EOF |
| 220 | +MINA_RUST_TAG=latest |
| 221 | +MINA_FRONTEND_TAG=latest |
| 222 | +MINA_LIBP2P_PORT=8302 |
| 223 | +MINA_LIBP2P_EXTERNAL_IP= |
| 224 | +MINA_PRIVKEY_PASS= |
| 225 | +COINBASE_RECEIVER= |
| 226 | +EOF |
| 227 | +``` |
| 228 | + |
| 229 | +**For archive node (required):** |
| 230 | + |
| 231 | +```bash |
| 232 | +# Archive node requires specific database settings |
| 233 | +cat > .env << EOF |
| 234 | +POSTGRES_PASSWORD=mina |
| 235 | +PG_PORT=5432 |
| 236 | +PG_DB=archive |
| 237 | +MINA_RUST_TAG=latest |
| 238 | +EOF |
| 239 | +``` |
| 240 | + |
| 241 | +Regular node docker-compose files have default values, but the archive node |
| 242 | +docker-compose file requires the `.env` file with PostgreSQL configuration. |
| 243 | + |
| 244 | +### Connection Issues |
| 245 | + |
| 246 | +1. Verify external IP configuration |
| 247 | +2. Check firewall rules |
| 248 | +3. Test connectivity: |
| 249 | + ```bash |
| 250 | + telnet <external-ip> 8302 |
| 251 | + ``` |
| 252 | + |
| 253 | +### Performance Issues |
| 254 | + |
| 255 | +1. Check system resources: |
| 256 | + ```bash |
| 257 | + free -h |
| 258 | + df -h |
| 259 | + docker stats |
| 260 | + ``` |
| 261 | +2. Review node logs for warnings |
| 262 | +3. Consider adjusting Docker resource limits |
| 263 | + |
| 264 | +## Best Practices |
| 265 | + |
| 266 | +1. **Regular Version Checks**: Always verify your node version after updates |
| 267 | +2. **Log Monitoring**: Set up log rotation and monitoring |
| 268 | +3. **Backup Strategy**: Regular backups of keys and configuration |
| 269 | +4. **Update Schedule**: Plan updates during low-activity periods |
| 270 | +5. **Version Documentation**: Keep track of which versions you're running |
| 271 | + |
| 272 | +## Next Steps |
| 273 | + |
| 274 | +- [Network Configuration](network-configuration) - Configure network settings |
| 275 | +- [Block Producer](block-producer) - Set up block production |
| 276 | +- [Archive Node](archive-node) - Run an archive node |
0 commit comments