Documentation ¶
Overview ¶
* @author PalletOne core developers <dev@pallet.one> * @date 2018
* @author PalletOne core developers <dev@pallet.one> * @date 2018
* @author PalletOne core developers <dev@pallet.one> * @date 2018
* @author PalletOne core developers <dev@pallet.one> * @date 2018
* @author PalletOne core developers <dev@pallet.one> * @date 2018
* @author PalletOne core developers <dev@pallet.one> * @date 2018
* @author PalletOne core developers <dev@pallet.one> * @date 2018
* @author PalletOne core developers <dev@pallet.one> * @date 2018
Index ¶
- Constants
- Variables
- func CheckContractTxResult(tx *modules.Transaction, rwM rwset.TxManager, dag dboperation.IContractDag) bool
- func ContractProcess(ctx *contracts.ContractProcessContext, req ContractReqInf) (interface{}, error)
- func DeleOneMax(signs [][]byte) [][]byte
- func GetTxSig(tx *modules.Transaction, ks *keystore.KeyStore, signer common.Address) ([]byte, error)
- func SetJuryConfig(ctx *cli.Context, cfg *Config)
- func SortSigs(pubkeys [][]byte, signs [][]byte, redeem []byte) [][]byte
- func SortTxs(txs map[common.Hash]*contractTx) []*contractTx
- type AccountConf
- type AdapterEvent
- type AdapterEventBytes
- type AdapterEventType
- type AdapterInf
- type AdapterRequestEvent
- type Config
- type ContractDeployReq
- type ContractEvent
- type ContractEventType
- type ContractInstallReq
- type ContractInvokeReq
- type ContractReqInf
- type ContractResp
- type ContractStopReq
- type ElectionEvent
- type ElectionEventBytes
- type ElectionEventType
- type ElectionRequestEvent
- type ElectionResultEvent
- type ElectionSigRequestEvent
- type ElectionSigResultEvent
- type JuryAccount
- type JuryMsgAddr
- type JuryMsgSig
- type MsgSigCollect
- type PalletOne
- type Processor
- func (p *Processor) AdapterFunRequest(reqId common.Hash, contractId common.Address, msgType uint32, ...) ([]byte, error)
- func (p *Processor) AdapterFunResult(reqId common.Hash, contractId common.Address, msgType uint32, ...) ([]byte, error)
- func (p *Processor) AddLocalTx(tx *modules.Transaction) error
- func (p *Processor) BroadcastElectionSigRequestEvent()
- func (p *Processor) BuildUnitTxs(rwM *rwset.RwSetTxMgr, mDag dboperation.IContractDag, ...) ([]*modules.Transaction, error)
- func (p *Processor) CheckContractTxValid(rwM rwset.TxManager, tx *modules.Transaction, execute bool) bool
- func (p *Processor) CheckTxValid(tx *modules.Transaction) bool
- func (p *Processor) ContractDeployReq(from, to common.Address, daoAmount, daoFee uint64, templateId []byte, ...) (common.Hash, common.Address, error)
- func (p *Processor) ContractDeployReqFee(from, to common.Address, daoAmount, daoFee uint64, templateId []byte, ...) (fee float64, size float64, tm uint32, err error)
- func (p *Processor) ContractInstallReq(from, to common.Address, daoAmount, daoFee uint64, ...) (reqId common.Hash, TplId []byte, err error)
- func (p *Processor) ContractInstallReqFee(from, to common.Address, daoAmount, daoFee uint64, ...) (fee float64, size float64, tm uint32, err error)
- func (p *Processor) ContractInvokeReq(from, to common.Address, daoAmount, daoFee uint64, certID *big.Int, ...) (common.Hash, error)
- func (p *Processor) ContractInvokeReqFee(from, to common.Address, daoAmount, daoFee uint64, certID *big.Int, ...) (fee float64, size float64, tm uint32, err error)
- func (p *Processor) ContractInvokeReqToken(from, to common.Address, token *modules.Asset, daoAmount, daoFee uint64, ...) (common.Hash, error)
- func (p *Processor) ContractQuery(id []byte, args [][]byte, timeout time.Duration) (rsp []byte, err error)
- func (p *Processor) ContractStopReq(from, to common.Address, daoAmount, daoFee uint64, contractId common.Address, ...) (common.Hash, error)
- func (p *Processor) ContractStopReqFee(from, to common.Address, daoAmount, daoFee uint64, contractId common.Address, ...) (fee float64, size float64, tm uint32, err error)
- func (p *Processor) ContractTxDeleteLoop()
- func (p *Processor) ElectionVrfReq(id uint32) ([]byte, error)
- func (p *Processor) GenContractSigTransaction(signer common.Address, password string, orgTx *modules.Transaction, ...) (*modules.Transaction, error)
- func (p *Processor) GenContractTransaction(orgTx *modules.Transaction, msgs []*modules.Message) (*modules.Transaction, error)
- func (p *Processor) GetLocalJuryAddrs() []common.Address
- func (p *Processor) ProcessAdapterEvent(event *AdapterEvent) (result *AdapterEvent, err error)
- func (p *Processor) ProcessContractEvent(event *ContractEvent) (bool, error)
- func (p *Processor) ProcessElectionEvent(event *ElectionEvent) (err error)
- func (p *Processor) ProcessUserContractInvokeReqTx(tx *modules.Transaction)
- func (p *Processor) RunAndSignTx(reqTx *modules.Transaction, txMgr rwset.TxManager, ...) (*modules.Transaction, error)
- func (p *Processor) SetContract(contract *contracts.Contract)
- func (p *Processor) SetDocker(pDocker *utils.PalletOneDocker)
- func (p *Processor) SignAndExecuteAndSendRequest(from common.Address, tx *modules.Transaction) (*modules.Transaction, error)
- func (p *Processor) Start(server *p2p.Server) error
- func (p *Processor) Stop() error
- func (p *Processor) SubscribeContractEvent(ch chan<- ContractEvent) event.Subscription
- func (p *Processor) UpdateJuryAccount(addr common.Address, pwd string) bool
- type UtxoQuery
Constants ¶
View Source
const ( ContractFeeTypeTimeOut = 1 //deploy during time, other is timeout ContractFeeTypeTxSize = 2 )
View Source
const ( MaxLengthTplName = 64 //合约模板名字长度 MaxLengthTplPath = 512 //合约模板文件路径长度 MaxLengthTplVersion = 12 //合约模板版本号长度 MaxNumberTplEleAddrHash = 5 //合约模板指定节点地址hash数量 MaxLengthTplId = 128 //合约模板Id长度 MaxNumberArgs = 32 //合约请求参数数量 MaxLengthArgs = 1024 //合约请求输入参数长度 MaxLengthExtData = 16 //合约请求扩展数据长度 MaxLengthAbi = 1024 * 500 //合约Abi数据长度 MaxLengthLanguage = 32 //合约模板语言类型长度 MaxLengthDescription = 1024 //合约描述数据长度 MaxNumberMergeUtxos = 500 //合约合并utxo限制数量 )
View Source
const ( ContractDefaultSignatureSize = 256.0 ContractDefaultElectionSize = 768.0 ContractDefaultRWSize = 512.0 ContractDefaultPayInputSignatureSize = 256.0 )
Variables ¶
View Source
var (
AccountInfoFlag = cli.BoolFlag{
Name: "accountInfo",
Usage: "The About information account address,password,public and private key and on ",
}
)
View Source
var DefaultConfig = Config{ Accounts: []*AccountConf{ &AccountConf{}, }, }
Functions ¶
func CheckContractTxResult ¶ added in v1.0.6
func CheckContractTxResult(tx *modules.Transaction, rwM rwset.TxManager, dag dboperation.IContractDag) bool
验证一个系统合约的执行结果是否正确
func ContractProcess ¶
func ContractProcess(ctx *contracts.ContractProcessContext, req ContractReqInf) (interface{}, error)
func DeleOneMax ¶
func SetJuryConfig ¶
func SetJuryConfig(ctx *cli.Context, cfg *Config)
Types ¶
type AccountConf ¶
type AccountConf struct { Address, Password string }
type AdapterEvent ¶
type AdapterEvent struct { AType AdapterEventType `json:"atype"` Event interface{} `json:"event"` }
Adapter
func (*AdapterEvent) ToAdapterEventBytes ¶
func (av *AdapterEvent) ToAdapterEventBytes() (*AdapterEventBytes, error)
type AdapterEventBytes ¶
type AdapterEventBytes struct { AType AdapterEventType `json:"atype"` Event []byte `json:"event"` }
func (*AdapterEventBytes) Hash ¶ added in v1.0.5
func (es *AdapterEventBytes) Hash() common.Hash
func (*AdapterEventBytes) ToAdapterEvent ¶
func (es *AdapterEventBytes) ToAdapterEvent() (*AdapterEvent, error)
type AdapterEventType ¶
type AdapterEventType uint32
type AdapterInf ¶
type AdapterInf struct {
JuryMsgAll map[string]*MsgSigCollect
}
type AdapterRequestEvent ¶
type Config ¶
type Config struct { //ContractSigNum int //user contract jury sig number //todo no used //ElectionNum int //vrf election jury number //todo no used Accounts []*AccountConf // the set of the mediator info }
func MakeConfig ¶
func MakeConfig() Config
type ContractDeployReq ¶
type ContractDeployReq struct {
// contains filtered or unexported fields
}
type ContractEvent ¶
type ContractEvent struct { CType ContractEventType Ele *modules.ElectionNode `rlp:"nil"` Tx *modules.Transaction }
contract
func (*ContractEvent) Hash ¶
func (ce *ContractEvent) Hash() common.Hash
type ContractEventType ¶
type ContractEventType uint8
const ( CONTRACT_EVENT_EXEC ContractEventType = 1 //合约执行,系统合约由Mediator完成,用户合约由Jury完成 CONTRACT_EVENT_SIG ContractEventType = 2 //多Jury执行合约并签名转发确认,由Jury接收并处理 CONTRACT_EVENT_COMMIT ContractEventType = 4 //提交给Mediator进行验证确认并写到交易池 CONTRACT_EVENT_ELE ContractEventType = 8 //节点选举 )
type ContractInstallReq ¶
type ContractInstallReq struct {
// contains filtered or unexported fields
}
type ContractInvokeReq ¶
type ContractInvokeReq struct {
// contains filtered or unexported fields
}
type ContractReqInf ¶
type ContractReqInf interface {
// contains filtered or unexported methods
}
type ContractResp ¶
type ContractResp struct { Err error Resp interface{} }
type ContractStopReq ¶
type ContractStopReq struct {
// contains filtered or unexported fields
}
type ElectionEvent ¶
type ElectionEvent struct { EType ElectionEventType `json:"etype"` Event interface{} `json:"event"` }
func (*ElectionEvent) ReqId ¶ added in v1.0.7
func (ev *ElectionEvent) ReqId() common.Hash
func (*ElectionEvent) ToElectionEventBytes ¶
func (ev *ElectionEvent) ToElectionEventBytes() (*ElectionEventBytes, error)
type ElectionEventBytes ¶
type ElectionEventBytes struct { EType ElectionEventType `json:"etype"` Event []byte `json:"event"` }
func (*ElectionEventBytes) Hash ¶
func (es *ElectionEventBytes) Hash() common.Hash
func (*ElectionEventBytes) ToElectionEvent ¶
func (es *ElectionEventBytes) ToElectionEvent() (*ElectionEvent, error)
type ElectionEventType ¶
type ElectionEventType uint8
const ( ELECTION_EVENT_VRF_REQUEST ElectionEventType = 1 ELECTION_EVENT_VRF_RESULT ElectionEventType = 2 ELECTION_EVENT_SIG_REQUEST ElectionEventType = 3 ELECTION_EVENT_SIG_RESULT ElectionEventType = 4 )
type ElectionRequestEvent ¶
Election
type ElectionResultEvent ¶
type ElectionResultEvent struct { ReqId common.Hash JuryCount uint64 Ele modules.ElectionInf }
type ElectionSigRequestEvent ¶
type ElectionSigRequestEvent struct { ReqId common.Hash JuryCount uint64 Ele []modules.ElectionInf }
sig
type ElectionSigResultEvent ¶
type ElectionSigResultEvent struct { ReqId common.Hash JuryCount uint64 Sig modules.SignatureSet }
type JuryAccount ¶
type JuryMsgAddr ¶
type JuryMsgSig ¶
type MsgSigCollect ¶
type MsgSigCollect struct {
OneMsgAllSig map[string]JuryMsgSig
}
type PalletOne ¶
type PalletOne interface { GetKeyStore() *keystore.KeyStore TxPool() txspool.ITxPool MockContractLocalSend(event ContractEvent) ContractBroadcast(event ContractEvent, local bool) ElectionBroadcast(event ElectionEvent, local bool) AdapterBroadcast(event AdapterEvent) LocalHaveActiveMediator() bool GetLocalActiveMediators() []common.Address SignGenericTransaction(from common.Address, tx *modules.Transaction) (*modules.Transaction, error) }
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewContractProcessor ¶
func (*Processor) AdapterFunRequest ¶
func (*Processor) AdapterFunResult ¶
func (*Processor) AddLocalTx ¶ added in v1.0.7
func (p *Processor) AddLocalTx(tx *modules.Transaction) error
func (*Processor) BroadcastElectionSigRequestEvent ¶
func (p *Processor) BroadcastElectionSigRequestEvent()
func (*Processor) BuildUnitTxs ¶ added in v1.0.7
func (p *Processor) BuildUnitTxs(rwM *rwset.RwSetTxMgr, mDag dboperation.IContractDag, sortedTxs []*modules.Transaction, addr common.Address) ([]*modules.Transaction, error)
func (*Processor) CheckContractTxValid ¶
func (*Processor) CheckTxValid ¶ added in v1.0.1
func (p *Processor) CheckTxValid(tx *modules.Transaction) bool
func (*Processor) ContractDeployReq ¶
func (*Processor) ContractDeployReqFee ¶ added in v1.0.3
func (*Processor) ContractInstallReq ¶
func (*Processor) ContractInstallReqFee ¶ added in v1.0.3
func (*Processor) ContractInvokeReq ¶
func (*Processor) ContractInvokeReqFee ¶ added in v1.0.3
func (*Processor) ContractInvokeReqToken ¶
func (*Processor) ContractQuery ¶ added in v1.0.4
func (p *Processor) ContractQuery(id []byte, args [][]byte, timeout time.Duration) (rsp []byte, err error)
deploy -->invoke
func (*Processor) ContractStopReq ¶
func (*Processor) ContractStopReqFee ¶ added in v1.0.3
func (*Processor) ContractTxDeleteLoop ¶
func (p *Processor) ContractTxDeleteLoop()
func (*Processor) GenContractSigTransaction ¶
func (p *Processor) GenContractSigTransaction(signer common.Address, password string, orgTx *modules.Transaction, ks *keystore.KeyStore, utxoFunc modules.QueryUtxoFunc) (*modules.Transaction, error)
func (*Processor) GenContractTransaction ¶ added in v1.0.5
func (p *Processor) GenContractTransaction(orgTx *modules.Transaction, msgs []*modules.Message) (*modules.Transaction, error)
func (*Processor) GetLocalJuryAddrs ¶ added in v1.0.1
func (*Processor) ProcessAdapterEvent ¶
func (p *Processor) ProcessAdapterEvent(event *AdapterEvent) (result *AdapterEvent, err error)
func (*Processor) ProcessContractEvent ¶
func (p *Processor) ProcessContractEvent(event *ContractEvent) (bool, error)
func (*Processor) ProcessElectionEvent ¶
func (p *Processor) ProcessElectionEvent(event *ElectionEvent) (err error)
func (*Processor) ProcessUserContractInvokeReqTx ¶ added in v1.0.7
func (p *Processor) ProcessUserContractInvokeReqTx(tx *modules.Transaction)
func (*Processor) RunAndSignTx ¶ added in v1.0.6
func (p *Processor) RunAndSignTx(reqTx *modules.Transaction, txMgr rwset.TxManager, dag dboperation.IContractDag, addr common.Address) (*modules.Transaction, error)
func (*Processor) SetContract ¶
func (*Processor) SetDocker ¶ added in v1.0.5
func (p *Processor) SetDocker(pDocker *utils.PalletOneDocker)
func (*Processor) SignAndExecuteAndSendRequest ¶
func (p *Processor) SignAndExecuteAndSendRequest(from common.Address, tx *modules.Transaction) (*modules.Transaction, error)
func (*Processor) SubscribeContractEvent ¶
func (p *Processor) SubscribeContractEvent(ch chan<- ContractEvent) event.Subscription
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
* @author PalletOne core developers <dev@pallet.one> * @date 2018
|
* @author PalletOne core developers <dev@pallet.one> * @date 2018 |
algorithm
* @author PalletOne core developers <dev@pallet.one> * @date 2018
|
* @author PalletOne core developers <dev@pallet.one> * @date 2018 |
inf
* @author PalletOne core developers <dev@pallet.one> * @date 2018
|
* @author PalletOne core developers <dev@pallet.one> * @date 2018 |
vrfEc
* @author PalletOne core developers <dev@pallet.one> * @date 2018 * @author PalletOne core developers <dev@pallet.one> * @date 2018
|
* @author PalletOne core developers <dev@pallet.one> * @date 2018 * @author PalletOne core developers <dev@pallet.one> * @date 2018 |
vrfEs
* @author PalletOne core developers <dev@pallet.one> * @date 2018 * @author PalletOne core developers <dev@pallet.one> * @date 2018
|
* @author PalletOne core developers <dev@pallet.one> * @date 2018 * @author PalletOne core developers <dev@pallet.one> * @date 2018 |
vrfEss
* @author PalletOne core developers <dev@pallet.one> * @date 2018 * @author PalletOne core developers <dev@pallet.one> * @date 2018
|
* @author PalletOne core developers <dev@pallet.one> * @date 2018 * @author PalletOne core developers <dev@pallet.one> * @date 2018 |
Click to show internal directories.
Click to hide internal directories.