Example #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())
}
Example #2
0
// read the config file into viper
func loadContractPackage(path string) (*viper.Viper, error) {
	return util.LoadViperConfig(path, "package", "contracts")
}
Example #3
0
// read the config file into viper
func loadChainDefinition(chainName string) (*viper.Viper, error) {
	return util.LoadViperConfig(path.Join(BlockchainsPath), chainName, "chain")
}
Example #4
0
func loadServiceDefinition(servName string) (*viper.Viper, error) {
	return util.LoadViperConfig(path.Join(ServicesPath), servName, "service")
}