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
b0798e0a
Commit
b0798e0a
authored
May 13, 2014
by
Jeffrey Wilcke
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop
parents
9831ba20
c9ac5b0f
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
ethchain/state_manager.go
+3
-0
3 additions, 0 deletions
ethchain/state_manager.go
ethereum.go
+15
-0
15 additions, 0 deletions
ethereum.go
ethpub/pub.go
+22
-1
22 additions, 1 deletion
ethpub/pub.go
with
40 additions
and
1 deletion
ethchain/state_manager.go
+
3
−
0
View file @
b0798e0a
...
@@ -20,6 +20,9 @@ type EthManager interface {
...
@@ -20,6 +20,9 @@ type EthManager interface {
TxPool
()
*
TxPool
TxPool
()
*
TxPool
Broadcast
(
msgType
ethwire
.
MsgType
,
data
[]
interface
{})
Broadcast
(
msgType
ethwire
.
MsgType
,
data
[]
interface
{})
Reactor
()
*
ethutil
.
ReactorEngine
Reactor
()
*
ethutil
.
ReactorEngine
PeerCount
()
int
IsMining
()
bool
IsListening
()
bool
}
}
type
StateManager
struct
{
type
StateManager
struct
{
...
...
This diff is collapsed.
Click to expand it.
ethereum.go
+
15
−
0
View file @
b0798e0a
...
@@ -65,6 +65,10 @@ type Ethereum struct {
...
@@ -65,6 +65,10 @@ type Ethereum struct {
// Specifies the desired amount of maximum peers
// Specifies the desired amount of maximum peers
MaxPeers
int
MaxPeers
int
Mining
bool
listening
bool
reactor
*
ethutil
.
ReactorEngine
reactor
*
ethutil
.
ReactorEngine
RpcServer
*
ethrpc
.
JsonRpcServer
RpcServer
*
ethrpc
.
JsonRpcServer
...
@@ -128,6 +132,15 @@ func (s *Ethereum) TxPool() *ethchain.TxPool {
...
@@ -128,6 +132,15 @@ func (s *Ethereum) TxPool() *ethchain.TxPool {
func
(
s
*
Ethereum
)
ServerCaps
()
Caps
{
func
(
s
*
Ethereum
)
ServerCaps
()
Caps
{
return
s
.
serverCaps
return
s
.
serverCaps
}
}
func
(
s
*
Ethereum
)
IsMining
()
bool
{
return
s
.
Mining
}
func
(
s
*
Ethereum
)
PeerCount
()
int
{
return
s
.
peers
.
Len
()
}
func
(
s
*
Ethereum
)
IsListening
()
bool
{
return
s
.
listening
}
func
(
s
*
Ethereum
)
AddPeer
(
conn
net
.
Conn
)
{
func
(
s
*
Ethereum
)
AddPeer
(
conn
net
.
Conn
)
{
peer
:=
NewPeer
(
conn
,
s
,
true
)
peer
:=
NewPeer
(
conn
,
s
,
true
)
...
@@ -305,7 +318,9 @@ func (s *Ethereum) Start(seed bool) {
...
@@ -305,7 +318,9 @@ func (s *Ethereum) Start(seed bool) {
ln
,
err
:=
net
.
Listen
(
"tcp"
,
":"
+
s
.
Port
)
ln
,
err
:=
net
.
Listen
(
"tcp"
,
":"
+
s
.
Port
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Println
(
"Connection listening disabled. Acting as client"
)
log
.
Println
(
"Connection listening disabled. Acting as client"
)
s
.
listening
=
false
}
else
{
}
else
{
s
.
listening
=
true
// Starting accepting connections
// Starting accepting connections
ethutil
.
Config
.
Log
.
Infoln
(
"Ready and accepting connections"
)
ethutil
.
Config
.
Log
.
Infoln
(
"Ready and accepting connections"
)
// Start the peer handler
// Start the peer handler
...
...
This diff is collapsed.
Click to expand it.
ethpub/pub.go
+
22
−
1
View file @
b0798e0a
package
ethpub
package
ethpub
import
(
import
(
"encoding/hex"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethutil"
)
)
...
@@ -56,11 +57,31 @@ func (lib *PEthereum) GetStateObject(address string) *PStateObject {
...
@@ -56,11 +57,31 @@ func (lib *PEthereum) GetStateObject(address string) *PStateObject {
return
NewPStateObject
(
nil
)
return
NewPStateObject
(
nil
)
}
}
func
(
lib
*
PEthereum
)
GetPeerCount
()
int
{
return
lib
.
manager
.
PeerCount
()
}
func
(
lib
*
PEthereum
)
GetIsMining
()
bool
{
return
lib
.
manager
.
IsMining
()
}
func
(
lib
*
PEthereum
)
GetIsListening
()
bool
{
return
lib
.
manager
.
IsListening
()
}
func
(
lib
*
PEthereum
)
GetCoinBase
()
string
{
data
,
_
:=
ethutil
.
Config
.
Db
.
Get
([]
byte
(
"KeyRing"
))
keyRing
:=
ethutil
.
NewValueFromBytes
(
data
)
key
:=
keyRing
.
Get
(
0
)
.
Bytes
()
return
lib
.
SecretToAddress
(
hex
.
EncodeToString
(
key
))
}
func
(
lib
*
PEthereum
)
GetStorage
(
address
,
storageAddress
string
)
string
{
func
(
lib
*
PEthereum
)
GetStorage
(
address
,
storageAddress
string
)
string
{
return
lib
.
GetStateObject
(
address
)
.
GetStorage
(
storageAddress
)
return
lib
.
GetStateObject
(
address
)
.
GetStorage
(
storageAddress
)
}
}
func
(
lib
*
PEthereum
)
GetTxCount
(
address
string
)
int
{
func
(
lib
*
PEthereum
)
GetTxCount
At
(
address
string
)
int
{
return
lib
.
GetStateObject
(
address
)
.
Nonce
()
return
lib
.
GetStateObject
(
address
)
.
Nonce
()
}
}
...
...
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