Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
5a94e08f
Commit
5a94e08f
authored
Jun 15, 2021
by
袁兴强
Browse files
Options
Browse Files
Download
Plain Diff
merge chain33
parents
0fbb2615
263a00cf
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
19 additions
and
2 deletions
+19
-2
Makefile
Makefile
+1
-1
go.sum
go.sum
+0
-0
dpos_test.go
plugin/consensus/dpos/dpos_test.go
+1
-0
node_test.go
plugin/consensus/dpos/node_test.go
+1
-0
pbft_test.go
plugin/consensus/pbft/pbft_test.go
+1
-0
chain33.cfg.toml
plugin/consensus/ticket/testdata/chain33.cfg.toml
+1
-1
vote_test.go
plugin/dapp/dposvote/commands/vote_test.go
+1
-0
game_test.go
plugin/dapp/guess/commands/game_test.go
+1
-0
guess_test.go
plugin/dapp/guess/rpc/guess_test.go
+1
-0
cfg.go
plugin/dapp/paracross/testnode/cfg.go
+1
-0
p2p.go
plugin/p2p/gossip/p2p.go
+10
-0
No files found.
Makefile
View file @
5a94e08f
...
@@ -26,7 +26,7 @@ build: depends
...
@@ -26,7 +26,7 @@ build: depends
build_ci
:
depends
##
Build the binary file for CI
build_ci
:
depends
##
Build the binary file for CI
@
go build
-v
-
i
-
o
$(CLI)
$(SRC_CLI)
@
go build
-v
-o
$(CLI)
$(SRC_CLI)
@
go build
$(BUILD_FLAGS)
-v
-o
$(APP)
@
go build
$(BUILD_FLAGS)
-v
-o
$(APP)
@
cp
chain33.toml build/
@
cp
chain33.toml build/
@
cp
chain33.para.toml build/ci/paracross/
@
cp
chain33.para.toml build/ci/paracross/
...
...
go.sum
View file @
5a94e08f
This diff is collapsed.
Click to expand it.
plugin/consensus/dpos/dpos_test.go
View file @
5a94e08f
...
@@ -377,6 +377,7 @@ func initEnvDpos() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Mod
...
@@ -377,6 +377,7 @@ func initEnvDpos() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Mod
var
q
=
queue
.
New
(
"channel"
)
var
q
=
queue
.
New
(
"channel"
)
q
.
SetConfig
(
chain33Cfg
)
q
.
SetConfig
(
chain33Cfg
)
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
.
Log
.
LogFile
=
""
sub
:=
chain33Cfg
.
GetSubConfig
()
sub
:=
chain33Cfg
.
GetSubConfig
()
chain
:=
blockchain
.
New
(
chain33Cfg
)
chain
:=
blockchain
.
New
(
chain33Cfg
)
...
...
plugin/consensus/dpos/node_test.go
View file @
5a94e08f
...
@@ -559,6 +559,7 @@ func initEnvDpos1(configName string) (queue.Queue, *blockchain.BlockChain, queue
...
@@ -559,6 +559,7 @@ func initEnvDpos1(configName string) (queue.Queue, *blockchain.BlockChain, queue
var
q
=
queue
.
New
(
"channel"
)
var
q
=
queue
.
New
(
"channel"
)
q
.
SetConfig
(
chain33Cfg
)
q
.
SetConfig
(
chain33Cfg
)
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
.
Log
.
LogFile
=
""
sub
:=
chain33Cfg
.
GetSubConfig
()
sub
:=
chain33Cfg
.
GetSubConfig
()
rpc
.
InitCfg
(
cfg
.
RPC
)
rpc
.
InitCfg
(
cfg
.
RPC
)
...
...
plugin/consensus/pbft/pbft_test.go
View file @
5a94e08f
...
@@ -66,6 +66,7 @@ func initEnvPbft() (queue.Queue, *blockchain.BlockChain, *p2p.Manager, queue.Mod
...
@@ -66,6 +66,7 @@ func initEnvPbft() (queue.Queue, *blockchain.BlockChain, *p2p.Manager, queue.Mod
var
q
=
queue
.
New
(
"channel"
)
var
q
=
queue
.
New
(
"channel"
)
q
.
SetConfig
(
chain33Cfg
)
q
.
SetConfig
(
chain33Cfg
)
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
.
Log
.
LogFile
=
""
sub
:=
chain33Cfg
.
GetSubConfig
()
sub
:=
chain33Cfg
.
GetSubConfig
()
chain
:=
blockchain
.
New
(
chain33Cfg
)
chain
:=
blockchain
.
New
(
chain33Cfg
)
...
...
plugin/consensus/ticket/testdata/chain33.cfg.toml
View file @
5a94e08f
...
@@ -41,7 +41,7 @@ enableTxQuickIndex=false
...
@@ -41,7 +41,7 @@ enableTxQuickIndex=false
[p2p]
[p2p]
types
=
["dht"]
types
=
["dht"]
enable
=
tru
e
enable
=
fals
e
msgCacheSize
=
10240
msgCacheSize
=
10240
driver
=
"memdb"
driver
=
"memdb"
dbPath
=
"datadir/addrbook"
dbPath
=
"datadir/addrbook"
...
...
plugin/dapp/dposvote/commands/vote_test.go
View file @
5a94e08f
...
@@ -260,6 +260,7 @@ func initEnvDpos() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Mod
...
@@ -260,6 +260,7 @@ func initEnvDpos() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Mod
var
q
=
queue
.
New
(
"channel"
)
var
q
=
queue
.
New
(
"channel"
)
q
.
SetConfig
(
chain33Cfg
)
q
.
SetConfig
(
chain33Cfg
)
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
.
Log
.
LogFile
=
""
sub
:=
chain33Cfg
.
GetSubConfig
()
sub
:=
chain33Cfg
.
GetSubConfig
()
chain
:=
blockchain
.
New
(
chain33Cfg
)
chain
:=
blockchain
.
New
(
chain33Cfg
)
...
...
plugin/dapp/guess/commands/game_test.go
View file @
5a94e08f
...
@@ -429,6 +429,7 @@ func initEnvGuess() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Mo
...
@@ -429,6 +429,7 @@ func initEnvGuess() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Mo
var
q
=
queue
.
New
(
"channel"
)
var
q
=
queue
.
New
(
"channel"
)
q
.
SetConfig
(
chain33Cfg
)
q
.
SetConfig
(
chain33Cfg
)
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
.
Log
.
LogFile
=
""
sub
:=
chain33Cfg
.
GetSubConfig
()
sub
:=
chain33Cfg
.
GetSubConfig
()
chain
:=
blockchain
.
New
(
chain33Cfg
)
chain
:=
blockchain
.
New
(
chain33Cfg
)
chain
.
SetQueueClient
(
q
.
Client
())
chain
.
SetQueueClient
(
q
.
Client
())
...
...
plugin/dapp/guess/rpc/guess_test.go
View file @
5a94e08f
...
@@ -648,6 +648,7 @@ func initEnvGuess() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Mo
...
@@ -648,6 +648,7 @@ func initEnvGuess() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Mo
var
q
=
queue
.
New
(
"channel"
)
var
q
=
queue
.
New
(
"channel"
)
q
.
SetConfig
(
chain33Cfg
)
q
.
SetConfig
(
chain33Cfg
)
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
:=
chain33Cfg
.
GetModuleConfig
()
cfg
.
Log
.
LogFile
=
""
sub
:=
chain33Cfg
.
GetSubConfig
()
sub
:=
chain33Cfg
.
GetSubConfig
()
chain
:=
blockchain
.
New
(
chain33Cfg
)
chain
:=
blockchain
.
New
(
chain33Cfg
)
chain
.
SetQueueClient
(
q
.
Client
())
chain
.
SetQueueClient
(
q
.
Client
())
...
...
plugin/dapp/paracross/testnode/cfg.go
View file @
5a94e08f
...
@@ -4,6 +4,7 @@ package testnode
...
@@ -4,6 +4,7 @@ package testnode
var
DefaultConfig
=
`
var
DefaultConfig
=
`
Title="user.p.test."
Title="user.p.test."
CoinSymbol="bty"
CoinSymbol="bty"
ChainID=33
# TestNet=true
# TestNet=true
[crypto]
[crypto]
...
...
plugin/p2p/gossip/p2p.go
View file @
5a94e08f
...
@@ -81,6 +81,7 @@ type P2p struct {
...
@@ -81,6 +81,7 @@ type P2p struct {
subCfg
*
subConfig
subCfg
*
subConfig
mgr
*
p2p
.
Manager
mgr
*
p2p
.
Manager
subChan
chan
interface
{}
subChan
chan
interface
{}
lock
sync
.
Mutex
}
}
// New produce a p2p object
// New produce a p2p object
...
@@ -147,6 +148,8 @@ func (network *P2p) isRestart() bool {
...
@@ -147,6 +148,8 @@ func (network *P2p) isRestart() bool {
//CloseP2P Close network client
//CloseP2P Close network client
func
(
network
*
P2p
)
CloseP2P
()
{
func
(
network
*
P2p
)
CloseP2P
()
{
network
.
lock
.
Lock
()
defer
network
.
lock
.
Unlock
()
log
.
Info
(
"p2p network start shutdown"
)
log
.
Info
(
"p2p network start shutdown"
)
atomic
.
StoreInt32
(
&
network
.
closed
,
1
)
atomic
.
StoreInt32
(
&
network
.
closed
,
1
)
//等待业务协程停止
//等待业务协程停止
...
@@ -321,6 +324,8 @@ func (network *P2p) genAirDropKeyFromWallet() error {
...
@@ -321,6 +324,8 @@ func (network *P2p) genAirDropKeyFromWallet() error {
//ReStart p2p
//ReStart p2p
func
(
network
*
P2p
)
ReStart
()
{
func
(
network
*
P2p
)
ReStart
()
{
network
.
lock
.
Lock
()
defer
network
.
lock
.
Unlock
()
//避免重复
//避免重复
if
!
atomic
.
CompareAndSwapInt32
(
&
network
.
restart
,
0
,
1
)
{
if
!
atomic
.
CompareAndSwapInt32
(
&
network
.
restart
,
0
,
1
)
{
return
return
...
@@ -400,6 +405,11 @@ func (network *P2p) subP2pMsg() {
...
@@ -400,6 +405,11 @@ func (network *P2p) subP2pMsg() {
func
(
network
*
P2p
)
processEvent
(
msg
*
queue
.
Message
,
taskIdx
int64
,
eventFunc
p2pEventFunc
)
{
func
(
network
*
P2p
)
processEvent
(
msg
*
queue
.
Message
,
taskIdx
int64
,
eventFunc
p2pEventFunc
)
{
network
.
lock
.
Lock
()
defer
network
.
lock
.
Unlock
()
if
network
.
isClose
()
{
return
}
//检测重启标志,停止分发事件,需要等待重启
//检测重启标志,停止分发事件,需要等待重启
if
network
.
isRestart
()
{
if
network
.
isRestart
()
{
log
.
Info
(
"wait for p2p restart...."
)
log
.
Info
(
"wait for p2p restart...."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment