// Open @TODO : analyze channel role !!
Open @TODO : analyze channel role
// Open @TODO : analyze channel role !!
func (n *nutsNode) Open(stopc <-chan struct{}) (idxRaftlog uint64, err error) {
	var (
		opt Options
		db  *nutsdb.DB
	)
	if opt = n.getOptions(); opt == nil {
		return 0, ErrorValidateConfig.Error(nil)
	}
	if db, err = nutsdb.Open(opt.NutsDBOptions()); err != nil {
		return 0, err
	} else {
		n.setDb(db)
		n.setRunning(true)
		if idxRaftlog, err = n.getRaftLogIndexLastApplied(); err != nil {
			_ = n.Close()
		}
		return
	}
}
func ( n * nutsNode ) Open ( stopc <- chan struct { } ) ( idxRaftlog uint64 , err error ) { var ( opt Options db * nutsdb . DB ) if opt = n . getOptions ( ) ; opt == nil { return 0 , ErrorValidateConfig . Error ( nil ) } if db , err = nutsdb . Open ( opt . NutsDBOptions ( ) ) ; err != nil { return 0 , err } else { n . setDb ( db ) n . setRunning ( true ) if idxRaftlog , err = n . getRaftLogIndexLastApplied ( ) ; err != nil { _ = n . Close ( ) } return } }
Open @TODO : analyze channel role
Open @TODO : analyze channel role