code: func (api *PrivateAdminAPI) ImportChain(file string) (bool, error) {
  	// Make sure the can access the file to import
  	in, err := os.Open(file)
  	if err != nil {
  		return false, err
  	}
  	defer in.Close()
  
  	var reader io.Reader = in
  	if strings.HasSuffix(file, ".gz") {
  		if reader, err = gzip.NewReader(reader); err != nil {
  			return false, err
  		}
  	}
  
  	// Run actual the import in pre-configured batches
  	stream := rlp.NewStream(reader, 0)
  
  	blocks, index := make([]*types.Block, 0, 2500), 0
  	for batch := 0; ; batch++ {
  		// Load a batch of blocks from the input file
  		for len(blocks) < cap(blocks) {
  			block := new(types.Block)
  			if err := stream.Decode(block); err == io.EOF {
  				break
  			} else if err != nil {
  				return false, fmt.Errorf("block %d: failed to parse: %v", index, err)
  			}
  			blocks = append(blocks, block)
  			index++
  		}
  		if len(blocks) == 0 {
  			break
  		}
  
  		if hasAllBlocks(api.eth.BlockChain(), blocks) {
  			blocks = blocks[:0]
  			continue
  		}
  		// Import the batch and reset the buffer
  		if _, err := api.eth.BlockChain().InsertChain(blocks); err != nil {
  			return false, fmt.Errorf("batch %d: failed to insert: %v", batch, err)
  		}
  		blocks = blocks[:0]
  	}
  	return true, nil
  }
docs: // ImportChain imports a blockchain from a local file.