func (d DockerCompose) UpgradeLocalNetwork(config networkspec.Config) error {
	d.Config = config
	configPath := paths.ConfigFilePath("docker")
	d = DockerCompose{ConfigPath: configPath, Action: []string{"down"}}
	_, err := networkclient.ExecuteCommand("docker-compose", d.Args(), true)
	if err != nil {
		logger.WARNING("Unable to delete all active endpoints")
	}
	err = networkclient.UpgradeDB(config, "")
	if err != nil {
		return err
	}
	d = DockerCompose{ConfigPath: configPath, Action: []string{"up", "-d"}}
	_, err = networkclient.ExecuteCommand("docker-compose", d.Args(), true)
	if err != nil {
		return err
	}
	return nil
}
UpgradeLocalNetwork -- To upgrade the network in the local environment
package dockercompose
import (
	"fmt"
	"os"
	"strings"
	"github.com/hyperledger/fabric-test/tools/operator/launcher/nl"
	"github.com/hyperledger/fabric-test/tools/operator/logger"
	"github.com/hyperledger/fabric-test/tools/operator/networkclient"
	"github.com/hyperledger/fabric-test/tools/operator/networkspec"
	"github.com/hyperledger/fabric-test/tools/operator/paths"
	"github.com/pkg/errors"
)
type DockerCompose struct {
	ConfigPath string
	Action     []string
	Config     networkspec.Config
}
func (d DockerCompose) Args() []string {
	args := []string{"-f", d.ConfigPath}
	return append(args, d.Action...)
}
func (d DockerCompose) GenerateConfigurationFiles(upgrade bool) error {
	network := nl.Network{TemplatesDir: paths.TemplateFilePath("docker")}
	err := network.GenerateConfigurationFiles(upgrade)
	if err != nil {
		return err
	}
	return nil
}
func (d DockerCompose) LaunchLocalNetwork(config networkspec.Config) error {
	d.Config = config
	configPath := paths.ConfigFilePath("docker")
	d = DockerCompose{ConfigPath: configPath, Action: []string{"up", "-d"}}
	_, err := networkclient.ExecuteCommand("docker-compose", d.Args(), true)
	if err != nil {
		return err
	}
	return nil
}