He later served on the Legislative Council. He was one of the first labour representatives in Parliament. He received his education in his home town and showed considerable ability at school.
He trained as an all-round mechanic after his schooling.
Aged 21, he left for the United States, where he spent two years. He visited Australia and came to New Zealand in 1878.
He first settled in Christchurch and worked at the Addington Railway Workshops. In 1890, Earnshaw contested the Peninsula electorate against the incumbent, William Larnach.
Earnshaw"s victory made him a national figure, one of the new breed of working-class MPs.
Earnshaw represented the Peninsula electorate until the end of the term in 1893, and then the City of Dunedin electorate (1893–1896) in the House of Representatives. A strong prohibitionist, Earnshaw became one of Sir Robert Stout"s few consistent supporters in Parliament after 1893. This put him off-side with Premier Richard Seddon.
Earnshaw came seventh in the three-member Dunedin electorate in the 1896 election.
He came eighth in the three-member Wellington electorate in the 1899 election. Earnshaw was appointed to the Legislative Council in 1913 and served until his death in 1931.
After his 1899 defeat, Earnshaw moved to Gillespies Beach near Fox Glacier, where he was involved in dredging. He later took employment with the Wellington Harbour Board prior to his appointment to the Legislative Council.
He died on 29 December 1931 at Wellington Hospital after a short illness.