示例#1
0
func EditChain(do *definitions.Do) error {
	chainConf, err := util.LoadViperConfig(path.Join(BlockchainsPath), do.Name, "chain")
	if err != nil {
		return err
	}
	if err := util.Edit(chainConf, do.Args); err != nil {
		return err
	}
	var chain definitions.Chain
	loaders.MarshalChainDefinition(chainConf, &chain)
	return WriteChainDefinitionFile(&chain, chainConf.ConfigFileUsed())
}
示例#2
0
// read the config file into viper
func loadContractPackage(path string) (*viper.Viper, error) {
	return util.LoadViperConfig(path, "package", "contracts")
}
示例#3
0
// read the config file into viper
func loadChainDefinition(chainName string) (*viper.Viper, error) {
	return util.LoadViperConfig(path.Join(BlockchainsPath), chainName, "chain")
}
示例#4
0
func loadServiceDefinition(servName string) (*viper.Viper, error) {
	return util.LoadViperConfig(path.Join(ServicesPath), servName, "service")
}