// CreateConsensusEngine creates the required type of consensus engine instance for an Matrix service
CreateConsensusEngine creates the required type of consensus engine instance for an Matrix service
// CreateConsensusEngine creates the required type of consensus engine instance for an Matrix service
func CreateConsensusEngineMap(ctx *pod.ServiceContext, config *manash.Config, chainConfig *params.ChainConfig, db mandb.Database) (map[string]consensus.Engine, map[string]consensus.DPOSEngine) {
	pictureStorePath := filepath.Join(ctx.GetConfig().DataDir, "picstore")
	pictureList := make([]string, 0)
	for i := 0; i < 16; i++ {
		pictureList = append(pictureList, filepath.Join(pictureStorePath, "test_"+strconv.Itoa(i)+".jpg"))
	}
	aidigger.Init(ctx.GetConfig().DataDir, pictureList)
	engineMap := make(map[string]consensus.Engine)
	alphaEngine := CreateConsensusEngine(ctx, config, chainConfig, db)
	aiMineEngine := amhash.New(amhash.Config{PowMode: amhash.ModeNormal, PictureStorePath: pictureStorePath})
	aiMineEngine.SetThreads(-1) 
	engineMap[manversion.VersionAlpha] = alphaEngine
	engineMap[manversion.VersionBeta] = alphaEngine
	engineMap[manversion.VersionGamma] = alphaEngine
	engineMap[manversion.VersionDelta] = alphaEngine
	engineMap[manversion.VersionAIMine] = aiMineEngine
	dposEngineMap := make(map[string]consensus.DPOSEngine)
	alphaDposEngine := mtxdpos.NewMtxDPOS(chainConfig.SimpleMode)
	dposEngineMap[manversion.VersionAlpha] = alphaDposEngine
	dposEngineMap[manversion.VersionBeta] = alphaDposEngine
	dposEngineMap[manversion.VersionGamma] = alphaDposEngine
	dposEngineMap[manversion.VersionDelta] = alphaDposEngine
	dposEngineMap[manversion.VersionAIMine] = alphaDposEngine
	return engineMap, dposEngineMap
}
func CreateConsensusEngineMap ( ctx * pod . ServiceContext , config * manash . Config , chainConfig * params . ChainConfig , db mandb . Database ) ( map [ string ] consensus . Engine , map [ string ] consensus . DPOSEngine ) { pictureStorePath := filepath . Join ( ctx . GetConfig ( ) . DataDir , " " ) pictureList := make ( [ ] string , 0 ) for i := 0 ; i < 16 ; i ++ { pictureList = append ( pictureList , filepath . Join ( pictureStorePath , " " + strconv . Itoa ( i ) + " " ) ) } aidigger . Init ( ctx . GetConfig ( ) . DataDir , pictureList ) engineMap := make ( map [ string ] consensus . Engine ) alphaEngine := CreateConsensusEngine ( ctx , config , chainConfig , db ) aiMineEngine := amhash . New ( amhash . Config { PowMode : amhash . ModeNormal , PictureStorePath : pictureStorePath } ) aiMineEngine . SetThreads ( - 1 ) engineMap [ manversion . VersionAlpha ] = alphaEngine engineMap [ manversion . VersionBeta ] = alphaEngine engineMap [ manversion . VersionGamma ] = alphaEngine engineMap [ manversion . VersionDelta ] = alphaEngine engineMap [ manversion . VersionAIMine ] = aiMineEngine dposEngineMap := make ( map [ string ] consensus . DPOSEngine ) alphaDposEngine := mtxdpos . NewMtxDPOS ( chainConfig . SimpleMode ) dposEngineMap [ manversion . VersionAlpha ] = alphaDposEngine dposEngineMap [ manversion . VersionBeta ] = alphaDposEngine dposEngineMap [ manversion . VersionGamma ] = alphaDposEngine dposEngineMap [ manversion . VersionDelta ] = alphaDposEngine dposEngineMap [ manversion . VersionAIMine ] = alphaDposEngine return engineMap , dposEngineMap }
CreateConsensusEngine creates the required type of consensus engine instance for an Matrix service
CreateConsensusEngine creates the required type of consensus engine instance for an Matrix service
// Disable CPU mining