package main

import (
	"sparrow/pkg/rpcs"
	"sparrow/pkg/server"
)

func main() {
	err := server.Init(rpcs.ShadowServiceName)
	if err != nil {
		server.Log.Fatal(err)
		return
	}
	service := NewShadowStoreService()
	srv := NewShadowServer(service)

	if err = server.RegisterRPCHandler(srv); err != nil {
		panic(err)
	}
	// start to run
	err = server.Run()
	if err != nil {
		server.Log.Fatal(err)
	}
}
