From d4987fbf532c03bfce9f4309ec9b7acb9b153c4c Mon Sep 17 00:00:00 2001 From: Cheng Wang Date: Tue, 16 Jul 2024 10:07:24 +0200 Subject: [PATCH 1/3] Initial work --- docs/full-node/config.md | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 docs/full-node/config.md diff --git a/docs/full-node/config.md b/docs/full-node/config.md new file mode 100644 index 00000000..a56828a3 --- /dev/null +++ b/docs/full-node/config.md @@ -0,0 +1,43 @@ +--- +sidebar_position: 10 +title: Configuration +sidebar_label: Configuration +--- + +The configuration of Alephium full node depends on the use case. +To customize the configuration, one could add new key-value items into the `user.conf` file. + +## Mainnet Examples + +### Network Validators + +The default configurations are good enough. There is no need to customize anything. + +### dApp Development + +For dApp development, it's recommended to enable API key and contract events persistence. + +``` +alephium.api.api-key = "" + +alephium.node.event-log.enabled=true +alephium.node.event-log.index-by-tx-id = true +alephium.node.event-log.index-by-block-hash = true +``` + +### Docker Environment + + + +### Mining Pool & Miners + +``` +``` + +## Main Options + +### Network Id + +### API Key + +### Contract Events From ab5291645009a14ff2b9a76d613f019ae98548bd Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Thu, 18 Jul 2024 10:13:35 +0200 Subject: [PATCH 2/3] Improve full node config --- docs/full-node/config.md | 74 ++++++++++++++++++++++++++++++++-------- 1 file changed, 59 insertions(+), 15 deletions(-) diff --git a/docs/full-node/config.md b/docs/full-node/config.md index a56828a3..673cd63e 100644 --- a/docs/full-node/config.md +++ b/docs/full-node/config.md @@ -1,43 +1,87 @@ --- -sidebar_position: 10 +sidebar_position: 12 title: Configuration sidebar_label: Configuration --- -The configuration of Alephium full node depends on the use case. -To customize the configuration, one could add new key-value items into the `user.conf` file. +The configuration of an Alephium full node can be tailored to your +specific use case. To customize the settings, you can add key-value +pairs to the `user.conf` file in +[HOCON](https://github.com/lightbend/config/blob/main/HOCON.md) +format. -## Mainnet Examples +## Examples -### Network Validators +### Non-mining Node -The default configurations are good enough. There is no need to customize anything. +For full node that validates transactions and blocks but doesn't +engage in mining process, the default configurations are generally +good enough, there is usually no need to customize anything. -### dApp Development +### Support dApps -For dApp development, it's recommended to enable API key and contract events persistence. +To support development and operation of dApps, it's recommended to +enable persistence of [contract events](/sdk/events/#contract-events): ``` -alephium.api.api-key = "" - alephium.node.event-log.enabled=true alephium.node.event-log.index-by-tx-id = true alephium.node.event-log.index-by-block-hash = true ``` -### Docker Environment +You can read more about the events configuration +[here](/sdk/events/#configuration). By default, contract events are +turned off to improve storage efficiency. +For public nodes, it is also recommended to enable [API +key](/full-node/full-node-more#api-key) to control access to your full +node's rest endpoints: +``` +alephium.api.api-key = "" +``` ### Mining Pool & Miners +Miners needs to [set up mining +addresses](/mining/solo-mining-guide#miner-wallet) to begin +mining. It is also preferrable to set up external address for the node +to enhance discoverability: + ``` +alephium.network.external-address = "x.x.x.x:9973" // Put your public IP here for better discovery +alephium.mining.miner-addresses = ["1AuWeE5Cwt2ES3473qnpKFV96z57CYL6mbTY7hva9Xz3h", "12sxfxraVoU8FcSVd7P2SVr2cd2vi8d17KtrprrL7cBbV", "1E3vV7rFCgq5jo4NszxH5PqzyxvNXH5pvk2aQfMwmSxPB", "147nW43BH137TYjqEnvA9YfH1oFXKQxcvLZFwZauo7Ahy"] ``` -## Main Options +For mining pools, you can add the following lines in `user.conf` as +well to have better block propagation: -### Network Id +``` +alephium.network.max-outbound-connections-per-group = 48 +alephium.network.max-inbound-connections-per-group = 256 +``` + +### Docker Environment + +For docker environment, it's recommended to mount the local +`user.conf` file into the container: -### API Key +```yaml +volumes: + - ./user.conf:/alephium-home/.alephium/user.conf +``` -### Contract Events +## Main Settings + +| Setting | Description | +|---------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| alephium.network.network-id | `0` for Mainnet, `1` for Testnet, `2` for Devnet. Default is `0`. | +| alephium.network.external-address | External address of the full node to enhance discoverability | +| alephium.api.api-key-enabled | `true` to enable API key for full node's API endpoints. | +| alephium.api.api-key | 32+ characters API key. | +| 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`. | +| 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. | +| alephium.node.event-log.index-by-tx-id | `true` to enable querying events based on transaction id. Default is `false`. | +| alephium.node.event-log.index-by-block-hash | `true` to enable querying events based on block hash. Default is `false`. | +| alephium.wallet.enable | `true` to enable node wallet. Default is `true`. | +| alephium.wallet.locking-timeout | Time of inactivity before node wallet is locked. | From 505b1f5aa8e4c4de1c0178c3f6c3c7dfd190b729 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Thu, 18 Jul 2024 10:14:37 +0200 Subject: [PATCH 3/3] Fix broken link --- docs/5min-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/5min-overview.md b/docs/5min-overview.md index 2ac3fad7..e61a7617 100644 --- a/docs/5min-overview.md +++ b/docs/5min-overview.md @@ -104,7 +104,7 @@ In addition, all the transaction fees are burned with each block and Proof of Le The Total Supply is calculated by adding the tokens mined at the Genesis Block (see breakdown above) and the block rewards since the Mainnet Launch. Alephium uses the CMC method to calculate the circulating supply of ALPH. It consists of: the total number of existing ALPH from which is subtracted the balance (locked & unlocked) from the private sale investors, the treasury, ecosystem, the advisors/contractors, the project-controlled assets and all locked ALPH from other addresses. -In general, you can find our circulating supply on the front page of our [explorer](https://explorer.alephium.org/#/blocks). If you want a more in-depth explanation of the Coin Market Cap methodology, find it [here.](https://support.coinmarketcap.com/hc/en-us/articles/360043396252-Supply-Circulating-Total-Max-) +In general, you can find our circulating supply on the front page of our [explorer](https://explorer.alephium.org). If you want a more in-depth explanation of the Coin Market Cap methodology, find it [here.](https://support.coinmarketcap.com/hc/en-us/articles/360043396252-Supply-Circulating-Total-Max-) If you need the endpoints, find them here: [Total Supply](https://mainnet-backend.alephium.org/infos/supply/total-alph) = [Circulating Supply](https://mainnet-backend.alephium.org/infos/supply/circulating-alph) + [Reserved Supply](https://mainnet-backend.alephium.org/infos/supply/reserved-alph) + [Locked ALPH](https://mainnet-backend.alephium.org/infos/supply/locked-alph)