v2

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: GPL-3.0, GPL-3.0 Imports: 21 Imported by: 0

README

保证金质押合约逻辑和操作方法

Mediator

申请成为Mediator
缴纳足额保证金,成为候选Mediator
退还保证金

普通持有PTN的用户

质押投票选举Mediator
变更选举的Mediator

用户可以随时修改Mediator的投票。

提取质押Token

##质押分红逻辑 质押分红以天为周期,每天根据前一天的质押数量情况,按比例分红。当天新增加的质押第二天才能参与分红。用户申请提取质押Token在分红结束后处理。

Documentation

Overview

Package v2 implements some functions for v2 contract.

Package v2 implements some functions for v2 contract.

记录了所有用户的质押充币、提币、分红等过程 最新状态集 Advance:形成流水日志,

Index

Constants

View Source
const ALL = "all"

Variables

This section is empty.

Functions

func DelJuryBalance

func DelJuryBalance(stub shim.ChaincodeStubInterface, addr string) error

删除Jury账户

func GetJuryBalance

func GetJuryBalance(stub shim.ChaincodeStubInterface, addr string) (*modules.JurorDeposit, error)

获取Jury账户

func UpperFirstChar

func UpperFirstChar(str string) string

将字符串的首字母大写

Types

type DepositChaincode

type DepositChaincode struct {
}

func (*DepositChaincode) ApplyBecomeMediator

func (d *DepositChaincode) ApplyBecomeMediator(stub shim.ChaincodeStubInterface, mediatorCreateArgs string) error

超级节点申请加入

func (DepositChaincode) ApplyForForfeitureDeposit

func (d DepositChaincode) ApplyForForfeitureDeposit(stub shim.ChaincodeStubInterface, forfeitureAddress string, role string, reason string) pb.Response

申请没收节点保证金

func (DepositChaincode) DeteleKey

func (*DepositChaincode) DevApplyQuit

func (d *DepositChaincode) DevApplyQuit(stub shim.ChaincodeStubInterface) pb.Response

开发者申请退出列表

func (*DepositChaincode) DeveloperPayToDepositContract

func (d *DepositChaincode) DeveloperPayToDepositContract(stub shim.ChaincodeStubInterface) pb.Response

开发者交付保证金

func (*DepositChaincode) GetAgreeForBecomeMediatorList

func (d *DepositChaincode) GetAgreeForBecomeMediatorList(stub shim.ChaincodeStubInterface) (map[string]bool, error)

func (DepositChaincode) GetAllJury

func (DepositChaincode) GetAllMediator

func (d DepositChaincode) GetAllMediator(stub shim.ChaincodeStubInterface) pb.Response

func (DepositChaincode) GetAllNode

func (*DepositChaincode) GetBecomeMediatorApplyList

func (d *DepositChaincode) GetBecomeMediatorApplyList(stub shim.ChaincodeStubInterface) (map[string]bool, error)

func (*DepositChaincode) GetJuryDeposit

func (d *DepositChaincode) GetJuryDeposit(stub shim.ChaincodeStubInterface, address string) (*modules.JuryDepositJson, error)

func (*DepositChaincode) GetListForDeveloper

func (d *DepositChaincode) GetListForDeveloper(stub shim.ChaincodeStubInterface) (map[string]bool, error)

func (*DepositChaincode) GetListForForfeitureApplication

func (d *DepositChaincode) GetListForForfeitureApplication(stub shim.ChaincodeStubInterface) pb.Response

func (*DepositChaincode) GetListForJuryCandidate

func (d *DepositChaincode) GetListForJuryCandidate(stub shim.ChaincodeStubInterface) (map[string]bool, error)

func (*DepositChaincode) GetListForMediatorCandidate

func (d *DepositChaincode) GetListForMediatorCandidate(stub shim.ChaincodeStubInterface) (map[string]bool, error)

func (*DepositChaincode) GetMediatorDeposit

func (d *DepositChaincode) GetMediatorDeposit(stub shim.ChaincodeStubInterface, address string) (*modules.MediatorDepositJson, error)

func (*DepositChaincode) GetNodeBalance

func (d *DepositChaincode) GetNodeBalance(stub shim.ChaincodeStubInterface, address string) (*modules.DepositBalanceJson, error)

func (*DepositChaincode) GetQuitApplyList

func (d *DepositChaincode) GetQuitApplyList(stub shim.ChaincodeStubInterface) pb.Response

func (*DepositChaincode) HandleForAddMediator added in v1.0.8

func (d *DepositChaincode) HandleForAddMediator(stub shim.ChaincodeStubInterface, mediatorCreateArgs string) error

基金会手动添加生产节点

func (*DepositChaincode) HandleForApplyBecomeMediator

func (d *DepositChaincode) HandleForApplyBecomeMediator(stub shim.ChaincodeStubInterface, address string, okOrNo string) pb.Response

基金会对申请加入Mediator进行处理

func (*DepositChaincode) HandleForApplyQuitDev

func (d *DepositChaincode) HandleForApplyQuitDev(stub shim.ChaincodeStubInterface, address string, okOrNo string) pb.Response

处理开发者申请退出列表

func (*DepositChaincode) HandleForApplyQuitJury

func (d *DepositChaincode) HandleForApplyQuitJury(stub shim.ChaincodeStubInterface, address string, okOrNo string) pb.Response

处理陪审员申请退出候选列表

func (*DepositChaincode) HandleForApplyQuitMediator

func (d *DepositChaincode) HandleForApplyQuitMediator(stub shim.ChaincodeStubInterface, address string, okOrNo string) pb.Response

基金会对申请退出Mediator进行处理

func (*DepositChaincode) HandleForForfeitureApplication

func (d *DepositChaincode) HandleForForfeitureApplication(stub shim.ChaincodeStubInterface, address string, okOrNo string) pb.Response

处理没收节点

func (DepositChaincode) HandleForRemoveMediator added in v1.0.8

func (d DepositChaincode) HandleForRemoveMediator(stub shim.ChaincodeStubInterface, address string) error

基金会手动移除超级节点候选列表

func (DepositChaincode) HandleNodeRemoveFromAgreeList

func (d DepositChaincode) HandleNodeRemoveFromAgreeList(stub shim.ChaincodeStubInterface, address string) pb.Response

移除超级节点同意列表

func (DepositChaincode) HandlePledgeReward

func (d DepositChaincode) HandlePledgeReward(stub shim.ChaincodeStubInterface) pb.Response

func (*DepositChaincode) Init

func (*DepositChaincode) Invoke

func (DepositChaincode) IsFinishAddNewRecords

func (d DepositChaincode) IsFinishAddNewRecords(stub shim.ChaincodeStubInterface) bool

func (DepositChaincode) IsFinishAllocated

func (d DepositChaincode) IsFinishAllocated(stub shim.ChaincodeStubInterface) bool

func (*DepositChaincode) IsInAgreeList

func (d *DepositChaincode) IsInAgreeList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInBecomeList

func (d *DepositChaincode) IsInBecomeList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInDeveloperList

func (d *DepositChaincode) IsInDeveloperList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInForfeitureList

func (d *DepositChaincode) IsInForfeitureList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInJuryCandidateList

func (d *DepositChaincode) IsInJuryCandidateList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInMediatorCandidateList

func (d *DepositChaincode) IsInMediatorCandidateList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) IsInQuitList

func (d *DepositChaincode) IsInQuitList(stub shim.ChaincodeStubInterface, address string) bool

func (*DepositChaincode) JuryApplyQuit

func (d *DepositChaincode) JuryApplyQuit(stub shim.ChaincodeStubInterface) pb.Response

陪审员申请退出候选列表

func (*DepositChaincode) JuryPayToDepositContract

func (d *DepositChaincode) JuryPayToDepositContract(stub shim.ChaincodeStubInterface, args string) pb.Response

陪审员交付保证金

func (*DepositChaincode) MediatorApplyQuit

func (d *DepositChaincode) MediatorApplyQuit(stub shim.ChaincodeStubInterface) pb.Response

超级节点申请退出候选列表

func (*DepositChaincode) MediatorPayToDepositContract

func (d *DepositChaincode) MediatorPayToDepositContract(stub shim.ChaincodeStubInterface) error

超级节点交付保证金

func (DepositChaincode) ProcessPledgeDeposit

func (d DepositChaincode) ProcessPledgeDeposit(stub shim.ChaincodeStubInterface) pb.Response

func (DepositChaincode) ProcessPledgeWithdraw

func (d DepositChaincode) ProcessPledgeWithdraw(stub shim.ChaincodeStubInterface, amount string) pb.Response

func (DepositChaincode) QueryAllPledgeHistory

func (d DepositChaincode) QueryAllPledgeHistory(stub shim.ChaincodeStubInterface) ([]*modules.PledgeList, error)

func (DepositChaincode) QueryPledgeList

func (DepositChaincode) QueryPledgeListByDate

func (d DepositChaincode) QueryPledgeListByDate(stub shim.ChaincodeStubInterface, date string) (*modules.PledgeList, error)

func (DepositChaincode) QueryPledgeStatusByAddr

func (d DepositChaincode) QueryPledgeStatusByAddr(stub shim.ChaincodeStubInterface, address string) (*modules.PledgeStatusJson, error)

func (DepositChaincode) QueryPledgeWithdraw

func (d DepositChaincode) QueryPledgeWithdraw(stub shim.ChaincodeStubInterface) ([]*modules.AddressAmount, error)

func (DepositChaincode) UpdateKeyValue

func (d DepositChaincode) UpdateKeyValue(stub shim.ChaincodeStubInterface, key, value string) pb.Response

更新某个key

func (*DepositChaincode) UpdateMediatorInfo

func (d *DepositChaincode) UpdateMediatorInfo(stub shim.ChaincodeStubInterface, mediatorUpdateArgs string) pb.Response

超级节点更新信息

type JurorUpdateArgs

type JurorUpdateArgs struct {
	RewardAddr *string `json:"reward_address"` // 奖励地址,用于奖励
}

更新 juror 信息所需参数

Jump to

Keyboard shortcuts

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