You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
explorerd: enhance explorerd README with quick-start guide
This commit improves the explorerd documentation by:
- Adding a "Quick-Start Guide" section allowing users to start different explorer node network configurations using a single make command
- Adding "Network Status" section explaining testnet/mainnet availability
- Provided more details and clarifications in the prerequisites section
- Adding "Confirming Successful Start" section with startup banner example
- Adding "Getting Help" section with make help command
- Restructuring documentation with clearer section organization
- Improving guidance for running against different network configurations
@@ -13,22 +13,79 @@ The `explorerd` is designed to handle real-world blockchain events, such as reor
13
13
-**Real-Time Updates**: Leverages DarkFi's subscription interface to receive live block and transaction data.
14
14
-**On-The-Fly Metric Calculations**: Computes analytics and blockchain metrics for use in the Explorer's UI. This includes maintaining data such as running totals, min/max values, and transaction counts when processing blocks, allowing for efficient gas metric calculations without iterating through previous transactions.
15
15
16
-
---
16
+
## Network Status
17
17
18
-
## Getting Started
18
+
The testnet and mainnet configurations serve as placeholders in preparation for their respective launch. When starting daemons with these configurations, each node will connect to their respective darkfid network, but currently only sync the network's genesis block. Once the DarkFi blockchain testnet and mainnet are fully available, the explorer daemon will sync blocks beyond genesis for these networks.
19
19
20
-
### Prerequisites
21
-
Before you begin, ensure you have the following installed and configured:
20
+
## Prerequisites
22
21
23
22
-**Rust 1.86.0 or later**: For building and running the explorer daemon (`explorerd`).
24
-
-**Darkfid**: Installed and configurable using [Darkfid Config](../../darkfid/darkfid_config.toml).
25
-
-**Minerd**: Installed and configurable using [Minerd Config](../../minerd/minerd_config.toml).
23
+
-**Darkfi Project Dependencies**: Dependencies required to compile the Darkfi code. For more details, see [Darkfi Build Dependencies](../../../README.md#build).
24
+
-**Darkfid**: Required for running DarkFi blockchain nodes on respective networks. The make commands build the binary from source code in `../../darkfid` (if not already built in project root) and apply the appropriate network configuration.
25
+
-**Minerd**: Needed for setups where Darkfid is configured with a miner JSON-RPC endpoint, but the configured miner is not running on the desired network. The make commands build the binary from source code in `../../minerd` (if not already built in project root) and apply the appropriate network configuration.
26
26
27
-
---
27
+
## Quick-Start Guide
28
+
29
+
Run the following commands to run a node on respective network.
30
+
31
+
### Start a Localnet Node
32
+
33
+
```sh
34
+
# Run a node using localnet configuration
35
+
make start-localnet
36
+
```
37
+
38
+
### Start a Testnet Node
39
+
40
+
```sh
41
+
# Run a node using testnet configuration
42
+
make start-testnet
43
+
```
44
+
45
+
### Start a Mainnet Node
46
+
47
+
```sh
48
+
# Run a node using mainnet configuration
49
+
make start-mainnet
50
+
```
51
+
52
+
### Stopping the Node
53
+
54
+
```sh
55
+
# Stop the running explorer node
56
+
make stop
57
+
```
58
+
59
+
### Confirming Successful Start
60
+
61
+
When a DarkFi Explorer Node successfully starts, users should a startup banner displaying the node's configuration details and current sync status. Here is a successful localnet node startup example:
The `explorerd` uses a TOML configuration file to manage different environment settings, located at [Explorerd Config](explorerd_config.toml). If no configuration file is provided, a default configuration file is automatically generated at`~/.config/darkfi/explorerd_config.toml` the first time the `explorerd` daemon is run. This pre-configured `explorerd` configuration is set up to connect to the DarkFi `darkfid` localnet, testnet, and mainnet networks.
88
+
The `explorerd` uses a TOML configuration file to manage different network settings, located at [Explorerd Config](explorerd_config.toml). These settings are configured to automatically connect to DarkFi blockchain nodes running on localnet, testnet, and mainnet. When running an explorer daemon for the first time without a configuration file, the default configuration file is automatically copied to`~/.config/darkfi/explorerd_config.toml`. Once this file exists, running explorerd again will automatically start a node based on this configuration.
**Note**: When updating the configuration, ensure the `endpoint` field matches the `rpc_listen` endpoint in the respective `darkfid` configuration, and that the `database` and `rpc_listen` paths are consistent with your environment.
59
116
60
-
---
61
-
62
-
### Supported DarkFi Blockchain Networks
63
-
64
-
The `explorerd` daemon is pre-configured to support the following DarkFi blockchain environments:
117
+
#### Supported DarkFi Blockchain Networks
65
118
66
-
-**`localnet`**: Ideal for development and testing in a local environment using `darkfid`'s localnet configuration.
67
-
-**`testnet`**: Used for testing the explorer with `darkfid`'s testnet network (pending availability).
68
-
-**`mainnet`**: The production environment for running the explorer on DarkFi's canonical chain (pending availability).
119
+
The explorer daemon comes pre-configured to automatically connect to the following DarkFi's blockchain environments:
120
+
-**`localnet`**: For development and testing in a local environment
121
+
-**`testnet`**: For testing on DarkFi's test network (pending availability)
122
+
-**`mainnet`**: For production use on DarkFi's main network (pending availability)
69
123
70
-
These blockchain environments are defined in the `darkfid` configuration file, located at[Darkfid Config](../darkfid/darkfid_config.toml). The pre-configured `explorerd` network settings are configured to connect to the `darkfid` nodes running these networks.
124
+
For more details about these darkfid networks, see the[Darkfid Configuration](../../darkfid/darkfid_config.toml).
71
125
72
126
> **Note**: Once the testnet and mainnet are fully available, the explorer will sync more than just the genesis blocks for these networks.
73
127
74
-
###Installation
128
+
#### Custom Configuration
75
129
76
-
Navigate to the `explorerd`directory, build the binary using `make`, and install it:
130
+
To create a custom explorerd configuration, use [Explorerd Configuration](../explorerd_config.toml) as a template and modify it as needed. Ensure that the `endpoint` in the `explorerd`configuration matches the `rpc_listen` value in the corresponding `darkfid_config.toml` file, enabling proper connection to the corresponding DarkFi blockchain node.
77
131
78
-
```bash
79
-
cd bin/explorer/explorerd
80
-
make install
81
-
```
132
+
**Example Alignment**:
82
133
83
-
> Use `make` without `install` to build the `explorerd` binary in `bin/explorerd` without installing it.
134
+
-`darkfid_config.toml`:
84
135
85
-
---
136
+
```toml
137
+
[network_config."localnet".rpc]
138
+
rpc_listen = "tcp://127.0.0.1:8240"
139
+
```
140
+
141
+
-`explorerd_config.toml`:
86
142
87
-
### Running the Daemon
143
+
```toml
144
+
[network_config."localnet"]
145
+
endpoint = "tcp://127.0.0.1:8240"
146
+
```
88
147
89
-
#### 1. Configure the Daemons
148
+
###Installation
90
149
91
-
-**For Darkfid Localnet**: Explorerd is pre-configured to connect to the respective `darkfid` networks. No additional configuration is required when running `explorerd` without a configuration file.
92
-
-**For Custom Configurations**: To create a custom configuration file, use [explorerd_config.toml](../explorerd_config.toml) as a template and modify it as needed. Ensure that the `endpoint` in the `explorerd` configuration matches the `rpc_listen` value in the corresponding `darkfid_config.toml` file, enabling proper connection to the corresponding DarkFi blockchain node.
150
+
The `explorerd` binary can be installed to your system path using the `make install` command, which places it in `~/.cargo/bin/explorerd`. This directory is typically included in your PATH, making the command accessible system-wide.
93
151
94
-
**Example Alignment**:
152
+
From the `explorerd` directory:
95
153
96
-
-`darkfid_config.toml`:
97
-
98
-
```toml
99
-
[network_config."localnet".rpc]
100
-
rpc_listen = "tcp://127.0.0.1:8240"
101
-
```
102
-
103
-
- `explorerd_config.toml`:
104
-
105
-
```toml
106
-
[network_config."localnet"]
107
-
endpoint = "tcp://127.0.0.1:8240"
108
-
```
154
+
```bash
155
+
make install
156
+
```
109
157
110
-
- **For Contrib/Localnet Networks**: If you're using a `contrib/localnet` network, update the `endpoint` in your `explorerd_config.toml` to match the `rpc_listen` endpoint in the respective darkfid configuration.
158
+
> Use `make` without `install`to build the `explorerd` binary in `bin/explorerd` without installing it.
111
159
112
-
> For information on configuring `darkfid` and `minerd`, refer to their respective documentation.
160
+
### Running an Explorer Node
113
161
114
-
#### 2. Start Supporting Daemons
162
+
#### 1. Start Supporting Nodes
115
163
116
-
##### Running Against `darkfid's localnet`
164
+
##### Using darkfid's networks
117
165
118
-
Start the `minerd` and `darkfid` daemons using their default configurations.
166
+
Start the `minerd` and `darkfid` daemons using their configurations.
119
167
120
168
```bash
121
-
# Start the mining daemon using default settings
169
+
# Start the mining daemon
122
170
minerd
123
171
124
-
# Start darkfid using default settings on localnet
172
+
# Start darkfid (example uses localnet)
125
173
darkfid --network localnet
126
174
```
127
175
128
-
##### Running Against `contrib/localnet/darkfid-single-node`
176
+
> Replace `localnet` with `testnet` or `mainnet` to connect to those networks instead.
129
177
130
-
Run the DarkFi single-node.
178
+
##### Using the single-node development environment
179
+
180
+
Run the DarkFi single-node development environment.
131
181
132
182
```bash
133
-
# Change directory and start contrib/localnet/singlenode
183
+
# Change directory and start the single-node environment
134
184
cd contrib/localnet/darkfid-single-node
135
185
./tmux_sessions.sh
136
186
```
187
+
> Ensure you update your explorerd configuration file to point to the single node network
188
+
189
+
#### 2. Start the `explorerd` Daemon
137
190
138
-
#### 3. Start the `explorerd` Daemon
139
-
##### Syncing with `darkfid's localnet`
191
+
##### Connecting to darkfid networks
140
192
141
-
Run the `explorerd` daemon to sync with `darkfid's` localnet blockchain data.
193
+
Run the `explorerd` daemon to sync with the darkfid instance.
142
194
143
195
```bash
144
-
# Start the explorer daemon using pre-configured localnet configuration
196
+
# Start the explorer daemon (example uses localnet)
145
197
explorerd --network localnet
146
198
```
147
199
148
-
##### Syncing with Custom DarkFi Blockchain Endpoint
200
+
> Replace `localnet` with `testnet` or `mainnet` to connect to those networks instead.
201
+
202
+
##### Connecting to custom networks
149
203
150
-
Run the `explorerd` daemon using a custom configuration with updated `darkfid` endpoint:
204
+
To connect to a custom blockchain network, provide a configuration file with your specific network settings:
> Ensure the `endpoint` in `explorerd-config.toml` is updated to match the desired `darkfid` endpoint.
158
-
159
-
---
211
+
> Update the `endpoint` in your `explorerd-config.toml` to point to your custom `darkfid` instance. The `--network` parameter can be set to `localnet`, `testnet`, or `mainnet` to match your target network configuration.
0 commit comments