The day before, or at least 12h ahead of cooking, soak the beans in cold water. 12 hours later, drain them. Peel 1 onion, stick the cloves in it.
Peel and chop the carrot. Peel the garlic cloves.
In a pot, bring 1 L water to a boil, then add the beans, carrot, onion, garlic, and star anise. Simmer over low heat 40 minutes.
Meanwhile, peel and chop the other onion.
In a pan, melt the fat of choice, add the onion and bacon and brown them.
Drain the beans, saving the cooking fluids. Pour the beans into the pan with the onion and bacon. Season with salt and pepper, stir, then add the flour, 1 cup cooking fluids, the bouquet garni and simmer until liquids have reduced.
Serve hot.