Beispiel #1
0
func CreateEmptyTestState() *state.State {
	s := new(state.State)
	s.LoadConfig("", "")
	s.Init()
	state.LoadDatabase(s)
	return s
}
Beispiel #2
0
func startServers(load bool) {

	for i, fnode := range fnodes {
		if i > 0 {
			fnode.State.Init()
		}
		go NetworkProcessorNet(fnode)
		if load {
			go state.LoadDatabase(fnode.State)
		}
		go Timer(fnode.State)
		go fnode.State.ValidatorLoop()
	}
}
Beispiel #3
0
func CreateAndPopulateTestState() *state.State {
	s := new(state.State)
	s.DB = CreateAndPopulateTestDatabaseOverlay()
	s.LoadConfig("", "")
	s.Init()
	s.NetworkNumber = constants.NETWORK_MAIN
	/*err := s.RecalculateBalances()
	if err != nil {
		panic(err)
	}*/
	s.SetFactoshisPerEC(1)
	state.LoadDatabase(s)
	s.UpdateState()
	go s.ValidatorLoop()
	time.Sleep(30 * time.Millisecond)

	return s
}
func CreateAndPopulateTestStateForFER(testEntries []FEREntryWithHeight, desiredHeight int) *state.State {
	s := new(state.State)
	s.DB = CreateAndPopulateTestDatabaseOverlayForFER(testEntries, desiredHeight)
	s.LoadConfig("", "")
	s.Init()
	/*err := s.RecalculateBalances()
	if err != nil {
		panic(err)
	}*/
	s.SetFactoshisPerEC(1)
	state.LoadDatabase(s)
	s.FERChainId = "111111118d918a8be684e0dac725493a75862ef96d2d3f43f84b26969329bf03"
	s.UpdateState()
	go s.ValidatorLoop()
	time.Sleep(20 * time.Millisecond)

	return s
}