func (s *server) GetSlotNumber(ctx context.Context, in *empty.Empty) (*pb.SlotNumberResponse, error) {
	state := s.chain.GetState()
	config := s.chain.GetConfig()
	genesisTime := state.GenesisTime
	timePerSlot := config.SlotDuration
	currentTime := utils.Now().Unix()
	currentSlot := (currentTime - int64(genesisTime)) / int64(timePerSlot)
	if currentSlot < 0 {
		currentSlot = 0
	}
	block := s.chain.View.Chain.GetBlockBySlot(uint64(currentSlot))
	return &pb.SlotNumberResponse{SlotNumber: uint64(currentSlot), BlockHash: block.Hash[:], TipSlot: block.Slot}, nil
}
// GetSlotNumber gets the current slot number.
GetSlotNumber gets the current slot number.
// GetSlotNumber gets the current slot number .
func (s *server) GetSlotNumber(ctx context.Context, in *empty.Empty) (*pb.SlotNumberResponse, error) {
	state := s.chain.GetState()
	config := s.chain.GetConfig()
	genesisTime := state.GenesisTime
	timePerSlot := config.SlotDuration
	currentTime := utils.Now().Unix()
	currentSlot := (currentTime - int64(genesisTime)) / int64(timePerSlot)
	if currentSlot < 0 {
		currentSlot = 0
	}
	block := s.chain.View.Chain.GetBlockBySlot(uint64(currentSlot))
	return &pb.SlotNumberResponse{SlotNumber: uint64(currentSlot), BlockHash: block.Hash[:], TipSlot: block.Slot}, nil
}
func ( s * server ) GetSlotNumber ( ctx context . Context , in * empty . Empty ) ( * pb . SlotNumberResponse , error ) { state := s . chain . GetState ( ) config := s . chain . GetConfig ( ) genesisTime := state . GenesisTime timePerSlot := config . SlotDuration currentTime := utils . Now ( ) . Unix ( ) currentSlot := ( currentTime - int64 ( genesisTime ) ) / int64 ( timePerSlot ) if currentSlot < 0 { currentSlot = 0 } block := s . chain . View . Chain . GetBlockBySlot ( uint64 ( currentSlot ) ) return & pb . SlotNumberResponse { SlotNumber : uint64 ( currentSlot ) , BlockHash : block . Hash [ : ] , TipSlot : block . Slot } , nil }
GetSlotNumber gets the current slot number.
GetSlotNumber gets the current slot number .