Template synthesis of carbon nanotubes