Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ginkgo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vjrj
ginkgo
Commits
e89c3fc4
Commit
e89c3fc4
authored
6 months ago
by
vjrj
Browse files
Options
Downloads
Patches
Plain Diff
Fix for new node checks
parent
52aa4c66
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/g1/api.dart
+18
-2
18 additions, 2 deletions
lib/g1/api.dart
lib/ui/screens/node_list_page.dart
+6
-0
6 additions, 0 deletions
lib/ui/screens/node_list_page.dart
lib/ui/widgets/node_list/node_list_widget.dart
+1
-1
1 addition, 1 deletion
lib/ui/widgets/node_list/node_list_widget.dart
with
25 additions
and
3 deletions
lib/g1/api.dart
+
18
−
2
View file @
e89c3fc4
...
@@ -313,7 +313,9 @@ Future<void> fetchNodesIfNotReady() async {
...
@@ -313,7 +313,9 @@ Future<void> fetchNodesIfNotReady() async {
NodeType
.
duniter
,
NodeType
.
duniter
,
NodeType
.
endpoint
,
NodeType
.
endpoint
,
NodeType
.
duniterIndexer
,
NodeType
.
duniterIndexer
,
NodeType
.
cesiumPlus
NodeType
.
cesiumPlus
,
NodeType
.
datapodEndpoint
,
NodeType
.
ipfsGateway
])
{
])
{
if
(
NodeManager
()
.
nodesWorking
(
type
)
<
3
)
{
if
(
NodeManager
()
.
nodesWorking
(
type
)
<
3
)
{
fetchFutures
.
add
(
fetchNodes
(
type
,
true
));
fetchFutures
.
add
(
fetchNodes
(
type
,
true
));
...
@@ -600,6 +602,8 @@ Future<NodeCheckResult> _pingNode(String node, NodeType type) async {
...
@@ -600,6 +602,8 @@ Future<NodeCheckResult> _pingNode(String node, NodeType type) async {
NodeType.gva: testGVAV1Node,
NodeType.gva: testGVAV1Node,
NodeType.endpoint: testEndPointV2,
NodeType.endpoint: testEndPointV2,
NodeType.duniterIndexer: testDuniterIndexerV2,
NodeType.duniterIndexer: testDuniterIndexerV2,
NodeType.datapodEndpoint: testDuniterDatapodV2,
NodeType.ipfsGateway: testIpfsGateway
};
};
final Future<NodeCheckResult> Function(String node, Duration timeout)
final Future<NodeCheckResult> Function(String node, Duration timeout)
...
@@ -1178,7 +1182,8 @@ Future<NodeCheckResult> testDuniterDatapodV2(
...
@@ -1178,7 +1182,8 @@ Future<NodeCheckResult> testDuniterDatapodV2(
'Node
$node
has errors:
${removeNewlines(response.linkException!.originalException.toString())}
'
);
'Node
$node
has errors:
${removeNewlines(response.linkException!.originalException.toString())}
'
);
result
=
NodeCheckResult
(
currentBlock:
0
,
latency:
wrongNodeDuration
);
result
=
NodeCheckResult
(
currentBlock:
0
,
latency:
wrongNodeDuration
);
}
else
{
}
else
{
final
int
currentBlock
=
response
.
data
?.
hashCode
??
0
;
final
int
currentBlock
=
response
.
data
?.
profiles_aggregate
?.
aggregate
?.
count
??
0
;
result
=
NodeCheckResult
(
result
=
NodeCheckResult
(
currentBlock:
currentBlock
,
currentBlock:
currentBlock
,
latency:
currentBlock
>
0
?
stopwatch
.
elapsed
:
wrongNodeDuration
);
latency:
currentBlock
>
0
?
stopwatch
.
elapsed
:
wrongNodeDuration
);
...
@@ -1186,6 +1191,17 @@ Future<NodeCheckResult> testDuniterDatapodV2(
...
@@ -1186,6 +1191,17 @@ Future<NodeCheckResult> testDuniterDatapodV2(
return
result
;
return
result
;
}
}
Future
<
NodeCheckResult
>
testIpfsGateway
(
String
node
,
Duration
timeout
)
async
{
final
Stopwatch
stopwatch
=
Stopwatch
().
.
start
();
final
Response
response
=
await
http
.
get
(
Uri
.
parse
(
node
))
.
timeout
(
timeout
);
stopwatch
.
stop
();
final
Duration
latency
=
stopwatch
.
elapsed
;
final
int
currentBlock
=
response
.
statusCode
;
final
NodeCheckResult
result
=
NodeCheckResult
(
latency:
latency
,
currentBlock:
currentBlock
);
return
result
;
}
Future
<
NodeCheckResult
>
testGVAV1Node
(
String
node
,
Duration
timeout
)
async
{
Future
<
NodeCheckResult
>
testGVAV1Node
(
String
node
,
Duration
timeout
)
async
{
final
Stopwatch
stopwatch
=
Stopwatch
().
.
start
();
final
Stopwatch
stopwatch
=
Stopwatch
().
.
start
();
// Test GVA with a query
// Test GVA with a query
...
...
This diff is collapsed.
Click to expand it.
lib/ui/screens/node_list_page.dart
+
6
−
0
View file @
e89c3fc4
...
@@ -77,11 +77,17 @@ class NodeListPage extends StatelessWidget {
...
@@ -77,11 +77,17 @@ class NodeListPage extends StatelessWidget {
nodes:
duniterIndexerNodes
,
nodes:
duniterIndexerNodes
,
type:
NodeType
.
duniterIndexer
,
type:
NodeType
.
duniterIndexer
,
currentBlock:
duniterIndexerNodes
[
0
]
.
currentBlock
),
currentBlock:
duniterIndexerNodes
[
0
]
.
currentBlock
),
NodeListHeader
(
type:
NodeType
.
datapodEndpoint
,
nodesCount:
defaultDatapodEndpointNodes
.
length
),
if
(
duniterDataNodes
.
isNotEmpty
)
if
(
duniterDataNodes
.
isNotEmpty
)
NodeListWidget
(
NodeListWidget
(
nodes:
duniterDataNodes
,
nodes:
duniterDataNodes
,
type:
NodeType
.
datapodEndpoint
,
type:
NodeType
.
datapodEndpoint
,
currentBlock:
duniterDataNodes
[
0
]
.
currentBlock
),
currentBlock:
duniterDataNodes
[
0
]
.
currentBlock
),
NodeListHeader
(
type:
NodeType
.
ipfsGateway
,
nodesCount:
defaultIpfsGateways
.
length
),
if
(
ipfsGateways
.
isNotEmpty
)
if
(
ipfsGateways
.
isNotEmpty
)
NodeListWidget
(
NodeListWidget
(
nodes:
ipfsGateways
,
nodes:
ipfsGateways
,
...
...
This diff is collapsed.
Click to expand it.
lib/ui/widgets/node_list/node_list_widget.dart
+
1
−
1
View file @
e89c3fc4
...
@@ -38,7 +38,7 @@ class NodeListWidget extends StatelessWidget {
...
@@ -38,7 +38,7 @@ class NodeListWidget extends StatelessWidget {
title:
Text
(
node
.
url
),
title:
Text
(
node
.
url
),
subtitle:
node
.
latency
<
wrongNode
subtitle:
node
.
latency
<
wrongNode
?
Text
(
?
Text
(
'
${type != NodeType.cesiumPlus ? 'Current block: ${node.currentBlock}
, '
:
'Current docs:
${node.currentBlock}
, '
}
errors:
$
{
node
.
errors
},
latency
(
ms
)
:
$
{
node
.
latency
}
')
'
${type != NodeType.cesiumPlus ?
(type == NodeType.datapodEndpoint ? 'Current profiles: ${node.currentBlock}
, '
:
'Current block:
${node.currentBlock}
, '
)
:
'Current docs:
${node.currentBlock}
, '
}
errors:
$
{
node
.
errors
},
latency
(
ms
)
:
$
{
node
.
latency
}
')
: null,
: null,
leading: node.currentBlock == currentBlock &&
leading: node.currentBlock == currentBlock &&
node.latency < wrongNode
node.latency < wrongNode
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment