Documentation
¶
Index ¶
- Constants
- func CheckHashExistInlayer2(layer2Sdk *ontSdk.Layer2Sdk, contract common.Address, hash []byte) (bool, error)
- func GetCommitedLayer2Height(ontSdk *ontSdk.OntologySdk, contract common.Address) (uint32, error)
- func GetCommitedLayer2StateByHeight(ontSdk *ontSdk.OntologySdk, contract common.Address, height uint32) ([]byte, uint32, error)
- type ContractTxRecord
- type ContractTxResp
- type ContractTxResult
- type RequestLog
- type SendService
- type VerifyResult
- type VerifyService
Constants ¶
View Source
const ( SUCCESS = 0 PROCESSING = 1 FAILED = 2 NORECORDONLAYER2 = 3 )
View Source
const (
CACHE_SIZE = 1000
)
Variables ¶
This section is empty.
Functions ¶
func CheckHashExistInlayer2 ¶
func GetCommitedLayer2Height ¶
Types ¶
type ContractTxRecord ¶
type ContractTxResp ¶
type ContractTxResp struct {
Code int `json:"code"`
Msg string `json:"msg"`
Result *ContractTxResult `json:"result"`
}
type ContractTxResult ¶
type ContractTxResult struct {
Total int `json:"total"`
Records []*ContractTxRecord `json:"records"`
}
type RequestLog ¶
type RequestLog struct {
Timestamp time.Time `json:"time"`
ResponseStatus int64 `json:"status"`
ProcessDuration time.Duration `json:"process_duration"`
HTTPMethod string `json:"http_method"`
Path string `json:"path"`
RequestParam string `json:"request_param"`
ResponseParam string `json:"response_param"`
}
type SendService ¶
type SendService struct {
Wg *sync.WaitGroup
QuitS chan bool
Cfg *layer2config.Config
Enabled uint32
}
var DefSendService *SendService
func NewSendService ¶
func NewSendService(cfg *layer2config.Config) *SendService
func (*SendService) RepeantSendLogToChain ¶
func (self *SendService) RepeantSendLogToChain()
type VerifyResult ¶
type VerifyResult struct {
Code int32 `json:"code"`
FailedMsg string `json:"failedMsg"`
Key string `json:"key"`
Value string `json:"value"`
Proof string `json:"proof"`
Layer2Height uint32 `json:"layer2Height"`
CommitHeight uint32 `json:"commitHeight"`
WitnessStateRoot string `json:"witnessStateRoot"`
WitnessContract string `json:"witnessContract"`
Layer1Tx string `json:"layer1Tx"`
}
type VerifyService ¶
type VerifyService struct {
Cfg *layer2config.Config
VResultCache *cache.Cache
VerifyLock *sync.Mutex
HttpClient *http.Client
}
var DefVerifyService *VerifyService
func NewVerifyService ¶
func NewVerifyService(cfg *layer2config.Config) *VerifyService
func (*VerifyService) AsyncVerifyResult ¶
func (self *VerifyService) AsyncVerifyResult(hash string)
func (*VerifyService) StoreHashCore ¶
func (self *VerifyService) StoreHashCore(hash []byte) (string, error)
verify the store
func (*VerifyService) VerifyHashCore ¶
func (self *VerifyService) VerifyHashCore(hash string) (*VerifyResult, error)
verify the store
Click to show internal directories.
Click to hide internal directories.