Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ import (
)

type Config struct {
Logging LoggingConfig `yaml:"logging"`
Storage StorageConfig `yaml:"storage"`
Indexer IndexerConfig `yaml:"indexer"`
Submit SubmitConfig `yaml:"submit"`
Storage StorageConfig `yaml:"storage"`
Wallet WalletConfig `yaml:"wallet"`
Miner MinerConfig `yaml:"miner"`
Metrics MetricsConfig `yaml:"metrics"`
Debug DebugConfig `yaml:"debug"`
Profile string `yaml:"profile" envconfig:"PROFILE"`
Network string `yaml:"network" envconfig:"NETWORK"`
Indexer IndexerConfig `yaml:"indexer"`
Metrics MetricsConfig `yaml:"metrics"`
Debug DebugConfig `yaml:"debug"`
Miner MinerConfig `yaml:"miner"`
NetworkMagic uint32
Logging LoggingConfig `yaml:"logging"`
}

type LoggingConfig struct {
Expand Down Expand Up @@ -68,9 +68,9 @@ type WalletConfig struct {
}

type MinerConfig struct {
Message string `yaml:"message" envconfig:"MINER_MESSAGE"`
WorkerCount int `yaml:"workers" envconfig:"WORKER_COUNT"`
HashRateInterval int `yaml:"hashRateInterval" envconfig:"HASH_RATE_INTERVAL"`
Message string `yaml:"message" envconfig:"MINER_MESSAGE"`
}

type MetricsConfig struct {
Expand Down
14 changes: 7 additions & 7 deletions internal/config/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
package config

type Profile struct {
InterceptHash string
InterceptSlot uint64
ScriptInputRefTxId string
ScriptAddress string
ValidatorHash string
MintValidatorHash string
ValidatorScript string
ScriptInputRefTxId string
ScriptInputRefOutIndex uint32
ScriptRefInputs []RefInput
InterceptHash string
SeedHashes []string
UseTunaV1 bool
TunaV2OldTargetStateOrder bool
ScriptRefInputs []RefInput
EpochNumber int
InterceptSlot uint64
EpochTarget int
ScriptInputRefOutIndex uint32
UseTunaV1 bool
TunaV2OldTargetStateOrder bool
}

func GetProfile() Profile {
Expand Down
8 changes: 4 additions & 4 deletions internal/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ const (
)

type Indexer struct {
lastBlockData any
pipeline *pipeline.Pipeline
cursorSlot uint64
syncLogTimer *time.Timer
cursorHash string
tipSlot uint64
tipHash string
cursorSlot uint64
tipSlot uint64
tipReached bool
syncLogTimer *time.Timer
lastBlockData any
}

// Singleton indexer instance
Expand Down
10 changes: 5 additions & 5 deletions internal/miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ type TargetState interface {
}

type TargetStateV1 struct {
Nonce [16]byte
BlockNumber int64
CurrentHash []byte
BlockNumber int64
LeadingZeros int64
DifficultyNumber int64
EpochTime int64
Nonce [16]byte
}

func (t *TargetStateV1) SetNonce(nonce [16]byte) {
Expand All @@ -85,14 +85,14 @@ func (state *TargetStateV1) MarshalCBOR() ([]byte, error) {
}

type TargetStateV2 struct {
Nonce [16]byte
MinerCredHash []byte
CurrentHash []byte
cachedCbor []byte
EpochTime int64
BlockNumber int64
CurrentHash []byte
LeadingZeros int64
DifficultyNumber int64
cachedCbor []byte
Nonce [16]byte
}

func (t *TargetStateV2) SetNonce(nonce [16]byte) {
Expand Down
12 changes: 6 additions & 6 deletions internal/miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ const (
)

type Manager struct {
workerWaitGroup sync.WaitGroup
lastBlockData any
doneChan chan any
resultChan chan Result
started bool
startMutex sync.Mutex
stopMutex sync.Mutex
hashCounter *atomic.Uint64
hashLogTimer *time.Timer
hashLogLastCount uint64
restartTimer *time.Timer
lastBlockData any
workerWaitGroup sync.WaitGroup
hashLogLastCount uint64
startMutex sync.Mutex
stopMutex sync.Mutex
started bool
}

var globalManager = &Manager{}
Expand Down
2 changes: 1 addition & 1 deletion internal/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ const (
)

type Storage struct {
sync.Mutex
db *badger.DB
trie *Trie
sync.Mutex
}

var globalStorage = &Storage{}
Expand Down
2 changes: 1 addition & 1 deletion internal/storage/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import (
)

type Trie struct {
sync.Mutex
db *badger.DB
trie *mpf.Trie
keyPrefix []byte
sync.Mutex
}

func NewTrie(db *badger.DB, keyPrefix string) (*Trie, error) {
Expand Down