config

package
v0.0.0-...-80b22ab Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: AGPL-3.0 Imports: 2 Imported by: 6

Documentation

Index

Constants

View Source
const (
	//ListSize is the number of cards shown in list of blocks/processes/etc
	ListSize = 10
	//MaxListSize is the largest number of elements in a list
	MaxListSize = 1 << 32
	//HomeWidgetBlocksListSize is the number of blocks shown on the homepage
	HomeWidgetBlocksListSize = 4
	//NumBlockUpdates is the number of blocks updated per db batch
	NumBlockUpdates = 100
	//DBWaitTime is the number of milliseconds the backend waits before batching another set of blocks
	DBWaitTime = 0
	//ProcessHeightPrefix is the key prefix for processes by height
	ProcessHeightPrefix = "ph_"
	//EntityHeightPrefix is the key prefix for entity id's by height
	EntityHeightPrefix = "eh_"
	//BlockHeightPrefix is the key prefix for block hashes by height
	BlockHeightPrefix = "bh_"
	//BlockHashPrefix is the key prefix for blocks by hash
	BlockHashPrefix = "bid"
	//TxHeightPrefix is the key prefix for transaction hashes by height
	TxHeightPrefix = "th_"
	//TxHashPrefix is the key prefix for transactions by hash
	TxHashPrefix = "tid"
	//ValidatorPrefix is the key prefix for validators by address
	ValidatorPrefix = "vid"
	//EnvPackagePrefix is the key prefix for envelope packages by height
	EnvPackagePrefix = "evh"
	//EnvNullifierPrefix is the key prefix for envelope heights by nullifier
	EnvNullifierPrefix = "evi"
	//EnvPIDPrefix is the key prefix for envelope heights by processID
	EnvPIDPrefix = "evp"
	//BlockByValidatorPrefix is the key prefix for block hash by validator
	BlockByValidatorPrefix = "bv_"
	//ProcessByEntityPrefix is the key prefix for process heights by entity process height
	ProcessByEntityPrefix = "pe_"
	//ValidatorHeightPrefix is the key prefix for validator IDs by height
	ValidatorHeightPrefix = "vh_"
	//ProcessIDPrefix is the key prefix for process heights by ID
	ProcessIDPrefix = "pid"
	//EntityIDPrefix is the key prefix for entity ID's as standalone keys (for iteration over keys)
	EntityIDPrefix = "eid"
	//BlockchainInfoKey is the key for the blockchain info storage
	BlockchainInfoKey = "BlockchainInfo"
	//LatestBlockHeightKey is the key for the value of the latest block height stored
	LatestBlockHeightKey = "LatestBlockHeight"
	//LatestTxHeightKey is the key for the value of the latest tx height stored
	LatestTxHeightKey = "LatestTxHeight"
	//LatestEnvelopeCountKey is the key for the value of the latest envelope count stored
	LatestEnvelopeCountKey = "LatestEnvHeight"
	//LatestEntityCountKey is the key for the value of the latest entity count stored
	LatestEntityCountKey = "LatestEntityCountKey"
	//LatestProcessCountKey is the key for the value of the latest process count stored
	LatestProcessCountKey = "LatestProcessCountKey"
	//LatestValidatorCountKey is the key for the value of the latest validator count stored
	LatestValidatorCountKey = "LatestValHeight"
	//EntityProcessCountMapKey is the key for the map of entity process counts
	EntityProcessCountMapKey = "EntityProcHeight"
	//ProcessEnvelopeCountMapKey is the key for the map of process envelope counts
	ProcessEnvelopeCountMapKey = "ProcEnvHeight"
	//ValidatorHeightMapKey is the key for the map of validator block heights
	ValidatorHeightMapKey = "ValHeightMap"
	//MaxTxsPerBlockKey is the key for the maximum number of txs on one block
	MaxTxsPerBlockKey = "MaxTxs"
	//MaxTxsBlockIDKey is the key for the block ID with the largest nubmer of txs
	MaxTxsBlockIDKey = "MaxBlock"
	//MaxTxsBlockHeightKey is the key for the block Height with the largest nubmer of txs
	MaxTxsBlockHeightKey = "MaxBlockHeight"
	// MaxTxsPerMinuteKey is the key for the maximum number of transactions in one minute of time
	MaxTxsPerMinuteKey = "MaxTxsMinute"
	// MaxTxsMinuteID is the unix code for the start of the minute with the maximum number of txs
	MaxTxsMinuteID = "MaxMinute"
	// GlobalProcessListKey is the key for the global list of processes
	GlobalProcessListKey = "ProcList"
)

Variables

View Source
var (
	// TransactionTypeMap maps transaction types to readable descriptions
	TransactionTypeMap = map[string]string{
		types.TxVote:                 "Vote",
		types.TxNewProcess:           "Create new process",
		types.TxCancelProcess:        "Cancel process",
		types.TxAddValidator:         "Add validator",
		types.TxRemoveValidator:      "Remove validator",
		types.TxAddOracle:            "Add oracle",
		types.TxRemoveOracle:         "Remove oracle",
		types.TxAddProcessKeys:       "Add process keys",
		types.TxRevealProcessKeys:    "Reveal process keys",
		"setProcess":                 "Set process metadata",
		"admin":                      "Admin",
		"unknown":                    "Unknown",
		"TX_UNKNOWN":                 "Unknown",
		"NEW_PROCESS":                "Create new process",
		"CANCEL_PROCESS":             "Cancel process",
		"SET_PROCESS_STATUS":         "Set process status",
		"SET_PROCESS_CENSUS":         "Set process census",
		"SET_PROCESS_QUESTION_INDEX": "Set process question index",
		"ADD_PROCESS_KEYS":           "Add process keys",
		"REVEAL_PROCESS_KEYS":        "Reveal process keys",
		"ADD_ORACLE":                 "Add oracle",
		"REMOVE_ORACLE":              "Remove oracle",
		"ADD_VALIDATOR":              "Add validator",
		"REMOVE_VALIDATOR":           "Remove validator",
		"VOTE":                       "Vote",
		"SET_PROCESS_RESULTS":        "Set process results",
	}

	// ProcessTypeMap maps process types to readable descriptions
	ProcessTypeMap = map[string]string{
		types.PetitionSign:  "Petition",
		types.PollVote:      "Poll",
		types.EncryptedPoll: "Encrypted poll",
		types.SnarkVote:     "Anonymous poll",
	}

	// EnvelopeTypeMap maps envelope types to readable descriptions
	EnvelopeTypeMap = map[string]string{
		types.PetitionSign:  "Petition signature",
		types.PollVote:      "Poll vote",
		types.EncryptedPoll: "Encrypted poll vote",
		types.SnarkVote:     "Anonymous poll vote",
	}
)

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	// RefreshTime is the number of seconds between page data refresh
	RefreshTime int `json:"refreshTime"`
}

Cfg is the global config to be served to pages

type MainCfg

type MainCfg struct {
	Chain         string
	DataDir       string
	DisableGzip   bool
	Global        Cfg
	HostURL       string
	LogLevel      string
	VochainConfig *dvotecfg.VochainCfg
}

MainCfg includes backend and frontend config

Jump to

Keyboard shortcuts

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