func getValidatorHandle(id uint64) (handle *pb.PeerID, err error) {
	name := "vp" + strconv.FormatUint(id, 10)
	return &pb.PeerID{Name: name}, nil
}
Returns the peer handle that corresponds to a validator ID (uint64 assigned to it for PBFT)
package obcpbft
import (
	"fmt"
	"strconv"
	"strings"
	"github.com/openblockchain/obc-peer/openchain/consensus"
	pb "github.com/openblockchain/obc-peer/protos"
	"github.com/spf13/viper"
)
const configPrefix = "OPENCHAIN_OBCPBFT"
var pluginInstance consensus.Consenter  
var config *viper.Viper
func init() {
	config = loadConfig()
}
func GetPlugin(c consensus.Stack) consensus.Consenter {
	if pluginInstance == nil {
		pluginInstance = New(c)
	}
	return pluginInstance
}
func New(stack consensus.Stack) consensus.Consenter {
	handle, _, _ := stack.GetNetworkHandles()
	id, _ := getValidatorID(handle)
	switch config.GetString("general.mode") {
	case "classic":
		return newObcClassic(id, config, stack)
	case "batch":
		return newObcBatch(id, config, stack)
	case "sieve":
		return newObcSieve(id, config, stack)
	default:
		panic(fmt.Errorf("Invalid PBFT mode: %s", config.GetString("general.mode")))
	}
}
func loadConfig() (config *viper.Viper) {
	config = viper.New()
	config.SetEnvPrefix(configPrefix)
	config.AutomaticEnv()
	replacer := strings.NewReplacer(".", "_")
	config.SetEnvKeyReplacer(replacer)
	config.SetConfigName("config")
	config.AddConfigPath("./")
	config.AddConfigPath("./openchain/consensus/obcpbft/")
	config.AddConfigPath("../../openchain/consensus/obcpbft")
	err := config.ReadInConfig()
	if err != nil {
		panic(fmt.Errorf("Error reading %s plugin config: %s", configPrefix, err))
	}
	return
}
func getValidatorID(handle *pb.PeerID) (id uint64, err error) {
	if startsWith := strings.HasPrefix(handle.Name, "vp"); startsWith {
		id, err = strconv.ParseUint(handle.Name[2:], 10, 64)
		if err != nil {
			return id, fmt.Errorf("Error extracting ID from \"%s\" handle: %v", handle.Name, err)
		}
		return
	}
	err = fmt.Errorf(`For MVP, set the VP's peer.id to vpX,
		where X is a unique integer between 0 and N-1
		(N being the maximum number of VPs in the network`)
	return
}