Graphite electrodes with tailored porosity for rechargeable ion-transfer batteries