Crush the peanuts in a pestle and mortar or pulse them in a blender for a few seconds. Set aside.
Toast the gram flour in a dry pan until it starts to colour, about 3-4 mins. Move it around frequently with a spatula to make sure it doesn’t burn. Once it gets to a slightly darker shade of brown and starts to smell nutty, remove from heat and set aside.
Wipe down the same pan for the shallots. Add the oil and fry the shallots until they brown and crisp up. When they're nearly there, add the garlic and lightly brown. Drain on paper towels.
Prep the guavas: Halve the guavas. Use a spoon to hollow out the seeds. Discard the seeds. Slice the guavas into thin wedges.
Toss the guavas, toasted gram flour, fried shallots and garlic, sugar, chilli flakes, lime juice, and salt in a bowl. Use your hands to toss everything together. Taste and adjust seasoning. Top with the crushed peanuts and serve.