Documentation
¶
Index ¶
- func CheckRPCServiceLevel(configurationPermitted string, level config.RPCServiceLevel) interface{}
- func DisableLog()
- func FromReversedString(reversed string) ([]byte, error)
- func GetPayload(pInfo PayloadInfo) (types.Payload, error)
- func GetStringArray(param http.Params, key string) ([]string, bool)
- func GetTransaction(cfg *Config, txInfo *TransactionInfo) (*types.Transaction, error)
- func RPCServiceLevelFromString(str string) config.RPCServiceLevel
- func ToReversedString(hash common.Uint256) string
- func Unmarshal(result interface{}, target interface{}) error
- func UseLogger(logger elalog.Logger)
- type ArbitratorGroupInfo
- type AssetInfo
- type AttributeInfo
- type BlockInfo
- type CoinbaseInfo
- type Config
- type CrossChainAssetInfo
- type ErrorCode
- type HttpService
- func (s *HttpService) CheckIllegalEvidence(param http.Params) (interface{}, error)
- func (s *HttpService) CreateAuxBlock(param http.Params) (interface{}, error)
- func (s *HttpService) DiscreteMining(param http.Params) (interface{}, error)
- func (s *HttpService) GetAssetByHash(param http.Params) (interface{}, error)
- func (s *HttpService) GetAssetList(params http.Params) (interface{}, error)
- func (s *HttpService) GetBalanceByAddr(param http.Params) (interface{}, error)
- func (s *HttpService) GetBalanceByAsset(param http.Params) (interface{}, error)
- func (s *HttpService) GetBestBlockHash(param http.Params) (interface{}, error)
- func (s *HttpService) GetBlockByHash(param http.Params) (interface{}, error)
- func (s *HttpService) GetBlockByHeight(param http.Params) (interface{}, error)
- func (s *HttpService) GetBlockCount(param http.Params) (interface{}, error)
- func (s *HttpService) GetBlockHash(param http.Params) (interface{}, error)
- func (s *HttpService) GetBlockHeight(param http.Params) (interface{}, error)
- func (s *HttpService) GetBlockTransactionsDetail(block *types.Block, filter func(*types.Transaction) bool) []*types.Transaction
- func (s *HttpService) GetConnectionCount(param http.Params) (interface{}, error)
- func (s *HttpService) GetExistDepositTransactions(param http.Params) (interface{}, error)
- func (s *HttpService) GetIllegalEvidenceByHeight(param http.Params) (interface{}, error)
- func (s *HttpService) GetNeighbors(param http.Params) (interface{}, error)
- func (s *HttpService) GetRawTransaction(param http.Params) (interface{}, error)
- func (s *HttpService) GetReceivedByAddress(param http.Params) (interface{}, error)
- func (s *HttpService) GetTransactionByHash(param http.Params) (interface{}, error)
- func (s *HttpService) GetTransactionPool(param http.Params) (interface{}, error)
- func (s *HttpService) GetTransactionsByHeight(param http.Params) (interface{}, error)
- func (s *HttpService) GetUnspendsByAddr(param http.Params) (interface{}, error)
- func (s *HttpService) GetUnspendsByAsset(param http.Params) (interface{}, error)
- func (s *HttpService) GetWithdrawTransactionByHash(param http.Params) (interface{}, error)
- func (s *HttpService) GetWithdrawTransactionsByHeight(param http.Params) (interface{}, error)
- func (s *HttpService) GetWithdrawTxsInfo(txs []*types.Transaction) interface{}
- func (s *HttpService) SendRawTransaction(param http.Params) (interface{}, error)
- func (s *HttpService) SendRechargeToSideChainTxByHash(param http.Params) (interface{}, error)
- func (s *HttpService) SetLogLevel(param http.Params) (interface{}, error)
- func (s *HttpService) SubmitAuxBlock(param http.Params) (interface{}, error)
- func (s *HttpService) ToggleMining(param http.Params) (interface{}, error)
- type InputInfo
- type OutputInfo
- type PayloadInfo
- type ProgramInfo
- type RechargeToSideChainAsset
- type RechargeToSideChainInfo
- type RechargeToSideChainInfoV0
- type RechargeToSideChainInfoV1
- type RegisterAssetInfo
- type SideChainPowInfo
- type SidechainIllegalDataInfo
- type TransactionInfo
- type TransferCrossChainAssetInfo
- type WithdrawOutputInfo
- type WithdrawTxInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckRPCServiceLevel ¶ added in v0.2.0
func CheckRPCServiceLevel(configurationPermitted string, level config.RPCServiceLevel) interface{}
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
func FromReversedString ¶
func GetPayload ¶
func GetPayload(pInfo PayloadInfo) (types.Payload, error)
func GetTransaction ¶
func GetTransaction(cfg *Config, txInfo *TransactionInfo) (*types.Transaction, error)
func RPCServiceLevelFromString ¶ added in v0.2.0
func RPCServiceLevelFromString(str string) config.RPCServiceLevel
func ToReversedString ¶
Types ¶
type ArbitratorGroupInfo ¶
type AttributeInfo ¶
type AttributeInfo struct {
Usage types.AttributeUsage `json:"usage"`
Data string `json:"data"`
}
type BlockInfo ¶
type BlockInfo struct {
Hash string `json:"hash"`
Confirmations uint32 `json:"confirmations"`
StrippedSize uint32 `json:"strippedsize"`
Size uint32 `json:"size"`
Weight uint32 `json:"weight"`
Height uint32 `json:"height"`
Version uint32 `json:"version"`
VersionHex string `json:"versionhex"`
MerkleRoot string `json:"merkleroot"`
Tx []interface{} `json:"tx"`
Time uint32 `json:"time"`
MedianTime uint32 `json:"mediantime"`
Nonce uint32 `json:"nonce"`
Bits uint32 `json:"bits"`
Difficulty string `json:"difficulty"`
ChainWork string `json:"chainwork"`
PreviousBlockHash string `json:"previousblockhash"`
NextBlockHash string `json:"nextblockhash"`
AuxPow string `json:"auxpow"`
MinerInfo string `json:"minerinfo"`
}
type CoinbaseInfo ¶
type CoinbaseInfo struct {
CoinbaseData string
}
type Config ¶
type Config struct {
Server server.Server
Chain *blockchain.BlockChain
Store *blockchain.ChainStore
GenesisAddress string
TxMemPool *mempool.TxPool
PowService *pow.Service
SpvService *spv.Service
SetLogLevel func(level elalog.Level)
ConfigurationPermitted string
GetBlockInfo func(cfg *Config, block *types.Block, verbose bool) BlockInfo
GetTransactionInfo func(cfg *Config, header interfaces.Header, tx *types.Transaction) *TransactionInfo
GetTransactionInfoFromBytes func(txInfoBytes []byte) (*TransactionInfo, error)
GetTransaction func(cfg *Config, txInfo *TransactionInfo) (*types.Transaction, error)
GetPayloadInfo func(p types.Payload, pVersion byte) PayloadInfo
GetPayload func(pInfo PayloadInfo) (types.Payload, error)
}
type CrossChainAssetInfo ¶
type ErrorCode ¶
type ErrorCode int
const ( InvalidTransaction ErrorCode = -32000 ResolverInternalError ErrorCode = -32001 UnknownTransaction ErrorCode = -32002 UnknownAsset ErrorCode = -32003 UnknownBlock ErrorCode = -32004 InvalidAsset ErrorCode = -32005 InvalidRequest ErrorCode = -32600 MethodNotFound ErrorCode = -32601 InvalidParams ErrorCode = -32602 InternalError ErrorCode = -32603 InvalidMethod ErrorCode = -32604 ParseError ErrorCode = -32700 )
type HttpService ¶
type HttpService struct {
// contains filtered or unexported fields
}
func NewHttpService ¶
func NewHttpService(cfg *Config) *HttpService
func (*HttpService) CheckIllegalEvidence ¶ added in v0.1.2
func (s *HttpService) CheckIllegalEvidence(param http.Params) (interface{}, error)
func (*HttpService) CreateAuxBlock ¶
func (s *HttpService) CreateAuxBlock(param http.Params) (interface{}, error)
func (*HttpService) DiscreteMining ¶
func (s *HttpService) DiscreteMining(param http.Params) (interface{}, error)
func (*HttpService) GetAssetByHash ¶
func (s *HttpService) GetAssetByHash(param http.Params) (interface{}, error)
Asset
func (*HttpService) GetAssetList ¶
func (s *HttpService) GetAssetList(params http.Params) (interface{}, error)
func (*HttpService) GetBalanceByAddr ¶
func (s *HttpService) GetBalanceByAddr(param http.Params) (interface{}, error)
func (*HttpService) GetBalanceByAsset ¶
func (s *HttpService) GetBalanceByAsset(param http.Params) (interface{}, error)
func (*HttpService) GetBestBlockHash ¶
func (s *HttpService) GetBestBlockHash(param http.Params) (interface{}, error)
func (*HttpService) GetBlockByHash ¶
func (s *HttpService) GetBlockByHash(param http.Params) (interface{}, error)
func (*HttpService) GetBlockByHeight ¶
func (s *HttpService) GetBlockByHeight(param http.Params) (interface{}, error)
func (*HttpService) GetBlockCount ¶
func (s *HttpService) GetBlockCount(param http.Params) (interface{}, error)
func (*HttpService) GetBlockHash ¶
func (s *HttpService) GetBlockHash(param http.Params) (interface{}, error)
func (*HttpService) GetBlockHeight ¶
func (s *HttpService) GetBlockHeight(param http.Params) (interface{}, error)
func (*HttpService) GetBlockTransactionsDetail ¶ added in v0.1.5
func (s *HttpService) GetBlockTransactionsDetail(block *types.Block, filter func(*types.Transaction) bool) []*types.Transaction
func (*HttpService) GetConnectionCount ¶
func (s *HttpService) GetConnectionCount(param http.Params) (interface{}, error)
func (*HttpService) GetExistDepositTransactions ¶
func (s *HttpService) GetExistDepositTransactions(param http.Params) (interface{}, error)
func (*HttpService) GetIllegalEvidenceByHeight ¶ added in v0.1.2
func (s *HttpService) GetIllegalEvidenceByHeight(param http.Params) (interface{}, error)
func (*HttpService) GetNeighbors ¶
func (s *HttpService) GetNeighbors(param http.Params) (interface{}, error)
func (*HttpService) GetRawTransaction ¶
func (s *HttpService) GetRawTransaction(param http.Params) (interface{}, error)
Input JSON string examples for getblock method as following:
func (*HttpService) GetReceivedByAddress ¶
func (s *HttpService) GetReceivedByAddress(param http.Params) (interface{}, error)
func (*HttpService) GetTransactionByHash ¶
func (s *HttpService) GetTransactionByHash(param http.Params) (interface{}, error)
Transaction
func (*HttpService) GetTransactionPool ¶
func (s *HttpService) GetTransactionPool(param http.Params) (interface{}, error)
func (*HttpService) GetTransactionsByHeight ¶
func (s *HttpService) GetTransactionsByHeight(param http.Params) (interface{}, error)
func (*HttpService) GetUnspendsByAddr ¶
func (s *HttpService) GetUnspendsByAddr(param http.Params) (interface{}, error)
func (*HttpService) GetUnspendsByAsset ¶
func (s *HttpService) GetUnspendsByAsset(param http.Params) (interface{}, error)
func (*HttpService) GetWithdrawTransactionByHash ¶
func (s *HttpService) GetWithdrawTransactionByHash(param http.Params) (interface{}, error)
func (*HttpService) GetWithdrawTransactionsByHeight ¶
func (s *HttpService) GetWithdrawTransactionsByHeight(param http.Params) (interface{}, error)
func (*HttpService) GetWithdrawTxsInfo ¶ added in v0.1.5
func (s *HttpService) GetWithdrawTxsInfo(txs []*types.Transaction) interface{}
func (*HttpService) SendRawTransaction ¶
func (s *HttpService) SendRawTransaction(param http.Params) (interface{}, error)
func (*HttpService) SendRechargeToSideChainTxByHash ¶
func (s *HttpService) SendRechargeToSideChainTxByHash(param http.Params) (interface{}, error)
func (*HttpService) SetLogLevel ¶
func (s *HttpService) SetLogLevel(param http.Params) (interface{}, error)
func (*HttpService) SubmitAuxBlock ¶
func (s *HttpService) SubmitAuxBlock(param http.Params) (interface{}, error)
func (*HttpService) ToggleMining ¶
func (s *HttpService) ToggleMining(param http.Params) (interface{}, error)
type OutputInfo ¶
type PayloadInfo ¶
type PayloadInfo interface{}
func GetPayloadInfo ¶
func GetPayloadInfo(p types.Payload, pVersion byte) PayloadInfo
type ProgramInfo ¶
type RechargeToSideChainInfo ¶
type RechargeToSideChainInfo struct {
MainChainTransactionHash *common.Uint256
DepositAssets []*RechargeToSideChainAsset
}
type RechargeToSideChainInfoV1 ¶
type RechargeToSideChainInfoV1 struct {
MainChainTransactionHash string `json:"mainchaintxhash"`
}
type RegisterAssetInfo ¶
type SideChainPowInfo ¶
type SidechainIllegalDataInfo ¶ added in v0.1.2
type TransactionInfo ¶
type TransactionInfo struct {
TxId string `json:"txid"`
Hash string `json:"hash"`
Size uint32 `json:"size"`
VSize uint32 `json:"vsize"`
Version uint32 `json:"version"`
LockTime uint32 `json:"locktime"`
Inputs []InputInfo `json:"vin"`
Outputs []OutputInfo `json:"vout"`
BlockHash string `json:"blockhash"`
Confirmations uint32 `json:"confirmations"`
Time uint32 `json:"time"`
BlockTime uint32 `json:"blocktime"`
TxType types.TxType `json:"type"`
PayloadVersion byte `json:"payloadversion"`
Payload PayloadInfo `json:"payload"`
Attributes []AttributeInfo `json:"attributes"`
Programs []ProgramInfo `json:"programs"`
}
func GetTransactionInfo ¶
func GetTransactionInfo(cfg *Config, header interfaces.Header, tx *types.Transaction) *TransactionInfo
func GetTransactionInfoFromBytes ¶
func GetTransactionInfoFromBytes(txInfoBytes []byte) (*TransactionInfo, error)
type TransferCrossChainAssetInfo ¶
type TransferCrossChainAssetInfo struct {
CrossChainAssets []CrossChainAssetInfo `json:"crosschainassets"`
}
type WithdrawOutputInfo ¶
type WithdrawTxInfo ¶
type WithdrawTxInfo struct {
TxID string `json:"txid"`
CrossChainAssets []*WithdrawOutputInfo `json:"crosschainassets"`
}
Click to show internal directories.
Click to hide internal directories.