During the American Civil War, British India was the main source for saltpeter for the manufacture of gunpowder for the Union armies. This supply was threatened by the British government during the Trent Affair, when Union naval forces stopped a British ship, the RMS Trent, and removed two Confederate diplomats. The British government responded in part by halting all exports of saltpeter to the United States, threatening their gunpowder manufacturing resources. Shortly thereafter, the situation was resolved and the Confederate diplomats were released.
The Union Navy blockaded the southern Confederate States, which reduced the amount of gunpowder that could be imported from overseas. The Confederate Nitre and Mining Bureau was formed to produce gunpowder for the army and the navy from domestic resources. Nitre is the English spelling of "Niter". While carbon and sulfur were readily available throughout the south, potassium nitrate was often produced from the Calcium nitrate found in cave dirt, tobacco barn floors and barn stalls other places. A number of caves were mined, and the men and boys who worked in the caves were called "peter monkey", somewhat in imitation of the naval term "powder monkey" that was used for the boys who brought up charges of gunpowder on gunboats.
On 13 November 1862, the Confederate government advertised in the Charleston Daily Courier for 20 or 30 "able bodied Negro men" to work in the new nitre beds at Ashley Ferry, S.C. The nitre beds were large rectangles of rotted manure and straw, moistened weekly with urine, "dung water", and liquid from privies, cesspools and drains, and turned over regularly.  The process was designed to yield saltpeter, an ingredient of gunpowder, which the Confederate army needed during the Civil War. The South was so desperate for saltpeter for gunpowder that one Alabama official reportedly placed a newspaper ad asking that the contents of chamber pots be saved for collection.  In the winter of 1863, scores of enslaved people were set to work extracting it from a huge cave in Barstow County, Ga., where they labored by torchlight in grim conditions, hauling out and processing the so-called "peter dirt",. In South Carolina, in April 1864, the Confederate government hired 31 enslaved people to work at the Ashley Ferry Nitre Works.