local syncedDirectory = asset.syncedResource({
  Name = "General SPK Kernels",
  Type = "HttpSynchronization",
  Identifier = "general_spk",
  Version = 2
})

local kernels = {
  asset.localResource("naif0012.tls"),
  -- Leapseconds:
  asset.localResource("pck00010.tpc"),
  syncedDirectory .. "de430.bsp"
}

asset.onInitialize(function()
  for _, kernel in ipairs(kernels) do
    openspace.spice.loadKernel(kernel)
  end
end)
  
asset.onDeinitialize(function()
  for i = #kernels, 1, -1 do
    openspace.spice.unloadKernel(kernels[i]) 
  end
end)


asset.meta = {
  Name = "SPICE Base",
  Version = "1.0",
  Description = [[This asset contains the spice base kernels. With positions for Solar
    System bodies from 1850 to 2150]],
  Author = "OpenSpace Team",
  URL = "https://naif.jpl.nasa.gov/naif/data_generic.html",
  License = "NASA"
}
