good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
open
bor
Commits
20aa6dde
Commit
20aa6dde
authored
Feb 22, 2015
by
Jeffrey Wilcke
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop'
parents
8cc6647e
eec4345a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.travis.yml
+5
-0
5 additions, 0 deletions
.travis.yml
eth/backend.go
+30
-6
30 additions, 6 deletions
eth/backend.go
gocoverage.sh
+0
-3
0 additions, 3 deletions
gocoverage.sh
with
35 additions
and
9 deletions
.travis.yml
+
5
−
0
View file @
20aa6dde
...
@@ -6,10 +6,15 @@ before_install:
...
@@ -6,10 +6,15 @@ before_install:
-
sudo apt-get update -qq
-
sudo apt-get update -qq
-
sudo apt-get install -yqq libgmp3-dev libreadline6-dev qt54quickcontrols qt54webengine
-
sudo apt-get install -yqq libgmp3-dev libreadline6-dev qt54quickcontrols qt54webengine
install
:
install
:
# - go get code.google.com/p/go.tools/cmd/goimports
# - go get github.com/golang/lint/golint
# - go get golang.org/x/tools/cmd/vet
# - go get golang.org/x/tools/cmd/vet
-
if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
-
if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
-
go get github.com/mattn/goveralls
-
go get github.com/mattn/goveralls
before_script
:
before_script
:
# - gofmt -l -w .
# - goimports -l -w .
# - golint .
# - go vet ./...
# - go vet ./...
# - go test -race ./...
# - go test -race ./...
script
:
script
:
...
...
This diff is collapsed.
Click to expand it.
eth/backend.go
+
30
−
6
View file @
20aa6dde
...
@@ -3,6 +3,8 @@ package eth
...
@@ -3,6 +3,8 @@ package eth
import
(
import
(
"crypto/ecdsa"
"crypto/ecdsa"
"fmt"
"fmt"
"io/ioutil"
"path"
"strings"
"strings"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core"
...
@@ -25,7 +27,10 @@ var (
...
@@ -25,7 +27,10 @@ var (
jsonlogger
=
ethlogger
.
NewJsonLogger
()
jsonlogger
=
ethlogger
.
NewJsonLogger
()
defaultBootNodes
=
[]
*
discover
.
Node
{
defaultBootNodes
=
[]
*
discover
.
Node
{
// ETH/DEV cmd/bootnode
discover
.
MustParseNode
(
"enode://6cdd090303f394a1cac34ecc9f7cda18127eafa2a3a06de39f6d920b0e583e062a7362097c7c65ee490a758b442acd5c80c6fce4b148c6a391e946b45131365b@54.169.166.226:30303"
),
discover
.
MustParseNode
(
"enode://6cdd090303f394a1cac34ecc9f7cda18127eafa2a3a06de39f6d920b0e583e062a7362097c7c65ee490a758b442acd5c80c6fce4b148c6a391e946b45131365b@54.169.166.226:30303"
),
// ETH/DEV cpp-ethereum (poc-8.ethdev.com)
discover
.
MustParseNode
(
"enode://4a44599974518ea5b0f14c31c4463692ac0329cb84851f3435e6d1b18ee4eae4aa495f846a0fa1219bd58035671881d44423876e57db2abd57254d0197da0ebe@5.1.83.226:30303"
),
}
}
)
)
...
@@ -77,6 +82,27 @@ func (cfg *Config) parseBootNodes() []*discover.Node {
...
@@ -77,6 +82,27 @@ func (cfg *Config) parseBootNodes() []*discover.Node {
return
ns
return
ns
}
}
func
(
cfg
*
Config
)
nodeKey
()
(
*
ecdsa
.
PrivateKey
,
error
)
{
// use explicit key from command line args if set
if
cfg
.
NodeKey
!=
nil
{
return
cfg
.
NodeKey
,
nil
}
// use persistent key if present
keyfile
:=
path
.
Join
(
cfg
.
DataDir
,
"nodekey"
)
key
,
err
:=
crypto
.
LoadECDSA
(
keyfile
)
if
err
==
nil
{
return
key
,
nil
}
// no persistent key, generate and store a new one
if
key
,
err
=
crypto
.
GenerateKey
();
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"could not generate server key: %v"
,
err
)
}
if
err
:=
ioutil
.
WriteFile
(
keyfile
,
crypto
.
FromECDSA
(
key
),
0600
);
err
!=
nil
{
logger
.
Errorln
(
"could not persist nodekey: "
,
err
)
}
return
key
,
nil
}
type
Ethereum
struct
{
type
Ethereum
struct
{
// Channel for shutting down the ethereum
// Channel for shutting down the ethereum
shutdownChan
chan
bool
shutdownChan
chan
bool
...
@@ -161,18 +187,16 @@ func New(config *Config) (*Ethereum, error) {
...
@@ -161,18 +187,16 @@ func New(config *Config) (*Ethereum, error) {
insertChain
:=
eth
.
chainManager
.
InsertChain
insertChain
:=
eth
.
chainManager
.
InsertChain
eth
.
blockPool
=
NewBlockPool
(
hasBlock
,
insertChain
,
ezp
.
Verify
)
eth
.
blockPool
=
NewBlockPool
(
hasBlock
,
insertChain
,
ezp
.
Verify
)
netprv
,
err
:=
config
.
nodeKey
()
if
err
!=
nil
{
return
nil
,
err
}
ethProto
:=
EthProtocol
(
eth
.
txPool
,
eth
.
chainManager
,
eth
.
blockPool
)
ethProto
:=
EthProtocol
(
eth
.
txPool
,
eth
.
chainManager
,
eth
.
blockPool
)
protocols
:=
[]
p2p
.
Protocol
{
ethProto
}
protocols
:=
[]
p2p
.
Protocol
{
ethProto
}
if
config
.
Shh
{
if
config
.
Shh
{
protocols
=
append
(
protocols
,
eth
.
whisper
.
Protocol
())
protocols
=
append
(
protocols
,
eth
.
whisper
.
Protocol
())
}
}
netprv
:=
config
.
NodeKey
if
netprv
==
nil
{
if
netprv
,
err
=
crypto
.
GenerateKey
();
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"could not generate server key: %v"
,
err
)
}
}
eth
.
net
=
&
p2p
.
Server
{
eth
.
net
=
&
p2p
.
Server
{
PrivateKey
:
netprv
,
PrivateKey
:
netprv
,
Name
:
config
.
Name
,
Name
:
config
.
Name
,
...
...
This diff is collapsed.
Click to expand it.
gocoverage.sh
+
0
−
3
View file @
20aa6dde
...
@@ -29,6 +29,3 @@ if ls $dir/*.go &> /dev/null; then
...
@@ -29,6 +29,3 @@ if ls $dir/*.go &> /dev/null; then
fi
fi
fi
fi
done
done
go tool cover
-func
profile.cov
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