func (config *Configuration) Account(name string) (*account.Account, error) {
	acc, err := account.AccountFromBase58(name)
	if nil == err {
		return acc, nil
	}
	id, err := config.Identity(name)
	if nil != err {
		return nil, err
	}
	acc, err = account.AccountFromBase58(id.Account)
	return acc, err
}
Account - find identity for a given name and convert to an account
package configuration
import (
	"encoding/json"
	"os"
	"path/filepath"
	"github.com/bitmark-inc/bitmarkd/account"
	"github.com/bitmark-inc/bitmarkd/fault"
)
type Configuration struct {
	DefaultIdentity string              `json:"default_identity"`
	TestNet         bool                `json:"testnet"`
	Connections     []string            `json:"connections"`
	Identities      map[string]Identity `json:"identities"`
}
type Identity struct {
	Description string `json:"description"`
	Account     string `json:"account"`
	Data        string `json:"data"`
	Salt        string `json:"salt"`
}
func Load(filename string) (*Configuration, error) {
	options := &Configuration{}
	err := readConfiguration(filename, options)
	if nil != err {
		return nil, err
	}
	return options, nil
}
func readConfiguration(filename string, options interface{}) error {
	filename, err := filepath.Abs(filepath.Clean(filename))
	if nil != err {
		return err
	}
	f, err := os.Open(filename)
	if nil != err {
		return err
	}
	defer f.Close()
	dec := json.NewDecoder(f)
	err = dec.Decode(options)
	if nil != err {
		return err
	}
	return nil
}
func (config *Configuration) Identity(name string) (*Identity, error) {
	_, err := account.AccountFromBase58(name)
	if nil == err {
		return nil, fault.InvalidIdentityName
	}
	id, ok := config.Identities[name]
	if !ok {
		return nil, fault.IdentityNameNotFound
	}
	return &id, nil
}