@@ -31,42 +31,23 @@ const (
3131 ModeValidator NodeMode = "validator"
3232 // ModeCompute is the name of the compute node mode.
3333 ModeCompute NodeMode = "compute"
34+ // ModeObserver is the name of the observer node mode.
35+ ModeObserver NodeMode = "observer"
3436 // ModeKeyManager is the name of the key manager node mode.
3537 ModeKeyManager NodeMode = "keymanager"
3638 // ModeClient is the name of the client node mode.
3739 ModeClient NodeMode = "client"
38- // ModeStatelessClient is the name of the stateless client node mode.
39- ModeStatelessClient NodeMode = "client-stateless"
4040 // ModeSeed is the name of the seed node mode.
4141 ModeSeed NodeMode = "seed"
4242 // ModeArchive is the name of the archive node mode.
4343 ModeArchive NodeMode = "archive"
4444)
4545
46- // IsClientOnly returns true iff the mode is one that has the node running
47- // as a client for all configured runtimes.
48- func (m NodeMode ) IsClientOnly () bool {
49- switch m {
50- case ModeClient , ModeStatelessClient :
51- return true
52- }
53- return false
54- }
55-
5646// IsArchive returns true iff the mode is set to archive node mode.
5747func (m NodeMode ) IsArchive () bool {
5848 return m == ModeArchive
5949}
6050
61- // HasLocalStorage returns true iff the mode is one that has local storage.
62- func (m NodeMode ) HasLocalStorage () bool {
63- switch m {
64- case ModeClient , ModeCompute , ModeArchive :
65- return true
66- }
67- return false
68- }
69-
7051// GlobalConfig holds the global configuration options.
7152var GlobalConfig Config
7253
@@ -97,15 +78,26 @@ func (c *Config) Validate() error {
9778 switch c .Mode {
9879 case ModeValidator :
9980 case ModeCompute :
81+ case ModeObserver :
10082 case ModeKeyManager :
10183 case ModeClient :
102- case ModeStatelessClient :
10384 case ModeSeed :
10485 case ModeArchive :
10586 default :
10687 return fmt .Errorf ("unknown node mode: %s" , c .Mode )
10788 }
10889
90+ if ! c .Consensus .LocalStorage {
91+ if c .Consensus .Validator {
92+ return fmt .Errorf ("local storage not available in specified mode" )
93+ }
94+ switch c .Mode {
95+ case ModeClient , ModeObserver :
96+ default :
97+ return fmt .Errorf ("local storage not available in specified mode" )
98+ }
99+ }
100+
109101 if err = c .Common .Validate (); err != nil {
110102 return fmt .Errorf ("common: %w" , err )
111103 }
0 commit comments