code: func (e *EncryptedRaftLogger) BootstrapNew(metadata []byte) error {
  	e.encoderMu.Lock()
  	defer e.encoderMu.Unlock()
  	encrypter, decrypter := encryption.Defaults(e.EncryptionKey, e.FIPS)
  	walFactory := NewWALFactory(encrypter, decrypter)
  
  	for _, dirpath := range []string{filepath.Dir(e.walDir()), e.snapDir()} {
  		if err := os.MkdirAll(dirpath, 0700); err != nil {
  			return errors.Wrapf(err, "failed to create %s", dirpath)
  		}
  	}
  	var err error
  	// the wal directory must not already exist upon creation
  	e.wal, err = walFactory.Create(e.walDir(), metadata)
  	if err != nil {
  		return errors.Wrap(err, "failed to create WAL")
  	}
  
  	e.snapshotter = NewSnapFactory(encrypter, decrypter).New(e.snapDir())
  	return nil
  }
docs: // BootstrapNew creates a new snapshotter and WAL writer, expecting that there is nothing on disk