Core Scientific files for bankruptcy while generating positive cash flow