|
| 1 | +--- |
| 2 | +sidebar_position: 7 |
| 3 | +title: Network Configuration |
| 4 | +description: |
| 5 | + Learn about OpenMina's network configuration and how to contribute to the |
| 6 | + default peer list |
| 7 | +slug: /node-runners/network-configuration |
| 8 | +--- |
| 9 | + |
| 10 | +# Network Configuration |
| 11 | + |
| 12 | +This guide explains OpenMina's network configuration and how you can contribute |
| 13 | +to improving the network's connectivity. |
| 14 | + |
| 15 | +## Default Peers |
| 16 | + |
| 17 | +OpenMina includes hardcoded default peers for both mainnet and devnet networks |
| 18 | +to ensure reliable initial connectivity. These peers are defined in the |
| 19 | +[`devnet::default_peers()`](https://o1-labs.github.io/openmina/api-docs/openmina_core/network/devnet/fn.default_peers.html) |
| 20 | +and |
| 21 | +[`mainnet::default_peers()`](https://o1-labs.github.io/openmina/api-docs/openmina_core/network/mainnet/fn.default_peers.html) |
| 22 | +functions in `core/src/network.rs`. |
| 23 | + |
| 24 | +### Mainnet Default Peers |
| 25 | + |
| 26 | +The mainnet configuration includes a curated list of reliable seed nodes |
| 27 | +operated by various community members and organizations. These peers help new |
| 28 | +nodes bootstrap their connection to the Mina Protocol network. |
| 29 | + |
| 30 | +### Devnet Default Peers |
| 31 | + |
| 32 | +The devnet configuration includes seed nodes specifically for development and |
| 33 | +testing purposes, allowing developers to connect to the test network. |
| 34 | + |
| 35 | +## Contributing to Default Peers |
| 36 | + |
| 37 | +The Mina community welcomes contributions to improve network connectivity by |
| 38 | +adding reliable seed nodes to the default peer lists. |
| 39 | + |
| 40 | +### Requirements for Peer Contribution |
| 41 | + |
| 42 | +To contribute a seed node to the default peer list, your node should meet these |
| 43 | +criteria: |
| 44 | + |
| 45 | +- **High Availability**: Node should have >99% uptime |
| 46 | +- **Stable Network**: Reliable internet connection with sufficient bandwidth |
| 47 | +- **Proper Configuration**: Correctly configured Mina Protocol node |
| 48 | +- **Long-term Commitment**: Willingness to maintain the node for extended |
| 49 | + periods |
| 50 | +- **Network Security**: Secure server setup and regular maintenance |
| 51 | + |
| 52 | +### Contribution Process |
| 53 | + |
| 54 | +#### 1. Via OpenMina Repository |
| 55 | + |
| 56 | +For OpenMina-specific peer additions: |
| 57 | + |
| 58 | +1. Fork the [OpenMina repository](https://github.com/o1-labs/openmina) |
| 59 | +2. Edit the appropriate default peer list in `core/src/network.rs`: |
| 60 | + - For mainnet: Update the |
| 61 | + [`mainnet::default_peers()`](https://o1-labs.github.io/openmina/api-docs/openmina_core/network/mainnet/fn.default_peers.html) |
| 62 | + function |
| 63 | + - For devnet: Update the |
| 64 | + [`devnet::default_peers()`](https://o1-labs.github.io/openmina/api-docs/openmina_core/network/devnet/fn.default_peers.html) |
| 65 | + function |
| 66 | +3. Add your peer's multiaddr in the format: |
| 67 | + ```rust |
| 68 | + "/ip4/YOUR_IP/tcp/PORT/p2p/YOUR_PEER_ID", |
| 69 | + ``` |
| 70 | +4. Submit a pull request with: |
| 71 | + - Description of your node setup |
| 72 | + - Expected uptime and maintenance commitment |
| 73 | + - Contact information for node operator |
| 74 | + |
| 75 | +#### 2. Via Official Seeds Repository |
| 76 | + |
| 77 | +For broader Mina Protocol peer contributions, consider using the official seeds |
| 78 | +repository: |
| 79 | + |
| 80 | +1. Visit the |
| 81 | + [Mina Foundation Seeds Repository](https://github.com/o1-labs/seeds) |
| 82 | +2. Follow their contribution guidelines: |
| 83 | + - Fork the repository |
| 84 | + - Add your seed to the appropriate network list file |
| 85 | + - Ensure all pre-commit checks pass |
| 86 | + - Submit a pull request with detailed explanation |
| 87 | + - Wait for maintainer review and potential merge |
| 88 | + |
| 89 | +The seeds repository maintains the canonical list of seed nodes accessible at: |
| 90 | + |
| 91 | +- https://bootnodes.minaprotocol.com/networks/mainnet.txt for mainnet |
| 92 | +- https://bootnodes.minaprotocol.com/networks/devnet.txt for devnet |
| 93 | + |
| 94 | +### Peer Address Format |
| 95 | + |
| 96 | +Peer addresses use the multiaddr format: |
| 97 | + |
| 98 | +``` |
| 99 | +/dns4/hostname/tcp/port/p2p/peer_id |
| 100 | +/ip4/ip_address/tcp/port/p2p/peer_id |
| 101 | +``` |
| 102 | + |
| 103 | +Where: |
| 104 | + |
| 105 | +- `hostname` or `ip_address`: Your node's network address |
| 106 | +- `port`: The port your node can be reached out to |
| 107 | +- `peer_id`: Your node's unique peer identifier |
| 108 | + |
| 109 | +### Testing Your Contribution |
| 110 | + |
| 111 | +Before submitting a peer contribution: |
| 112 | + |
| 113 | +1. **Verify Connectivity**: Ensure your node is accessible from the internet |
| 114 | +2. **Test Peer Discovery**: Confirm other nodes can discover and connect to |
| 115 | + yours |
| 116 | +3. **Check Network Compatibility**: Verify your node works with both OCaml and |
| 117 | + Rust implementations |
| 118 | +4. **Monitor Performance**: Ensure stable performance under normal network load |
| 119 | + |
| 120 | +### Node Operation Best Practices |
| 121 | + |
| 122 | +When running a seed node: |
| 123 | + |
| 124 | +- **Monitor Uptime**: Use monitoring tools to track node availability |
| 125 | +- **Regular Updates**: Keep your node software up to date |
| 126 | +- **Resource Management**: Ensure adequate CPU, memory, and bandwidth |
| 127 | +- **Security Measures**: Implement proper firewall and security configurations |
| 128 | +- **Documentation**: Maintain documentation of your node's configuration |
| 129 | + |
| 130 | +### Community Resources |
| 131 | + |
| 132 | +- **GitHub Discussions**: Join discussions on the OpenMina repository |
| 133 | +- **Discord**: Connect with the community on the |
| 134 | + [Mina Protocol Discord](https://discord.com/channels/484437221055922177/1290662938734231552) |
| 135 | +- **Forums**: Participate in |
| 136 | + [Mina Protocol Forums](https://forums.minaprotocol.com/) |
| 137 | + |
| 138 | +## Advanced Network Configuration |
| 139 | + |
| 140 | +### Custom Peer Lists |
| 141 | + |
| 142 | +While OpenMina uses default peers for initial connectivity, you can configure |
| 143 | +your node to use custom peer lists using command-line options: |
| 144 | + |
| 145 | +#### Adding Individual Peers |
| 146 | + |
| 147 | +Use the `--peers` (or `-P`) argument to add individual peers: |
| 148 | + |
| 149 | +```bash |
| 150 | +openmina node \ |
| 151 | + --peers /ip4/192.168.1.100/tcp/8302/p2p/12D3KooW... \ |
| 152 | + --peers /dns4/seed.example.com/tcp/8302/p2p/12D3KooW... |
| 153 | +``` |
| 154 | + |
| 155 | +#### Loading Peers from File |
| 156 | + |
| 157 | +Use the `--peer-list-file` argument to load peers from a local file: |
| 158 | + |
| 159 | +```bash |
| 160 | +openmina node --peer-list-file /path/to/peers.txt |
| 161 | +``` |
| 162 | + |
| 163 | +The file should contain one multiaddr per line: |
| 164 | + |
| 165 | +``` |
| 166 | +/ip4/192.168.1.100/tcp/8302/p2p/12D3KooWExample1... |
| 167 | +/dns4/seed1.example.com/tcp/8302/p2p/12D3KooWExample2... |
| 168 | +/ip4/10.0.0.50/tcp/8302/p2p/12D3KooWExample3... |
| 169 | +``` |
| 170 | + |
| 171 | +#### Loading Peers from URL |
| 172 | + |
| 173 | +Use the `--peer-list-url` argument to load peers from a remote URL: |
| 174 | + |
| 175 | +```bash |
| 176 | +openmina node --peer-list-url https://example.com/peers.txt |
| 177 | +``` |
| 178 | + |
| 179 | +This is useful for loading community-maintained peer lists or using dynamic peer |
| 180 | +discovery services. |
| 181 | + |
| 182 | +#### Seed Mode |
| 183 | + |
| 184 | +Use the `--seed` flag to run your node as a seed node without connecting to |
| 185 | +default peers: |
| 186 | + |
| 187 | +```bash |
| 188 | +openmina node --seed |
| 189 | +``` |
| 190 | + |
| 191 | +This is useful when running your own network or when you want to rely entirely |
| 192 | +on custom peer lists. |
| 193 | + |
| 194 | +### Network Monitoring |
| 195 | + |
| 196 | +Monitor your node's network connectivity through: |
| 197 | + |
| 198 | +- OpenMina's built-in dashboard |
| 199 | +- Peer connection metrics |
| 200 | +- Network synchronization status |
| 201 | + |
| 202 | +## Troubleshooting |
| 203 | + |
| 204 | +### Common Connectivity Issues |
| 205 | + |
| 206 | +- **Firewall Blocking**: Ensure the libp2p port is open |
| 207 | +- **NAT Configuration**: Configure port forwarding if behind NAT |
| 208 | +- **Peer Discovery**: Check if your node appears in other nodes' peer lists |
| 209 | +- **Network Segmentation**: Verify connectivity to multiple network regions |
| 210 | + |
| 211 | +For additional troubleshooting and support, visit our |
| 212 | +[GitHub repository](https://github.com/o1-labs/openmina) or reach out to the |
| 213 | +community for assistance. |
0 commit comments