|
| 1 | +--- |
| 2 | +sidebar_position: 12 |
| 3 | +title: Configuration |
| 4 | +sidebar_label: Configuration |
| 5 | +--- |
| 6 | + |
| 7 | +The configuration of an Alephium full node can be tailored to your |
| 8 | +specific use case. To customize the settings, you can add key-value |
| 9 | +pairs to the `user.conf` file in |
| 10 | +[HOCON](https://github.com/lightbend/config/blob/main/HOCON.md) |
| 11 | +format. |
| 12 | + |
| 13 | +## Examples |
| 14 | + |
| 15 | +### Non-mining Node |
| 16 | + |
| 17 | +For full node that validates transactions and blocks but doesn't |
| 18 | +engage in mining process, the default configurations are generally |
| 19 | +good enough, there is usually no need to customize anything. |
| 20 | + |
| 21 | +### Support dApps |
| 22 | + |
| 23 | +To support development and operation of dApps, it's recommended to |
| 24 | +enable persistence of [contract events](/sdk/events/#contract-events): |
| 25 | + |
| 26 | +``` |
| 27 | +alephium.node.event-log.enabled=true |
| 28 | +alephium.node.event-log.index-by-tx-id = true |
| 29 | +alephium.node.event-log.index-by-block-hash = true |
| 30 | +``` |
| 31 | + |
| 32 | +You can read more about the events configuration |
| 33 | +[here](/sdk/events/#configuration). By default, contract events are |
| 34 | +turned off to improve storage efficiency. |
| 35 | + |
| 36 | +For public nodes, it is also recommended to enable [API |
| 37 | +key](/full-node/full-node-more#api-key) to control access to your full |
| 38 | +node's rest endpoints: |
| 39 | + |
| 40 | +``` |
| 41 | +alephium.api.api-key = "<YOUR KEY with 32+ characters>" |
| 42 | +``` |
| 43 | + |
| 44 | +### Mining Pool & Miners |
| 45 | + |
| 46 | +Miners needs to [set up mining |
| 47 | +addresses](/mining/solo-mining-guide#miner-wallet) to begin |
| 48 | +mining. It is also preferrable to set up external address for the node |
| 49 | +to enhance discoverability: |
| 50 | + |
| 51 | +``` |
| 52 | +alephium.network.external-address = "x.x.x.x:9973" // Put your public IP here for better discovery |
| 53 | +alephium.mining.miner-addresses = ["1AuWeE5Cwt2ES3473qnpKFV96z57CYL6mbTY7hva9Xz3h", "12sxfxraVoU8FcSVd7P2SVr2cd2vi8d17KtrprrL7cBbV", "1E3vV7rFCgq5jo4NszxH5PqzyxvNXH5pvk2aQfMwmSxPB", "147nW43BH137TYjqEnvA9YfH1oFXKQxcvLZFwZauo7Ahy"] |
| 54 | +``` |
| 55 | + |
| 56 | +For mining pools, you can add the following lines in `user.conf` as |
| 57 | +well to have better block propagation: |
| 58 | + |
| 59 | +``` |
| 60 | +alephium.network.max-outbound-connections-per-group = 48 |
| 61 | +alephium.network.max-inbound-connections-per-group = 256 |
| 62 | +``` |
| 63 | + |
| 64 | +### Docker Environment |
| 65 | + |
| 66 | +For docker environment, it's recommended to mount the local |
| 67 | +`user.conf` file into the container: |
| 68 | + |
| 69 | +```yaml |
| 70 | +volumes: |
| 71 | + - ./user.conf:/alephium-home/.alephium/user.conf |
| 72 | +``` |
| 73 | +
|
| 74 | +## Main Settings |
| 75 | +
|
| 76 | +| Setting | Description | |
| 77 | +|---------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 78 | +| alephium.network.network-id | `0` for Mainnet, `1` for Testnet, `2` for Devnet. Default is `0`. | |
| 79 | +| alephium.network.external-address | External address of the full node to enhance discoverability | |
| 80 | +| alephium.api.api-key-enabled | `true` to enable API key for full node's API endpoints. | |
| 81 | +| alephium.api.api-key | 32+ characters API key. | |
| 82 | +| alephium.node.event-log.enabled | `true` to enable storing contract events, so we can query or subscribe events based on contract address. Default is `false`. | |
| 83 | +| alephium.node.event-log.contract-addresses | A list of addresses whose events will be stored. By default, it is `[]`, which means the events for all contracts will be stored if `alephium.node.event-log.enabled` is enabled. | |
| 84 | +| alephium.node.event-log.index-by-tx-id | `true` to enable querying events based on transaction id. Default is `false`. | |
| 85 | +| alephium.node.event-log.index-by-block-hash | `true` to enable querying events based on block hash. Default is `false`. | |
| 86 | +| alephium.wallet.enable | `true` to enable node wallet. Default is `true`. | |
| 87 | +| alephium.wallet.locking-timeout | Time of inactivity before node wallet is locked. | |
0 commit comments