code: func (s *Store) ACLBootstrap(idx, resetIndex uint64, token *structs.ACLToken, legacy bool) error {
  	tx := s.db.Txn(true)
  	defer tx.Abort()
  
  	// We must have initialized before this will ever be possible.
  	existing, err := tx.First("index", "id", "acl-token-bootstrap")
  	if err != nil {
  		return fmt.Errorf("bootstrap check failed: %v", err)
  	}
  	if existing != nil {
  		if resetIndex == 0 {
  			return structs.ACLBootstrapNotAllowedErr
  		} else if resetIndex != existing.(*IndexEntry).Value {
  			return structs.ACLBootstrapInvalidResetIndexErr
  		}
  	}
  
  	if err := s.aclTokenSetTxn(tx, idx, token, false, false, legacy); err != nil {
  		return fmt.Errorf("failed inserting bootstrap token: %v", err)
  	}
  	if err := indexUpdateMaxTxn(tx, idx, "acl-tokens"); err != nil {
  		return fmt.Errorf("failed updating index: %s", err)
  	}
  	if err := tx.Insert("index", &IndexEntry{"acl-token-bootstrap", idx}); err != nil {
  		return fmt.Errorf("failed to mark ACL bootstrapping as complete: %v", err)
  	}
  	tx.Commit()
  	return nil
  }
docs: // ACLBootstrap is used to perform a one-time ACL bootstrap operation on a
  // cluster to get the first management token.