func (a Account) Marshal() []byte {
	var result bytes.Buffer
	encoder := gob.NewEncoder(&result)
	err := encoder.Encode(a)
	if err != nil {
		log.Error(err)
	}
	return result.Bytes()
}
Serialize serializes the account
package blockchain
import (
	"bytes"
	"encoding/gob"
	log "github.com/sirupsen/logrus"
)
type Account struct {
	DateOfBirth  string `json:"dateOfBirth" validate:"len=10"`
	FirstName    string `json:"firstName" validate:"nonzero"`
	LastName     string `json:"lastName" validate:"nonzero"`
	Organization string `json:"organization" validate:"nonzero"`
	Position     string `json:"position" validate:"nonzero"`
	Email        string `json:"email" validate:"min=6,max=80"`
	Phone        string `json:"phone" validate:"min=6,max=40"`
	Address      string `json:"address" validate:"min=10,max=140"`
	PublicKey    string `json:"publicKey" validate:"len=128"`
	Role         `json:"role"`
	LastModified int64 `json:"lastModified"`
}
type Role struct {
	Name                    string   `json:"name"`
	CollectionsWrite        []string `json:"collectionsWrite"`
	CollectionsReadOverride []string `json:"collectionsReadOverride"`
}