diff --git a/bindings/channels.go b/bindings/channels.go index f58af96029bfeb55ff800e13d6be032185e2823e..78182a190bb63b9f851049c85cb944da50a89454 100644 --- a/bindings/channels.go +++ b/bindings/channels.go @@ -11,6 +11,7 @@ import ( "crypto/ed25519" "encoding/base64" "encoding/json" + jww "github.com/spf13/jwalterweatherman" "sync" "time" @@ -234,6 +235,16 @@ func NewChannelsManagerGoEventModel(cmixID int, privateIdentity []byte, return nil, err } + // fixme: remove this, make it called by the javascript + // hack to get to release late at night + go func() { + time.Sleep(3 * time.Second) + localErr := user.IncreaseParallelNodeRegistration(13) + if localErr != nil { + jww.ERROR.Printf(localErr.Error()) + } + }() + // Add channel to singleton and return return channelManagerTrackerSingleton.make(m), nil } @@ -267,6 +278,16 @@ func LoadChannelsManagerGoEventModel(cmixID int, storageTag string, return nil, err } + // fixme: remove this, make it called by the javascript + // hack to get to release late at night + go func() { + time.Sleep(3 * time.Second) + localErr := user.IncreaseParallelNodeRegistration(13) + if localErr != nil { + jww.ERROR.Printf(localErr.Error()) + } + }() + // Add channel to singleton and return return channelManagerTrackerSingleton.make(m), nil } diff --git a/cmix/parallelNodeRegistrations.go b/cmix/parallelNodeRegistrations.go new file mode 100644 index 0000000000000000000000000000000000000000..48f232901263118fffdc12c7c1ec16d3a2f35aa0 --- /dev/null +++ b/cmix/parallelNodeRegistrations.go @@ -0,0 +1,13 @@ +//////////////////////////////////////////////////////////////////////////////// +// Copyright © 2022 xx foundation // +// // +// Use of this source code is governed by a license that can be found in the // +// LICENSE file. // +//////////////////////////////////////////////////////////////////////////////// + +// This file is compiled for all architectures except WebAssembly. +//go:build !js || !wasm + +package cmix + +const defaultParallelNodeRegistration = 20 diff --git a/cmix/params.go b/cmix/params.go index f15b62feb01f240c90efe88e78281e72eff4dd38..01a606e5b44fdb5d72d1ed851a82598f41ddff6c 100644 --- a/cmix/params.go +++ b/cmix/params.go @@ -100,7 +100,7 @@ func GetDefaultParams() Params { MaxCheckedRounds: 500, RegNodesBufferLen: 1000, NetworkHealthTimeout: 15 * time.Second, - ParallelNodeRegistrations: 2, + ParallelNodeRegistrations: defaultParallelNodeRegistration, KnownRoundsThreshold: 1500, // 5 rounds/sec * 60 sec/min * 5 min FastPolling: true, VerboseRoundTracking: false, diff --git a/cmix/rounds/parallelNodeRegistrations_js.go b/cmix/rounds/parallelNodeRegistrations_js.go new file mode 100644 index 0000000000000000000000000000000000000000..246dcb5327c3c01e3c26427b77c513608978f5f4 --- /dev/null +++ b/cmix/rounds/parallelNodeRegistrations_js.go @@ -0,0 +1,3 @@ +package rounds + +const defaultParallelNodeRegistration = 2