-
Notifications
You must be signed in to change notification settings - Fork 211
/
node.go
50 lines (39 loc) · 1.25 KB
/
node.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package api
import (
"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/p2p/p2pcrypto"
"github.com/spacemeshos/go-spacemesh/p2p/service"
"github.com/spacemeshos/go-spacemesh/priorityq"
"time"
)
type Service interface {
RegisterGossipProtocol(string, priorityq.Priority) chan service.GossipMessage
}
type StateAPI interface {
GetBalance(address types.Address) uint64
GetNonce(address types.Address) uint64
Exist(address types.Address) bool
}
type NetworkAPI interface {
Broadcast(channel string, data []byte) error
SubscribePeerEvents() (conn, disc chan p2pcrypto.PublicKey)
}
type MiningAPI interface {
StartPost(address types.Address, datadir string, space uint64) error
SetCoinbaseAccount(rewardAddress types.Address)
// MiningStats returns state of post init, coinbase reward account and data directory path for post commitment
MiningStats() (postStatus int, remainingBytes uint64, coinbaseAccount string, postDatadir string)
}
type OracleAPI interface {
GetEligibleLayers() []types.LayerID
}
type GenesisTimeAPI interface {
GetGenesisTime() time.Time
GetCurrentLayer() types.LayerID
}
type LoggingAPI interface {
SetLogLevel(loggerName, severity string) error
}
type PostAPI interface {
Reset() error
}