README ¶
Network limits
This package allow the configuration of network wide limits / restriction. This restriction are set as part of the genesis block and will be valid for the whole duration of the network. The only way to update them would be to start a brand new network with a new set of these settings.
Here's the list of the settings available:
propose_market_enabled
: type=boolean, are markets proposal allowedpropose_asset_enabled
: type=boolean, are assets proposal allowedpropose_market_enabled_from
: type=date, optional, from when markets proposal allowedpropose_asset_enabled_from
: type=date, optional, from when assets proposal allowed
All dates are to be specified in the RFC3339 format, any invalid date would cause the genesis state to be invalid therefore the network would stop straight away.
For each setting, the boolean value have the priority to the date, this means that if both a boolean value and date are specified but also the boolean value is false, then the given setting will never be enabled.
Example settings:
{
"app_state": {
"network_limits": {
"propose_market_enabled": true, // market proposal enabled
"popose_asset_enabled": false, // asset proposal disabled forever
"propose_market_enabled_from": "2021-12-31T23:59:59Z" // this is in UTC timezone, market proposal will be enabled at this date
// propose_asset_enabled_from is omitted
}
}
}
Documentation ¶
Index ¶
- Variables
- type Broker
- type Config
- type Engine
- func (e *Engine) CanProposeAsset() bool
- func (e *Engine) CanProposeMarket() bool
- func (e *Engine) CanTrade() bool
- func (e *Engine) GetState(k string) ([]byte, []types.StateProvider, error)
- func (e *Engine) Keys() []string
- func (e *Engine) LoadState(ctx context.Context, payload *types.Payload) ([]types.StateProvider, error)
- func (e *Engine) Namespace() types.SnapshotNamespace
- func (e *Engine) OnLimitsProposeAssetEnabledFromUpdate(ctx context.Context, date string) error
- func (e *Engine) OnLimitsProposeMarketEnabledFromUpdate(ctx context.Context, date string) error
- func (e *Engine) OnTick(ctx context.Context, t time.Time)
- func (e *Engine) Stopped() bool
- func (e *Engine) UponGenesis(ctx context.Context, rawState []byte) (err error)
- type GenesisState
- type TimeService
Constants ¶
This section is empty.
Variables ¶
var ErrNoLimitsGenesisState = errors.New("no limits genesis state")
Functions ¶
This section is empty.
Types ¶
type Config ¶
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig creates an instance of the package specific configuration.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) CanProposeAsset ¶
func (*Engine) CanProposeMarket ¶
func (*Engine) Namespace ¶
func (e *Engine) Namespace() types.SnapshotNamespace
func (*Engine) OnLimitsProposeAssetEnabledFromUpdate ¶
func (*Engine) OnLimitsProposeMarketEnabledFromUpdate ¶
type GenesisState ¶
type GenesisState struct { ProposeMarketEnabled bool `json:"propose_market_enabled"` ProposeAssetEnabled bool `json:"propose_asset_enabled"` }
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func LoadGenesisState ¶
func LoadGenesisState(bytes []byte) (*GenesisState, error)
type TimeService ¶
TimeService provide the time of the vega node using the tm time.