code: func NewSnapshotter(opt Opt) (snapshot.SnapshotterBase, error) {
  	dbPath := filepath.Join(opt.Root, "snapshots.db")
  	db, err := bolt.Open(dbPath, 0600, nil)
  	if err != nil {
  		return nil, errors.Wrapf(err, "failed to open database file %s", dbPath)
  	}
  
  	reg, ok := opt.LayerStore.(graphIDRegistrar)
  	if !ok {
  		return nil, errors.Errorf("layerstore doesn't support graphID registration")
  	}
  
  	s := &snapshotter{
  		opt:  opt,
  		db:   db,
  		refs: map[string]layer.Layer{},
  		reg:  reg,
  	}
  	return s, nil
  }
docs: // NewSnapshotter creates a new snapshotter