Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
goshimmer
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
iota-imt
goshimmer
Commits
b8ae36a6
Commit
b8ae36a6
authored
4 years ago
by
Levente Pap
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into refactor/message_structure
parents
c57d358b
bbc81bdd
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
dapps/valuetransfers/dapp.go
+1
-5
1 addition, 5 deletions
dapps/valuetransfers/dapp.go
plugins/dashboard/frontend/src/app/stores/NodeStore.ts
+8
-1
8 additions, 1 deletion
plugins/dashboard/frontend/src/app/stores/NodeStore.ts
plugins/dashboard/ws.go
+10
-7
10 additions, 7 deletions
plugins/dashboard/ws.go
with
19 additions
and
13 deletions
dapps/valuetransfers/dapp.go
+
1
−
5
View file @
b8ae36a6
...
@@ -134,14 +134,10 @@ func configure(_ *node.Plugin) {
...
@@ -134,14 +134,10 @@ func configure(_ *node.Plugin) {
tipManager
=
TipManager
()
tipManager
=
TipManager
()
valueObjectFactory
=
ValueObjectFactory
()
valueObjectFactory
=
ValueObjectFactory
()
_tangle
.
Events
.
Payload
Lik
ed
.
Attach
(
events
.
NewClosure
(
func
(
cachedPayloadEvent
*
valuetangle
.
CachedPayloadEvent
)
{
_tangle
.
Events
.
Payload
Confirm
ed
.
Attach
(
events
.
NewClosure
(
func
(
cachedPayloadEvent
*
valuetangle
.
CachedPayloadEvent
)
{
cachedPayloadEvent
.
PayloadMetadata
.
Release
()
cachedPayloadEvent
.
PayloadMetadata
.
Release
()
cachedPayloadEvent
.
Payload
.
Consume
(
tipManager
.
AddTip
)
cachedPayloadEvent
.
Payload
.
Consume
(
tipManager
.
AddTip
)
}))
}))
_tangle
.
Events
.
PayloadDisliked
.
Attach
(
events
.
NewClosure
(
func
(
cachedPayloadEvent
*
valuetangle
.
CachedPayloadEvent
)
{
cachedPayloadEvent
.
PayloadMetadata
.
Release
()
cachedPayloadEvent
.
Payload
.
Consume
(
tipManager
.
RemoveTip
)
}))
// configure FCOB consensus rules
// configure FCOB consensus rules
cfgAvgNetworkDelay
:=
config
.
Node
()
.
Int
(
CfgValueLayerFCOBAverageNetworkDelay
)
cfgAvgNetworkDelay
:=
config
.
Node
()
.
Int
(
CfgValueLayerFCOBAverageNetworkDelay
)
...
...
This diff is collapsed.
Click to expand it.
plugins/dashboard/frontend/src/app/stores/NodeStore.ts
+
8
−
1
View file @
b8ae36a6
...
@@ -207,10 +207,17 @@ export class NodeStore {
...
@@ -207,10 +207,17 @@ export class NodeStore {
this
.
collected_tips_metrics
=
[];
this
.
collected_tips_metrics
=
[];
}
}
reconnect
()
{
this
.
updateWebSocketConnected
(
false
);
setTimeout
(()
=>
{
this
.
connect
();
},
5000
);
}
connect
()
{
connect
()
{
connectWebSocket
(
statusWebSocketPath
,
connectWebSocket
(
statusWebSocketPath
,
()
=>
this
.
updateWebSocketConnected
(
true
),
()
=>
this
.
updateWebSocketConnected
(
true
),
()
=>
this
.
updateWebSocketConnected
(
false
),
()
=>
this
.
reconnect
(
),
()
=>
this
.
updateWebSocketConnected
(
false
))
()
=>
this
.
updateWebSocketConnected
(
false
))
}
}
...
...
This diff is collapsed.
Click to expand it.
plugins/dashboard/ws.go
+
10
−
7
View file @
b8ae36a6
...
@@ -23,7 +23,7 @@ var (
...
@@ -23,7 +23,7 @@ var (
webSocketWriteTimeout
=
time
.
Duration
(
3
)
*
time
.
Second
webSocketWriteTimeout
=
time
.
Duration
(
3
)
*
time
.
Second
// clients
// clients
wsClientsMu
sync
.
Mutex
wsClientsMu
sync
.
RW
Mutex
wsClients
=
make
(
map
[
uint64
]
*
wsclient
)
wsClients
=
make
(
map
[
uint64
]
*
wsclient
)
nextWsClientID
uint64
nextWsClientID
uint64
...
@@ -77,7 +77,7 @@ func registerWSClient() (uint64, *wsclient) {
...
@@ -77,7 +77,7 @@ func registerWSClient() (uint64, *wsclient) {
defer
wsClientsMu
.
Unlock
()
defer
wsClientsMu
.
Unlock
()
clientID
:=
nextWsClientID
clientID
:=
nextWsClientID
wsClient
:=
&
wsclient
{
wsClient
:=
&
wsclient
{
channel
:
make
(
chan
interface
{},
5
00
),
channel
:
make
(
chan
interface
{},
20
00
),
exit
:
make
(
chan
struct
{}),
exit
:
make
(
chan
struct
{}),
}
}
wsClients
[
clientID
]
=
wsClient
wsClients
[
clientID
]
=
wsClient
...
@@ -87,18 +87,21 @@ func registerWSClient() (uint64, *wsclient) {
...
@@ -87,18 +87,21 @@ func registerWSClient() (uint64, *wsclient) {
// removes the websocket client with the given id.
// removes the websocket client with the given id.
func
removeWsClient
(
clientID
uint64
)
{
func
removeWsClient
(
clientID
uint64
)
{
wsClientsMu
.
Lock
()
wsClientsMu
.
RLock
()
defer
wsClientsMu
.
Unlock
()
wsClient
:=
wsClients
[
clientID
]
wsClient
:=
wsClients
[
clientID
]
close
(
wsClient
.
exit
)
close
(
wsClient
.
channel
)
close
(
wsClient
.
channel
)
close
(
wsClient
.
exit
)
wsClientsMu
.
RUnlock
()
wsClientsMu
.
Lock
()
defer
wsClientsMu
.
Unlock
()
delete
(
wsClients
,
clientID
)
delete
(
wsClients
,
clientID
)
}
}
// broadcasts the given message to all connected websocket clients.
// broadcasts the given message to all connected websocket clients.
func
broadcastWsMessage
(
msg
interface
{},
dontDrop
...
bool
)
{
func
broadcastWsMessage
(
msg
interface
{},
dontDrop
...
bool
)
{
wsClientsMu
.
Lock
()
wsClientsMu
.
R
Lock
()
defer
wsClientsMu
.
Unlock
()
defer
wsClientsMu
.
R
Unlock
()
for
_
,
wsClient
:=
range
wsClients
{
for
_
,
wsClient
:=
range
wsClients
{
if
len
(
dontDrop
)
>
0
{
if
len
(
dontDrop
)
>
0
{
select
{
select
{
...
...
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