Major Anderson relocated his command to Sumter under President Buchanan soon after South Carolina seceded. The move was approved by then Sec. of War. It was months later that Jefferson Davis ordered Gen. Beauregard to shell the fort if Anderson refused to surrender the Fort. That was in response to Lincoln's attempt to resupply the Fort with provisions only. The re-supply ships had not reach the Fort when the first shots were fired.
Refusing to remove federal troops from the territory of South Carolina was an act of war. So was the attempt to resupply it. Those ships had to intrude on the territorial waters of South Carolina to resupply it.
Hitler used the same technique when he sent troops into the Danzig corridor, and Polish troops then fired on them. Hitler claimed the Poles fired first, so they were the aggressors. Hitler was a dedicated student of Lincoln's methods.