-
Notifications
You must be signed in to change notification settings - Fork 1
/
bindings_stub.go
154 lines (127 loc) · 3.18 KB
/
bindings_stub.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
//go:build nosilkworm || windows || (linux && arm64) || (darwin && amd64)
package silkworm_go
import (
"errors"
"math/big"
"unsafe"
)
// ErrInterrupted is the error returned by Silkworm APIs when stopped by any termination signal.
var ErrInterrupted = errors.New("interrupted")
var ErrInvalidBlock = errors.New("invalid block")
type SilkwormLogLevel uint32
const (
LogLevelNone SilkwormLogLevel = iota
LogLevelCritical
LogLevelError
LogLevelWarning
LogLevelInfo
LogLevelDebug
LogLevelTrace
)
type RpcInterfaceLogSettings struct {
Enabled bool
ContainerFolder string
MaxFileSizeMB uint16
MaxFiles uint16
DumpResponse bool
}
type RpcDaemonSettings struct {
EthLogSettings RpcInterfaceLogSettings
EthAPIHost string
EthAPIPort int
EthAPISpec []string
NumWorkers uint32
CORSDomains []string
JWTFilePath string
JSONRPCCompatibility bool
WebSocketEnabled bool
WebSocketCompression bool
HTTPCompression bool
}
type ForkValidatorSettings struct {
BatchSize uint64
EtlBufferSize uint64
SyncLoopThrottleSeconds uint32
StopBeforeSendersStage bool
}
type Silkworm struct {
}
func New(dataDirPath string, libMdbxVersion string, numIOContexts uint32, logVerbosity SilkwormLogLevel) (*Silkworm, error) {
return nil, errors.New("silkworm is not supported")
}
func (s *Silkworm) LibMdbxVersion() string {
return ""
}
func (s *Silkworm) Close() error {
return nil
}
func (s *Silkworm) AddSnapshot(snapshot *MappedChainSnapshot) error {
return nil
}
func (s *Silkworm) StartRpcDaemon(dbEnvCHandle unsafe.Pointer, settings RpcDaemonSettings) error {
return nil
}
func (s *Silkworm) StopRpcDaemon() error {
return nil
}
func (s *Silkworm) StartForkValidator(dbEnvCHandle unsafe.Pointer, settings ForkValidatorSettings) error {
return nil
}
func (s *Silkworm) StopForkValidator() error {
return nil
}
type Hash [32]byte
type ExecutionStatus int32
type ForkValidatorValidationResult struct {
ExecutionStatus ExecutionStatus
LastValidHash Hash
ErrorMessage string
}
func (s *Silkworm) VerifyChain(headHash Hash) (ForkValidatorValidationResult, error) {
return ForkValidatorValidationResult{}, nil
}
func (s *Silkworm) ForkChoiceUpdate(headHash Hash, finalizedHash Hash, safeHash Hash) error {
return nil
}
type SentrySettings struct {
ClientId string
ApiPort int
Port int
Nat string
NetworkId uint64
NodeKey []byte
StaticPeers []string
Bootnodes []string
NoDiscover bool
MaxPeers int
}
func (s *Silkworm) SentryStart(settings SentrySettings) error {
return nil
}
func (s *Silkworm) SentryStop() error {
return nil
}
func (s *Silkworm) ExecuteBlocksEphemeral(
txnCHandle unsafe.Pointer,
chainID *big.Int,
startBlock uint64,
maxBlock uint64,
batchSize uint64,
writeChangeSets,
writeReceipts,
writeCallTraces bool,
) (lastExecutedBlock uint64, err error) {
return 0, nil
}
func (s *Silkworm) ExecuteBlocksPerpetual(
dbEnvCHandle unsafe.Pointer,
chainID *big.Int,
startBlock uint64,
maxBlock uint64,
batchSize uint64,
writeChangeSets,
writeReceipts,
writeCallTraces bool,
) (lastExecutedBlock uint64, err error) {
return 0, nil
}