There are two separate types of the Federal census of population, the original manuscript form that lists all the people's names (depending on the year taken, only heads of households are listed from 1790 to 1840) and the aggregate data drawn from the original manuscript returns. The aggregate data can tell you how many people were living in a certain area at a certain ten year period. As to how race is described, this varies from different years.
Use these sources to find out if your man served in the Civil War.
If you are lucky enough to find someone who served in the Civil War or other wars, you may luck out and discover they received a pension! A pension file can provide you with all sorts of genealogical and individual information! Unfortunately these are not available online. Some Civil War Widow's pensions are (if the soldier died in the war), however. Doing military research is another whole lecture topic of its own. If you find a soldier I can do my best to help you. Most pension and other military records on a national level are available at the National Archives in Washington, D.C.
City and town borders of Boston, Suffolk, Massachusetts, USA, on a map of Suffolk County. Also shows annexed towns of Brighton, Charleston, Dorchester, Hyde Park, Roxbury, and West Roxbury.
From https://familysearch.org/wiki/en/Boston_Massachusetts_genealogy
Most directories started being published around the 1840's, this will vary from city or town. You will not find all city directories online! You can find them at the Boston Public Library, the State Library of Massachusetts and city and town public libraries. For towns bordering Boston, you may find them combined with the city of Boston directories.