Exemple #1
0
func init() {

	//Open|Create Log File
	logFileName := "bin/log.txt"
	logFile, err := os.OpenFile(logFileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0664)
	if err != nil {
		log.Println("Unable to Create/Open log file. No output will be captured.")
	} else {
		log.SetOutput(logFile)
		log.Println("Benchmark Started:")
	}
	log.SetFlags(log.Lshortfile | log.Ltime | log.Ldate)

	objects.RegisterGeterPoster(
		services.GetPublicKeyForHkid,
		services.GetPrivateKeyForHkid,
		services.PostKey,
		services.PostBlob,
	)
	localfile.Start()
	//Post(benchmarkRepo, "BlobFound", blob("blob found"))
	//Post(benchmarkRepo, "listFound/BlobFound", blob("list found"))
	benchmarkRepo = objects.HkidFromDString("44089867384569081480066871308647"+
		"4832666868594293316444099156169623352946493325312681245061254048"+
		"6538169821270508889792789331438131875225590398664679212538621", 10)
	log.Printf("Benchmark Repository HKID: %s\n", benchmarkRepo)
	benchmarkCommitHkid = objects.HkidFromDString("36288652923287342545336063204999"+
		"9357791979761632757400493952327434464825857894440491353330036559"+
		"1539025688752776406270441884985963379175226110071953813093104", 10)
	log.Printf("Benchmark Commit HKID: %s\n", benchmarkCommitHkid)
	benchmarkTagHkid = objects.HkidFromDString("54430439211086161065670118078952"+
		"6855263811485554809970416168964497131310494084201908881724207840"+
		"2305843436117034888111308798569392135240661266075941854101839", 10)
	log.Printf("Benchmark Tag HKID: %s\n", benchmarkTagHkid)
}
Exemple #2
0
func init() {
	log.SetFlags(log.Lshortfile | log.Ltime | log.Ldate)
	localfile.Start()
	timeout.Start()
	objects.RegisterGeterPoster(
		services.GetPublicKeyForHkid,
		services.GetPrivateKeyForHkid,
		services.PostKey,
		services.PostBlob,
	)
}
Exemple #3
0
func start() {
	go func() { //defining, calling and throwing to a different thread
		ch := make(chan os.Signal, 1) //ch is the name of the channel.
		signal.Notify(ch, os.Interrupt, os.Kill)
		sig := <-ch
		log.Printf("Got signal: %s", sig)
		log.Printf("Stopping...")
		stopAll()
	}()

	//This Block registers the services for the object module to use
	objects.RegisterGeterPoster(
		services.GetPublicKeyForHkid,
		services.GetPrivateKeyForHkid,
		services.PostKey,
		services.PostBlob,
	)

	Flags, Command := parseFlags()
	go localfile.Start()
	go timeout.Start()

	if *Flags.serve {
		web.Start()
		crawler.Start()
	}
	//if *Flags.mount {
	//	fuse.Start()
	//}
	if *Flags.dht {
		kademliadht.Start()
	}
	if *Flags.apps {
		appsscript.Start()
	}
	//if *Flags.drive {
	//	googledrive.Start()
	//}
	if *Flags.direct {
		directhttp.Start()
	}
	if *Flags.lan {
		multicast.Start()
	}

	addCurators(Command)
}