示例#1
0
func NewChain(do *definitions.Do) error {
	// read chainID from genesis. genesis may be in dir
	// if no genesis or no genesis.chain_id, chainID = name
	var err error
	if do.GenesisFile = resolveGenesisFile(do.GenesisFile, do.Path); do.GenesisFile == "" {
		do.ChainID = do.Name
	} else {
		do.ChainID, err = getChainIDFromGenesis(do.GenesisFile, do.Name)
		if err != nil {
			return err
		}
	}
	logger.Debugf("Starting Setup for ChnID =>\t%s\n", do.ChainID)
	return setupChain(do, loaders.ErisChainNew)
}