Skip to content

Commit 782c604

Browse files
authored
removed certificates, updated docs, update run-self-signed command (erigontech#38)
1 parent 0b3f792 commit 782c604

File tree

12 files changed

+716
-769
lines changed

12 files changed

+716
-769
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ run:
1515
go run ./cmd/diagnostics
1616

1717
run-self-signed:
18-
go run ./cmd/diagnostics --tls.cert _demo-tls/diagnostics.crt --tls.key _demo-tls/diagnostics-key.pem --tls.cacerts _demo-tls/CA-cert.pem
19-
18+
## In order to solw relod UI 404 issue first cd to folder and after run
19+
cd ./cmd/diagnostics && go run .
2020
clean:
2121
rm -rf $(BUILD_DIR)
2222

README.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ Run the application. This may take a while. Expect to see a TLS Handshake error
112112
make run-self-signed
113113
```
114114

115-
To view the application in your browser, go to the URL `https://localhost:8080/ui`. Your browser will likely ask to accept the risks (due to self-signed certificate), do that.
116-
117115
[Link to more information on this step](#how-to-build-and-run)
118116

119117
## Connect the Erigon Node to the Diagnostics System setup
@@ -167,20 +165,16 @@ If metrics are exposed, textual representation of metrics will be displayed in t
167165
# How to connect Erigon node to the diagnostics system
168166
![diagnostics system connection](/_images/diagnostics-connection-anim.gif)
169167
#### Step 1:
170-
The app's diagnostic user interface (UI) will automatically open at https://localhost:8080 after you run one of the following commands:
168+
The app's diagnostic user interface (UI) will automatically open at http://< --metrics.addr --metrics.port> after you run one of the following commands:
171169
```
172-
./_bin/diagnostics --tls.cert demo-tls/diagnostics.crt --tls.key demo-tls/diagnostics-key.pem --tls.cacerts demo-tls/CA-cert.pem
170+
cd ./cmd/diagnostics && go run .
173171
```
174172
or
175173
```
176174
make run-self-signed
177175
```
178176

179-
180177
#### Step 2:
181-
Please note that you may need to accept the security risks associated with the self-signed certificate. This action is required only the first time you access this URL, as your browser will remember your choice for subsequent visits.
182-
183-
#### Step 3:
184178
Follow these steps to create a session:
185179

186180
![create new operation session 1](/_images/create_session_1.png)
@@ -193,28 +187,26 @@ Enter session name which helps you helassociate session with erigon node user
193187

194188
![create new operation session 3](/_images/create_session_3.png)
195189

196-
#### Step 4:
190+
#### Step 3:
197191
Once the new session is successfully created, it will be allocated a unique 8-digit PIN number. You can find this PIN displayed alongside the session in the list of created sessions. Please note that currently, you can only create one session, but support for multiple sessions will be extended in the future.
198192

199-
#### Step 5:
193+
#### Step 4:
200194
Ensure that the Erigon node is already running on your system. Then, open a new console window and run the following command. Be sure to specify the session PIN at the end of the `--diagnostics.url` command line flag. Since the website uses a self-signed certificate without a properly allocated CName, you need to use the `--insecure` flag to establish a connection.
201195

202196
```
203-
./build/bin/erigon support --debug.urls http://localhost:6060 --diagnostics.url https://localhost:8080 --diagnostics.sessions YOUR_SESSION_PIN --insecure
197+
./build/bin/erigon support --debug.urls http://localhost:6060 --diagnostics.url http://< --metrics.addr --metrics.port> --diagnostics.sessions YOUR_SESSION_PIN --insecure
204198
```
205199

206200
Replace `YOUR_SESSION_PIN` with the 8-digit PIN allocated to your session during the previous step. This command will attach the diagnostics tool erigon node using the provided PIN.
207201

208-
#### Step 6:
202+
#### Step 5:
209203
Once the diagnostics tool successfully connects to the Erigon node, return to your web browser and reload the page. This step is necessary to query data from the connected node.
210204

211-
#### Step 7:
212-
Currently diagnostics UI support "Process", "Logs", "Data" tabs
213205
# Architecture of diagnostics system
214206

215207
Following diagram shows schematically how the process of diagnostics works. Erigon nodes that can be diagnosed, need to be running with `--metrics` flag.
216208
Diagnostics system (HTTP/2 website) needs to be running somewhere. For the public use, it can be a website managed by Erigon team, for example. For
217-
personal and testing use, this can be locally run website with self-signed certificates.
209+
personal and testing use, this can be locally run website.
218210

219211
In order to connect Erigon node to the Diagnostics system, user needs to start a process with a command `erigon support`, as described earlier.
220212
The initiations of network connections are shown as solid single arrows. One can see that `erigon support` initiates connections to both Erigon node

_demo-tls/CA-cert.pem

Lines changed: 0 additions & 11 deletions
This file was deleted.

_demo-tls/diagnostics-key.pem

Lines changed: 0 additions & 5 deletions
This file was deleted.

_demo-tls/diagnostics.crt

Lines changed: 0 additions & 11 deletions
This file was deleted.

api/main_handler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ func NewHandler(services APIServices) http.Handler {
3636

3737
r.Mount("/", web.UI)
3838
r.HandleFunc("/snapshot-sync", index)
39-
r.HandleFunc("/network", index)
39+
r.HandleFunc("/sentry-network", index)
40+
r.HandleFunc("/sentinel-network", index)
4041
r.HandleFunc("/logs", index)
4142
r.HandleFunc("/chain", index)
4243
r.HandleFunc("/data", index)

cmd/diagnostics/config.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ var (
1414
listenAddr string
1515
listenPort int
1616
routerPort int
17-
serverKeyFile string
18-
serverCertFile string
19-
caCertFiles []string
2017
insecure bool
2118
maxNodeSessions int
2219
maxUISessions int
@@ -44,11 +41,6 @@ func init() {
4441
rootCmd.Flags().StringVar(&listenAddr, "addr", "localhost", "network interface to listen on")
4542
rootCmd.Flags().IntVar(&listenPort, "port", 8080, "port to listen on")
4643
rootCmd.Flags().IntVar(&routerPort, "rest.port", 0, "port to listen on")
47-
rootCmd.Flags().StringVar(&serverKeyFile, "tls.key", "", "path to server TLS key")
48-
_ = rootCmd.MarkFlagRequired("tls.key")
49-
rootCmd.Flags().StringVar(&serverCertFile, "tls.cert", "", "paths to server TLS certificates")
50-
_ = rootCmd.MarkFlagRequired("tls.cert")
51-
rootCmd.Flags().StringSliceVar(&caCertFiles, "tls.cacerts", []string{}, "comma-separated list of paths to and CAs TLS certificates")
5244
rootCmd.Flags().BoolVar(&insecure, "insecure", false, "whether to use insecure PIN generation for testing purposes (default is false)")
5345
rootCmd.Flags().IntVar(&maxNodeSessions, "node.sessions", 5000, "maximum number of node sessions to allow")
5446
rootCmd.Flags().IntVar(&maxUISessions, "ui.sessions", 5000, "maximum number of UI sessions to allow")

cmd/diagnostics/main.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package main
22

33
import (
44
"context"
5-
"crypto/x509"
65
"fmt"
76
"log"
87
"net/http"
@@ -39,16 +38,6 @@ func main() {
3938
log.Fatalf("session cache creation failed: %v", err)
4039
}
4140

42-
// Initializes and adds the provided certificate to the pool, to be used in TLS config
43-
certPool := x509.NewCertPool()
44-
for _, caCertFile := range caCertFiles {
45-
caCert, err := os.ReadFile(caCertFile)
46-
if err != nil {
47-
log.Fatalf("reading server certificate: %v", err)
48-
}
49-
certPool.AppendCertsFromPEM(caCert)
50-
}
51-
5241
// Passing in the services to REST layer
5342
handlers := api.NewHandler(
5443
api.APIServices{

0 commit comments

Comments
 (0)