He was then appointed chief-of-staff to General Horatio Gates, with the rank of colonel, and accompanied him into Canada, and soon after congress appointed him quartermaster-general of the Northern Army.