The elected government of Gaza started a war. If they wish it to end all they have to do is surrender and release the hostages. Israel presented that deal early on. Hamas leaders can release the hostages and live out their lives in prison or die. That's more than fair.
Civilians always suffer in war. War kind of sucks that way. Hamas really should have given that some thought before picking a fight.
And by the way a "two state solution" will never work.