Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nodesfinder
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tools
nodesfinder
Commits
00d1ed47
Commit
00d1ed47
authored
3 years ago
by
matograine
Browse files
Options
Downloads
Patches
Plain Diff
show right endpoint for Cesium.
parent
18b395a7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
endpoint.js
+5
-3
5 additions, 3 deletions
endpoint.js
node.js
+7
-9
7 additions, 9 deletions
node.js
with
12 additions
and
12 deletions
endpoint.js
+
5
−
3
View file @
00d1ed47
...
...
@@ -99,10 +99,10 @@ class BMAEndpoint{
this
.
url_root
=
''
;
switch
(
this
.
type
)
{
case
'
BMA
'
:
this
.
url_ro
ot
+
=
"
http://
"
this
.
url_
p
ro
tocol
=
"
http://
"
break
case
'
BMAS
'
:
this
.
url_ro
ot
+
=
"
https://
"
this
.
url_
p
ro
tocol
=
"
https://
"
break
default
:
return
false
...
...
@@ -126,11 +126,13 @@ class BMAEndpoint{
this
.
url_root
+=
this
.
path
}
this
.
url_base
=
this
.
url_protocol
+
this
.
url_root
return
true
;
}
get_head
=
async
function
()
{
let
url_block
=
this
.
url_root
+
'
/blockchain/current
'
let
url_block
=
this
.
url_protocol
+
this
.
url_root
+
'
/blockchain/current
'
console
.
log
(
this
.
url_block
)
let
start
=
Date
.
now
();
let
config
=
{
...
...
This diff is collapsed.
Click to expand it.
node.js
+
7
−
9
View file @
00d1ed47
class
DuniterNodes
{
constructor
(
peerings
)
{
this
.
fields
=
[
'
url_root
'
,
'
head_block
'
,
'
type
'
]
this
.
fields
=
[
'
url_root
'
,
'
head_block
'
,
'
type
'
,
'
speed
'
]
this
.
ep_body
=
document
.
createElement
(
'
tbody
'
)
this
.
draw
()
...
...
@@ -47,7 +47,7 @@ class DuniterNodes
this
.
written_urls
=
[]
let
new_tbody
=
document
.
createElement
(
'
tbody
'
)
if
(
endpoint
.
reachable
&&
!
this
.
written_urls
.
includes
(
endpoint
.
url_
root
)
)
{
if
(
endpoint
.
reachable
&&
!
this
.
written_urls
.
includes
(
endpoint
.
url_
base
)
)
{
// count blocks for majority
if
(
!
this
.
count_blocks
[
'
b_
'
+
endpoint
.
head_block
])
{
...
...
@@ -62,8 +62,8 @@ class DuniterNodes
while
(
this
.
endpoints
[
0
]
&&
this
.
endpoints
[
0
].
head_block
>=
endpoint
.
head_block
)
{
let
current_ep
=
this
.
endpoints
.
shift
()
if
(
!
this
.
written_urls
.
includes
(
current_ep
.
url_
root
))
{
this
.
written_urls
.
push
(
current_ep
.
url_
root
)
if
(
!
this
.
written_urls
.
includes
(
current_ep
.
url_
base
))
{
this
.
written_urls
.
push
(
current_ep
.
url_
base
)
}
new_tbody
.
appendChild
(
current_ep
.
row
)
...
...
@@ -74,8 +74,8 @@ class DuniterNodes
// draw empty elements
this
.
endpoints
.
forEach
(
ep
=>
{
ep
.
draw_row
(
this
.
fields
)
if
(
!
this
.
written_urls
.
includes
(
ep
.
url_
root
))
{
this
.
written_urls
.
push
(
ep
.
url_
root
)
if
(
!
this
.
written_urls
.
includes
(
ep
.
url_
base
))
{
this
.
written_urls
.
push
(
ep
.
url_
base
)
new_tbody
.
appendChild
(
ep
.
row
)
}
})
...
...
@@ -88,7 +88,6 @@ class DuniterNodes
}
draw
()
{
this
.
ep_table
=
document
.
getElementById
(
'
endpoints_table
'
)
this
.
ep_table
.
innerHTML
=
''
this
.
ep_table
.
appendChild
(
this
.
ep_body
)
...
...
@@ -125,7 +124,6 @@ class DuniterNodes
}
})
console
.
log
(
consensus_block
)
return
consensus_block
}
}
\ No newline at end of file
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