Documentation ¶
Index ¶
- Constants
- Variables
- func ABCIDataQuery(path string, data []byte) *ctypes.ResultABCIQuery
- func BroadcastTxCommit(op *models.TxCommitBody) (*ctypes.ResultBroadcastTxCommit, error)
- func BroadcastTxSync(op *models.TxCommitBody) (*ctypes.ResultBroadcastTx, error)
- func CheckRedisStatus()
- func GetBlockFromHeight(h int64) (*ctypes.ResultBlock, error)
- func GetChainInfo(min int, max int) (*ctypes.ResultBlockchainInfo, error)
- func GetChainState() (*ctypes.ResultStatus, error)
- func GetGenesis() (*ctypes.ResultGenesis, error)
- func GetNetInfo() (*ctypes.ResultNetInfo, error)
- func GetTx(hash []byte) (*ctypes.ResultTx, error)
- func GetUnconfirmedTxs() (*ctypes.ResultUnconfirmedTxs, error)
- func InitAllJobs()
- func InitClient()
- func InitLogStoreApplication()
- func InitService()
- func StartAllJobs()
- func StopAllJobs()
- func SubScribeEvent(event string) (out <-chan ctypes.ResultEvent, err error)
- func UnSubScribeEvent(event string) error
- func UpdateValidator(update *models.ValidatorUpdateBody) (*ctypes.ResultBroadcastTxCommit, error)
- type AppState
- func (s AppState) ClearCurrentTxIndex()
- func (s AppState) CommitHeight()
- func (s AppState) GetCurrentHeight() int64
- func (s AppState) GetCurrentTxIndex() int64
- func (s AppState) GetLogSequence() int64
- func (s AppState) Lock()
- func (s AppState) UnLock()
- func (s AppState) UpdateCurrentHeight()
- func (s AppState) UpdateCurrentTxIndex()
- func (s AppState) UpdateLogSequence()
- type ApplicationService
- func (s ApplicationService) ConvertBlock(b *ctypes.ResultBlock) *models.Block
- func (s ApplicationService) ConvertBlockData(b *types.Data) *models.Data
- func (s ApplicationService) ConvertBlockFromTypesBlock(b *types.Block) *models.Block
- func (s ApplicationService) ConvertBlockHeader(b *types.Header) *models.Header
- func (s ApplicationService) ConvertBlockID(b *types.BlockID) *models.BlockID
- func (s ApplicationService) ConvertCommitSign(b *types.CommitSig) *models.CommitSig
- func (s ApplicationService) ConvertTransactionsToCommandLog(txs types.Txs, h int64, time string) []models.OperationLog
- func (s ApplicationService) ConvertTransactionsToLogString(txs types.Txs, h int64, time string) []string
- func (s ApplicationService) Execute(request *models.CommandRequest) (*models.ExecuteResponse, error)
- func (s ApplicationService) ExecuteAsync(request *models.CommandRequest) (*models.ExecuteAsyncResponse, error)
- func (s ApplicationService) ExecuteWithPrivateKey(request *models.CommandRequest) (*models.ExecuteResponse, error)
- func (s ApplicationService) GetBlock(height int) (*models.Block, error)
- func (s ApplicationService) GetChainInfo(min int, max int) (*models.ChainInfo, error)
- func (s ApplicationService) GetChainState() (*models.ChainState, error)
- func (s ApplicationService) GetCommittedTxList(beginHeight int, endHeight int) (*models.TransactionCommittedList, error)
- func (s ApplicationService) GetGenesis() (*models.Genesis, error)
- func (s ApplicationService) GetKeyLog(key string) (*models.OperationKeyLog, error)
- func (s ApplicationService) GetNetInfo() (*models.NetInfo, error)
- func (s ApplicationService) GetTransaction(hash string) (*models.Transaction, error)
- func (s ApplicationService) GetUnconfirmedTxs() (*models.UnConfirmedTxs, error)
- func (s ApplicationService) MakeTxCommitBody(request *models.CommandRequest) *models.TxCommitBody
- func (s ApplicationService) Query(request *models.CommandRequest) (*models.QueryResponse, error)
- func (s ApplicationService) QueryPrivateData(request *models.CommandRequest) (*models.QueryResponse, error)
- func (s ApplicationService) QueryPrivateDataWithAddress(request *models.QueryPrivateWithAddrRequest) (*models.QueryResponse, error)
- func (s ApplicationService) QueryVotingValidators() *Vote
- func (s ApplicationService) RestoreLocalDatabase() error
- func (s ApplicationService) StartCommandLogWriter()
- func (s ApplicationService) UpdateValidators(update *models.ValidatorUpdateData) *VoteCount
- type LogStoreApplication
- func (app *LogStoreApplication) BeginBlock(req abcitypes.RequestBeginBlock) abcitypes.ResponseBeginBlock
- func (app *LogStoreApplication) CheckTx(req abcitypes.RequestCheckTx) abcitypes.ResponseCheckTx
- func (app *LogStoreApplication) Commit() abcitypes.ResponseCommit
- func (app *LogStoreApplication) DeliverTx(req abcitypes.RequestDeliverTx) abcitypes.ResponseDeliverTx
- func (app *LogStoreApplication) EndBlock(req abcitypes.RequestEndBlock) abcitypes.ResponseEndBlock
- func (app *LogStoreApplication) ExecuteCommand(command string, retry int, t time.Duration, updateState bool) string
- func (LogStoreApplication) Info(req abcitypes.RequestInfo) abcitypes.ResponseInfo
- func (app *LogStoreApplication) InitChain(req abcitypes.RequestInitChain) abcitypes.ResponseInitChain
- func (app *LogStoreApplication) IsPrivateCommand(commitBody models.TxCommitBody) bool
- func (LogStoreApplication) IsValidatorUpdateTx(tx []byte) bool
- func (app *LogStoreApplication) Query(reqQuery abcitypes.RequestQuery) (resQuery abcitypes.ResponseQuery)
- func (app *LogStoreApplication) QueryVotingValidators() *Vote
- func (LogStoreApplication) SetOption(req abcitypes.RequestSetOption) abcitypes.ResponseSetOption
- type Service
- type Vote
- type VoteCount
Constants ¶
View Source
const PrivateSep string = "_"
View Source
const ReTry int = 3
View Source
const ReTryTime time.Duration = 10 * time.Millisecond
View Source
const SocketAddr string = "unix://tendermint.sock"
View Source
const VoteKeySep string = ":"
Variables ¶
View Source
var Schedulers *gocron.Scheduler
Functions ¶
func ABCIDataQuery ¶
func ABCIDataQuery(path string, data []byte) *ctypes.ResultABCIQuery
func BroadcastTxCommit ¶
func BroadcastTxCommit(op *models.TxCommitBody) (*ctypes.ResultBroadcastTxCommit, error)
func BroadcastTxSync ¶
func BroadcastTxSync(op *models.TxCommitBody) (*ctypes.ResultBroadcastTx, error)
func CheckRedisStatus ¶
func CheckRedisStatus()
func GetBlockFromHeight ¶
func GetBlockFromHeight(h int64) (*ctypes.ResultBlock, error)
func GetChainInfo ¶
func GetChainInfo(min int, max int) (*ctypes.ResultBlockchainInfo, error)
func GetChainState ¶
func GetChainState() (*ctypes.ResultStatus, error)
func GetGenesis ¶
func GetGenesis() (*ctypes.ResultGenesis, error)
func GetNetInfo ¶
func GetNetInfo() (*ctypes.ResultNetInfo, error)
func GetUnconfirmedTxs ¶
func GetUnconfirmedTxs() (*ctypes.ResultUnconfirmedTxs, error)
func InitAllJobs ¶
func InitAllJobs()
func InitClient ¶
func InitClient()
func InitLogStoreApplication ¶
func InitLogStoreApplication()
func InitService ¶
func InitService()
func StartAllJobs ¶
func StartAllJobs()
func StopAllJobs ¶
func StopAllJobs()
func SubScribeEvent ¶
func SubScribeEvent(event string) (out <-chan ctypes.ResultEvent, err error)
func UnSubScribeEvent ¶
func UpdateValidator ¶
func UpdateValidator(update *models.ValidatorUpdateBody) (*ctypes.ResultBroadcastTxCommit, error)
Types ¶
type AppState ¶
type AppState struct {
// contains filtered or unexported fields
}
func (AppState) ClearCurrentTxIndex ¶
func (s AppState) ClearCurrentTxIndex()
func (AppState) CommitHeight ¶
func (s AppState) CommitHeight()
func (AppState) GetCurrentHeight ¶
func (AppState) GetCurrentTxIndex ¶
func (AppState) GetLogSequence ¶
func (AppState) UpdateCurrentHeight ¶
func (s AppState) UpdateCurrentHeight()
func (AppState) UpdateCurrentTxIndex ¶
func (s AppState) UpdateCurrentTxIndex()
func (AppState) UpdateLogSequence ¶
func (s AppState) UpdateLogSequence()
type ApplicationService ¶
type ApplicationService struct { }
func (ApplicationService) ConvertBlock ¶
func (s ApplicationService) ConvertBlock(b *ctypes.ResultBlock) *models.Block
func (ApplicationService) ConvertBlockData ¶
func (s ApplicationService) ConvertBlockData(b *types.Data) *models.Data
func (ApplicationService) ConvertBlockFromTypesBlock ¶
func (s ApplicationService) ConvertBlockFromTypesBlock(b *types.Block) *models.Block
func (ApplicationService) ConvertBlockHeader ¶
func (s ApplicationService) ConvertBlockHeader(b *types.Header) *models.Header
func (ApplicationService) ConvertBlockID ¶
func (s ApplicationService) ConvertBlockID(b *types.BlockID) *models.BlockID
func (ApplicationService) ConvertCommitSign ¶
func (s ApplicationService) ConvertCommitSign(b *types.CommitSig) *models.CommitSig
func (ApplicationService) ConvertTransactionsToCommandLog ¶
func (s ApplicationService) ConvertTransactionsToCommandLog(txs types.Txs, h int64, time string) []models.OperationLog
func (ApplicationService) ConvertTransactionsToLogString ¶
func (ApplicationService) Execute ¶
func (s ApplicationService) Execute(request *models.CommandRequest) (*models.ExecuteResponse, error)
func (ApplicationService) ExecuteAsync ¶
func (s ApplicationService) ExecuteAsync(request *models.CommandRequest) (*models.ExecuteAsyncResponse, error)
func (ApplicationService) ExecuteWithPrivateKey ¶
func (s ApplicationService) ExecuteWithPrivateKey(request *models.CommandRequest) (*models.ExecuteResponse, error)
func (ApplicationService) GetBlock ¶
func (s ApplicationService) GetBlock(height int) (*models.Block, error)
func (ApplicationService) GetChainInfo ¶
func (ApplicationService) GetChainState ¶
func (s ApplicationService) GetChainState() (*models.ChainState, error)
func (ApplicationService) GetCommittedTxList ¶
func (s ApplicationService) GetCommittedTxList(beginHeight int, endHeight int) (*models.TransactionCommittedList, error)
func (ApplicationService) GetGenesis ¶
func (s ApplicationService) GetGenesis() (*models.Genesis, error)
func (ApplicationService) GetKeyLog ¶
func (s ApplicationService) GetKeyLog(key string) (*models.OperationKeyLog, error)
func (ApplicationService) GetNetInfo ¶
func (s ApplicationService) GetNetInfo() (*models.NetInfo, error)
func (ApplicationService) GetTransaction ¶
func (s ApplicationService) GetTransaction(hash string) (*models.Transaction, error)
func (ApplicationService) GetUnconfirmedTxs ¶
func (s ApplicationService) GetUnconfirmedTxs() (*models.UnConfirmedTxs, error)
func (ApplicationService) MakeTxCommitBody ¶
func (s ApplicationService) MakeTxCommitBody(request *models.CommandRequest) *models.TxCommitBody
func (ApplicationService) Query ¶
func (s ApplicationService) Query(request *models.CommandRequest) (*models.QueryResponse, error)
func (ApplicationService) QueryPrivateData ¶
func (s ApplicationService) QueryPrivateData(request *models.CommandRequest) (*models.QueryResponse, error)
func (ApplicationService) QueryPrivateDataWithAddress ¶
func (s ApplicationService) QueryPrivateDataWithAddress(request *models.QueryPrivateWithAddrRequest) (*models.QueryResponse, error)
func (ApplicationService) QueryVotingValidators ¶
func (s ApplicationService) QueryVotingValidators() *Vote
func (ApplicationService) RestoreLocalDatabase ¶
func (s ApplicationService) RestoreLocalDatabase() error
func (ApplicationService) StartCommandLogWriter ¶
func (s ApplicationService) StartCommandLogWriter()
func (ApplicationService) UpdateValidators ¶
func (s ApplicationService) UpdateValidators(update *models.ValidatorUpdateData) *VoteCount
type LogStoreApplication ¶
type LogStoreApplication struct { State *AppState // contains filtered or unexported fields }
var LogStoreApp *LogStoreApplication
func (*LogStoreApplication) BeginBlock ¶
func (app *LogStoreApplication) BeginBlock(req abcitypes.RequestBeginBlock) abcitypes.ResponseBeginBlock
#################### BeginBlock ####################
func (*LogStoreApplication) CheckTx ¶
func (app *LogStoreApplication) CheckTx(req abcitypes.RequestCheckTx) abcitypes.ResponseCheckTx
#################### CheckTx ####################
func (*LogStoreApplication) Commit ¶
func (app *LogStoreApplication) Commit() abcitypes.ResponseCommit
#################### Commit ####################
func (*LogStoreApplication) DeliverTx ¶
func (app *LogStoreApplication) DeliverTx(req abcitypes.RequestDeliverTx) abcitypes.ResponseDeliverTx
#################### DeliverTx ####################
func (*LogStoreApplication) EndBlock ¶
func (app *LogStoreApplication) EndBlock(req abcitypes.RequestEndBlock) abcitypes.ResponseEndBlock
#################### EndBlock ####################
func (*LogStoreApplication) ExecuteCommand ¶
func (LogStoreApplication) Info ¶
func (LogStoreApplication) Info(req abcitypes.RequestInfo) abcitypes.ResponseInfo
func (*LogStoreApplication) InitChain ¶
func (app *LogStoreApplication) InitChain(req abcitypes.RequestInitChain) abcitypes.ResponseInitChain
#################### InitChain ####################
func (*LogStoreApplication) IsPrivateCommand ¶
func (app *LogStoreApplication) IsPrivateCommand(commitBody models.TxCommitBody) bool
func (LogStoreApplication) IsValidatorUpdateTx ¶
func (LogStoreApplication) IsValidatorUpdateTx(tx []byte) bool
func (*LogStoreApplication) Query ¶
func (app *LogStoreApplication) Query(reqQuery abcitypes.RequestQuery) (resQuery abcitypes.ResponseQuery)
func (*LogStoreApplication) QueryVotingValidators ¶
func (app *LogStoreApplication) QueryVotingValidators() *Vote
func (LogStoreApplication) SetOption ¶
func (LogStoreApplication) SetOption(req abcitypes.RequestSetOption) abcitypes.ResponseSetOption
type Service ¶
type Service interface { //database RestoreLocalDatabase() error Query(request *models.CommandRequest) (*models.QueryResponse, error) QueryPrivateData(request *models.CommandRequest) (*models.QueryResponse, error) QueryPrivateDataWithAddress(request *models.QueryPrivateWithAddrRequest) (*models.QueryResponse, error) Execute(request *models.CommandRequest) (*models.ExecuteResponse, error) ExecuteAsync(request *models.CommandRequest) (*models.ExecuteAsyncResponse, error) ExecuteWithPrivateKey(request *models.CommandRequest) (*models.ExecuteResponse, error) //chain GetBlock(height int) (*models.Block, error) GetGenesis() (*models.Genesis, error) GetChainInfo(min int, max int) (*models.ChainInfo, error) GetChainState() (*models.ChainState, error) GetTransaction(hash string) (*models.Transaction, error) GetCommittedTxList(beginHeight int, endHeight int) (*models.TransactionCommittedList, error) GetUnconfirmedTxs() (*models.UnConfirmedTxs, error) GetNetInfo() (*models.NetInfo, error) GetKeyLog(key string) (*models.OperationKeyLog, error) //validators QueryVotingValidators() *Vote UpdateValidators(update *models.ValidatorUpdateData) *VoteCount //log writer StartCommandLogWriter() }
var AppService Service
Click to show internal directories.
Click to hide internal directories.