config

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2020 License: GPL-3.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(cfgToml string, cfg interface{}) error

func LoadFromCliFlag

func LoadFromCliFlag(c *cli.Context, cfg interface{}) error

Types

type Config

type Config struct {
	Identity Identity `validate:"required"`
	// Domain    string       `validate:"required"`
	// Namespace string       `validate:"required"`
	Server       Server    `validate:"required"`
	Web3         Web3      `validate:"required"`
	KeyStore     KeyStore  `validate:"required"`
	KeyStoreBaby KeyStore  `validate:"required"`
	Contracts    Contracts `validate:"required"`
	Account      struct {
		Address common.Address `validate:"required"`
	} `validate:"required"`
	Storage struct {
		Path string
	} `validate:"required"`
	Issuer struct {
		PublishStatePeriod        Duration `validate:"required"`
		SyncIdenStatePublicPeriod Duration `validate:"required"`
		ConfirmBlocks             uint64   `validate:"required"`
	}
	IdenPubOffChain  IdenPubOffChain `validate:"required"`
	IdenStateZKProof struct {
		Levels int     `validate:"required"`
		Files  ZkFiles `validate:"required"`
	} `validate:"required"`
}

type Contract

type Contract struct {
	// JsonABI string         `validate:"required"`
	Address common.Address `validate:"required"`
}

type Contracts

type Contracts struct {
	IdenStates Contract `validate:"required"`
}

type Duration

type Duration struct {
	time.Duration
}

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(data []byte) error

type EthKeys

type EthKeys struct {
	KDis        common.Address `validate:"required"`
	KReen       common.Address `validate:"required"`
	KUpdateRoot common.Address `validate:"required"`
}

type IdenPubOffChain

type IdenPubOffChain struct {
	Http struct {
		Url string `validate:"required"`
	} `validate:"required"`
}

type Identity

type Identity struct {
	Id   core.ID `validate:"required"`
	Keys struct {
		// Ethereum EthKeys `validate:"required"`
		BabyJub KeysBabyJub `validate:"required"`
	} `validate:"required"`
}

type KeyStore

type KeyStore struct {
	Path     string   `validate:"required"`
	Password Password `validate:"required"`
}

type KeysBabyJub

type KeysBabyJub struct {
	KOp babyjub.PublicKey `validate:"required"`
}

type Password

type Password struct {
	Value string  // private content
	Path  *string // path of the file with the password
}

func (*Password) String

func (p *Password) String() string

func (*Password) UnmarshalText

func (p *Password) UnmarshalText(data []byte) error

UnmarshalText unmarshals the Password using the following rules Password can be prefixed by two options

'file://': <path to file containing the password>
'password//': raw password

type Server

type Server struct {
	ServiceApi string `validate:"required"`
	AdminApi   string `validate:"required"`
}

type Web3

type Web3 struct {
	Url string `validate:"required"`
}

type ZkFiles added in v0.0.2

type ZkFiles struct {
	Url              string
	Path             string `validate:"required"`
	ProvingKeyFormat zkutils.ProvingKeyFormat
	CacheProvingKey  bool
	Hashes           ZkFilesHashes `validate:"required"`
}

func (*ZkFiles) Value added in v0.0.2

func (z *ZkFiles) Value() *zkutils.ZkFiles

type ZkFilesHashes added in v0.0.2

type ZkFilesHashes struct {
	ProvingKey      string `validate:"required"`
	VerificationKey string `validate:"required"`
	WitnessCalcWASM string `validate:"required"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL