Example #1
0
func (m *EOM) FollowerExecute(state interfaces.IState) error {

	state.GetFactoidState().EndOfPeriod(int(m.Minute))

	switch state.GetNetworkNumber() {
	case constants.NETWORK_MAIN: // Main Network
		panic("Not implemented yet")
	case constants.NETWORK_TEST: // Test Network
		panic("Not implemented yet")
	case constants.NETWORK_LOCAL: // Local Network

	default:
		panic(fmt.Sprintf("Not implemented yet: Network Number %d", state.GetNetworkNumber()))
	}

	// fmt.Println(state.GetServerState(), constants.SERVER_MODE)

	if m.Minute == 9 {
		state.ProcessEndOfBlock()
		if state.GetServerState() == constants.SERVER_MODE {
			state.LeaderInMsgQueue() <- m
		}
	}

	return nil
}
// Returns true if this is a message for this server to execute as
// a leader.
func (m *DirectoryBlockSignature) Leader(state interfaces.IState) bool {
	switch state.GetNetworkNumber() {
	case 0: // Main Network
		panic("Not implemented yet")
	case 1: // Test Network
		panic("Not implemented yet")
	case 2: // Local Network
		panic("Not implemented yet")
	default:
		panic("Not implemented yet")
	}
}
Example #3
0
// Returns true if this is a message for this server to execute as
// a leader.
func (m *MsgPing) Leader(state interfaces.IState) bool {
	switch state.GetNetworkNumber() {
	case 0: // Main Network
		panic("Not implemented yet")
	case 1: // Test Network
		panic("Not implemented yet")
	case 2: // Local Network
		panic("Not implemented yet")
	default:
		panic("Not implemented yet")
	}
}