示例#1
0
// Throw away chains are used for eris contracts
func ThrowAwayChain(do *definitions.Do) error {
	do.Name = do.Name + "_" + strings.Split(uuid.New(), "-")[0]
	do.Path = filepath.Join(ChainsPath, "default")
	logger.Debugf("Making a ThrowAwayChain =>\t%s:%s\n", do.Name, do.Path)

	if err := NewChain(do); err != nil {
		return err
	}

	logger.Debugf("ThrowAwayChain created =>\t%s\n", do.Name)
	do.Run = true  // turns on edb api
	StartChain(do) // XXX [csk]: may not need to do this now that New starts....
	logger.Debugf("ThrowAwayChain started =>\t%s\n", do.Name)
	return nil
}
示例#2
0
// Throw away chains are used for eris contracts
func ThrowAwayChain(do *definitions.Do) error {
	do.Name = do.Name + "_" + strings.Split(uuid.New(), "-")[0]
	do.Path = filepath.Join(ChainsPath, "default")
	log.WithFields(log.Fields{
		"=>":   do.Name,
		"path": do.Path,
	}).Debug("Making a throaway chain")

	if err := NewChain(do); err != nil {
		return err
	}

	log.WithField("=>", do.Name).Debug("Throwaway chain created")
	do.Run = true  // turns on edb api
	StartChain(do) // XXX [csk]: may not need to do this now that New starts....
	log.WithField("=>", do.Name).Debug("Throwaway chain started")
	return nil
}
示例#3
0
// Throw away chains are used for eris contracts
func ThrowAwayChain(do *definitions.Do) error {
	do.Name = do.Name + "_" + strings.Split(uuid.New(), "-")[0]
	do.Path = filepath.Join(ChainsConfigPath, "default")
	logger.Debugf("Making a ThrowAwayChain =>\t%s:%s\n", do.Name, do.Path)

	if err := NewChain(do); err != nil {
		return err
	}

	logger.Debugf("ThrowAwayChain created =>\t%s\n", do.Name)

	// fakeId := strings.Split(uuid.New(), "-")[0]
	// srv, err := loaders.MockChainDefinition(do.Name, fakeId, true, 1)
	// if err != nil {
	// 	return err
	// }

	StartChain(do)

	logger.Debugf("ThrowAwayChain started =>\t%s\n", do.Name)
	return nil
}
示例#4
0
func uuidMake() string {
	return strings.Split(uuid.New(), "-")[0]
}