forked from TrueCloudLab/frostfs-node
[#125] ir: Set extra wallets on SIGHUP
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
0624820909
commit
6f47c75e43
7 changed files with 61 additions and 36 deletions
|
@ -204,7 +204,7 @@ func (s *Server) createIRFetcher() irFetcher {
|
|||
return irf
|
||||
}
|
||||
|
||||
func (s *Server) initTimers(cfg *viper.Viper, processors *serverProcessors, morphClients *serverMorphClients) {
|
||||
func (s *Server) initTimers(cfg *viper.Viper, morphClients *serverMorphClients) {
|
||||
s.epochTimer = newEpochTimer(&epochTimerArgs{
|
||||
l: s.log,
|
||||
alphabetState: s,
|
||||
|
@ -219,21 +219,21 @@ func (s *Server) initTimers(cfg *viper.Viper, processors *serverProcessors, morp
|
|||
|
||||
// initialize emission timer
|
||||
emissionTimer := newEmissionTimer(&emitTimerArgs{
|
||||
ap: processors.AlphabetProcessor,
|
||||
ap: s.alphabetProcessor,
|
||||
emitDuration: cfg.GetUint32("timers.emit"),
|
||||
})
|
||||
|
||||
s.addBlockTimer(emissionTimer)
|
||||
}
|
||||
|
||||
func (s *Server) initAlphabetProcessor(cfg *viper.Viper) (*alphabet.Processor, error) {
|
||||
func (s *Server) initAlphabetProcessor(cfg *viper.Viper) error {
|
||||
parsedWallets, err := parseWalletAddressesFromStrings(cfg.GetStringSlice("emit.extra_wallets"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
// create alphabet processor
|
||||
alphabetProcessor, err := alphabet.New(&alphabet.Params{
|
||||
s.alphabetProcessor, err = alphabet.New(&alphabet.Params{
|
||||
ParsedWallets: parsedWallets,
|
||||
Log: s.log,
|
||||
PoolSize: cfg.GetInt("workers.alphabet"),
|
||||
|
@ -244,15 +244,15 @@ func (s *Server) initAlphabetProcessor(cfg *viper.Viper) (*alphabet.Processor, e
|
|||
StorageEmission: cfg.GetUint64("emit.storage.amount"),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
err = bindMorphProcessor(alphabetProcessor, s)
|
||||
err = bindMorphProcessor(s.alphabetProcessor, s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
return alphabetProcessor, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Server) initContainerProcessor(cfg *viper.Viper, cnrClient *container.Client,
|
||||
|
@ -425,13 +425,7 @@ func (s *Server) initClientsFromMorph() (*serverMorphClients, error) {
|
|||
return result, nil
|
||||
}
|
||||
|
||||
type serverProcessors struct {
|
||||
AlphabetProcessor *alphabet.Processor
|
||||
}
|
||||
|
||||
func (s *Server) initProcessors(cfg *viper.Viper, morphClients *serverMorphClients) (*serverProcessors, error) {
|
||||
result := &serverProcessors{}
|
||||
|
||||
func (s *Server) initProcessors(cfg *viper.Viper, morphClients *serverMorphClients) error {
|
||||
irf := s.createIRFetcher()
|
||||
|
||||
s.statusIndex = newInnerRingIndexer(
|
||||
|
@ -443,35 +437,35 @@ func (s *Server) initProcessors(cfg *viper.Viper, morphClients *serverMorphClien
|
|||
|
||||
alphaSync, err := s.createAlphaSync(cfg, morphClients.FrostFSClient, irf)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
err = s.initNetmapProcessor(cfg, morphClients.CnrClient, alphaSync)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
err = s.initContainerProcessor(cfg, morphClients.CnrClient, morphClients.FrostFSIDClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
err = s.initBalanceProcessor(cfg, morphClients.FrostFSClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
err = s.initFrostFSMainnetProcessor(cfg, morphClients.FrostFSIDClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
result.AlphabetProcessor, err = s.initAlphabetProcessor(cfg)
|
||||
err = s.initAlphabetProcessor(cfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Server) initMorph(ctx context.Context, cfg *viper.Viper, errChan chan<- error) (*chainParams, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue