Documentation
¶
Index ¶
- Constants
- Variables
- type BehaviorType
- type CoinTable
- type CooperationTable
- type FractalRing
- type Status
- type Trader
- func (t *Trader) CheckForRings(fractalCounter int) *FractalRing
- func (t *Trader) CreateCoin(amount float64, coinType uint) *CoinTable
- func (t *Trader) ExpireRing(ring CooperationTable)
- func (t *Trader) InformFractalRing(fractal FractalRing) error
- func (t *Trader) PayRing(ring CooperationTable)
- func (t *Trader) RemoveFractalRing(fractalID string)
- func (t *Trader) SaveCoin(coin CoinTable) error
- func (t *Trader) SaveTrader(trader Trader) error
- func (t *Trader) SubmitRing(ring *FractalRing) error
- func (t *Trader) UpdateBalance(traderID string, amount float64) error
- func (t *Trader) UpdateCoin(coin CoinTable) error
- func (t *Trader) Vote() error
- type TraderData
Constants ¶
View Source
const ( RoundsCount = 10 RoundLength = 1000 )
View Source
const ( FractalMin = 50 FractalMax = 200 FractalPrize = 5 )
View Source
const ( VerificationMin = 21 VerificationMax = 21 BanCount = 3 )
View Source
const (
KeySize = 2048
)
Variables ¶
View Source
var (
BadBehavior = 0.1
)
Functions ¶
This section is empty.
Types ¶
type CooperationTable ¶
type FractalRing ¶
type FractalRing struct {
ID string `json:"id"`
CooperationRings []CooperationTable `json:"cooperation_rings"`
VerificationTeam []string `json:"verification_team"`
SoloRings []string `json:"-"`
IsValid bool
}
type Trader ¶
type Trader struct {
ID string `json:"id"`
Account float64 `json:"account"`
Wallet string `json:"wallet"`
PublicKey *rsa.PublicKey `json:"public_key"`
Data *TraderData `json:"-"`
}
func CreateTrader ¶
func CreateTrader(traderType BehaviorType, account float64, wallet string, coinTypeCount uint) *Trader
func (*Trader) CheckForRings ¶
func (t *Trader) CheckForRings(fractalCounter int) *FractalRing
func (*Trader) ExpireRing ¶
func (t *Trader) ExpireRing(ring CooperationTable)
func (*Trader) InformFractalRing ¶
func (t *Trader) InformFractalRing(fractal FractalRing) error
func (*Trader) PayRing ¶
func (t *Trader) PayRing(ring CooperationTable)
func (*Trader) RemoveFractalRing ¶
func (*Trader) SaveTrader ¶
func (*Trader) SubmitRing ¶
func (t *Trader) SubmitRing(ring *FractalRing) error
func (*Trader) UpdateBalance ¶
func (*Trader) UpdateCoin ¶
type TraderData ¶
type TraderData struct {
TraderType BehaviorType
CoinTypeCount uint
Ticker *time.Ticker
PrivateKey *rsa.PrivateKey
Traders map[string]Trader
Coins map[string]CoinTable
Cooperations map[string]CooperationTable
BanUntil int
}
Click to show internal directories.
Click to hide internal directories.