African American soldiers in the Civil War

How did African American soldiers contribute in the Civil War? What kind of
discrimination did they face in the Union army?