servers

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const TlsPort = 443

Variables

View Source
var (
	Compile     string
	Config      *config.Configuration
	ChainParams *config.Params
	Chain       *blockchain.BlockChain
	Store       blockchain.IChainStore
	TxMemPool   *mempool.TxPool
	Pow         *pow.Service
	Server      elanet.Server
	Arbiter     *dpos.Arbitrator
	Arbiters    state.Arbitrators
	Wallet      *wallet.Wallet
)

Functions

func AuxHelp

func AuxHelp(param Params) map[string]interface{}

func CreateAuxBlock

func CreateAuxBlock(param Params) map[string]interface{}

func CreateRawTransaction added in v0.4.0

func CreateRawTransaction(param Params) map[string]interface{}

func DecodeRawTransaction added in v0.4.0

func DecodeRawTransaction(param Params) map[string]interface{}

func DiscreteMining

func DiscreteMining(param Params) map[string]interface{}

func EstimateSmartFee added in v0.2.2

func EstimateSmartFee(param Params) map[string]interface{}

func FromReversedString

func FromReversedString(reversed string) ([]byte, error)

func GetAmountByInputs added in v0.3.2

func GetAmountByInputs(param Params) map[string]interface{}

func GetArbiterPeersInfo added in v0.3.0

func GetArbiterPeersInfo(params Params) map[string]interface{}

func GetArbitersInfo added in v0.3.0

func GetArbitersInfo(params Params) map[string]interface{}

func GetArbitratorGroupByHeight

func GetArbitratorGroupByHeight(param Params) map[string]interface{}

func GetAssetByHash

func GetAssetByHash(param Params) map[string]interface{}

Asset

func GetBalanceByAddr

func GetBalanceByAddr(param Params) map[string]interface{}

func GetBalanceByAsset

func GetBalanceByAsset(param Params) map[string]interface{}

func GetBestBlockHash

func GetBestBlockHash(param Params) map[string]interface{}

func GetBlockByHash

func GetBlockByHash(param Params) map[string]interface{}

func GetBlockByHeight

func GetBlockByHeight(param Params) map[string]interface{}

func GetBlockCount

func GetBlockCount(param Params) map[string]interface{}

func GetBlockHash

func GetBlockHash(param Params) map[string]interface{}

func GetBlockHeight

func GetBlockHeight(param Params) map[string]interface{}

func GetBlockTransactions

func GetBlockTransactions(block *Block) interface{}

func GetCRDepositCoin added in v0.4.0

func GetCRDepositCoin(param Params) map[string]interface{}

func GetConfirmByHash added in v0.3.0

func GetConfirmByHash(param Params) map[string]interface{}

func GetConfirmByHeight added in v0.3.0

func GetConfirmByHeight(param Params) map[string]interface{}

func GetConnectionCount

func GetConnectionCount(param Params) map[string]interface{}

func GetDepositCoin added in v0.2.2

func GetDepositCoin(param Params) map[string]interface{}

func GetExistWithdrawTransactions added in v0.1.1

func GetExistWithdrawTransactions(param Params) map[string]interface{}

func GetFeeRate added in v0.2.2

func GetFeeRate(count int, confirm int) int

func GetInfo

func GetInfo(param Params) map[string]interface{}

func GetMiningInfo added in v0.3.4

func GetMiningInfo(param Params) map[string]interface{}

func GetNeighbors

func GetNeighbors(param Params) map[string]interface{}

func GetNodeState

func GetNodeState(param Params) map[string]interface{}

func GetRawTransaction

func GetRawTransaction(param Params) map[string]interface{}

Input JSON string examples for getblock method as following:

func GetReceivedByAddress added in v0.2.0

func GetReceivedByAddress(param Params) map[string]interface{}

func GetTransactionByHash

func GetTransactionByHash(param Params) map[string]interface{}

Transaction

func GetTransactionPool

func GetTransactionPool(param Params) map[string]interface{}

func GetTransactionsByHeight

func GetTransactionsByHeight(param Params) map[string]interface{}

func GetUTXOsByAmount added in v0.3.2

func GetUTXOsByAmount(param Params) map[string]interface{}

func GetUnspendOutput

func GetUnspendOutput(param Params) map[string]interface{}

func GetUnspends

func GetUnspends(param Params) map[string]interface{}

func ImportAddress added in v0.4.0

func ImportAddress(param Params) map[string]interface{}

func ImportPubkey added in v0.4.0

func ImportPubkey(param Params) map[string]interface{}

func ListCRCandidates added in v0.4.0

func ListCRCandidates(param Params) map[string]interface{}

list cr candidates according to ( state , start and limit)

func ListCurrentCRs added in v0.4.0

func ListCurrentCRs(param Params) map[string]interface{}

list current crs according to (state)

func ListProducers added in v0.2.2

func ListProducers(param Params) map[string]interface{}

func ListUnspent added in v0.1.1

func ListUnspent(param Params) map[string]interface{}

func ProducerStatus added in v0.2.2

func ProducerStatus(param Params) map[string]interface{}

func ResponsePack

func ResponsePack(errCode ErrCode, result interface{}) map[string]interface{}

func SendRawTransaction

func SendRawTransaction(param Params) map[string]interface{}

func SetLogLevel

func SetLogLevel(param Params) map[string]interface{}

func SignRawTransactionWithKey added in v0.4.0

func SignRawTransactionWithKey(param Params) map[string]interface{}

func SubmitAuxBlock

func SubmitAuxBlock(param Params) map[string]interface{}

func SubmitSidechainIllegalData added in v0.3.0

func SubmitSidechainIllegalData(param Params) map[string]interface{}

func ToReversedString

func ToReversedString(hash common.Uint256) string

func ToggleMining

func ToggleMining(param Params) map[string]interface{}

func VerifyAndSendTx

func VerifyAndSendTx(tx *Transaction) error

func VoteStatus added in v0.2.2

func VoteStatus(param Params) map[string]interface{}

Types

type ActivateProducerInfo added in v0.3.2

type ActivateProducerInfo struct {
	NodePublicKey string `json:"nodepublickey"`
	Signature     string `json:"signature"`
}

type ArbitratorGroupInfo

type ArbitratorGroupInfo struct {
	OnDutyArbitratorIndex int      `json:"ondutyarbitratorindex"`
	Arbitrators           []string `json:"arbitrators"`
}

type AttributeInfo

type AttributeInfo struct {
	Usage 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"`
}

func GetBlockInfo

func GetBlockInfo(block *Block, verbose bool) BlockInfo

type CancelProducerInfo added in v0.2.2

type CancelProducerInfo struct {
	OwnerPublicKey string `json:"ownerpublickey"`
	Signature      string `json:"signature"`
}

type CandidateVotes added in v0.4.0

type CandidateVotes struct {
	Candidate string `json:"candidate"`
	Votes     string `json:"votes"`
}

type CoinbaseInfo

type CoinbaseInfo struct {
	CoinbaseData string `json:"coinbasedata"`
}

type ConfirmInfo added in v0.3.0

type ConfirmInfo struct {
	BlockHash  string     `json:"blockhash"`
	Sponsor    string     `json:"sponsor"`
	ViewOffset uint32     `json:"viewoffset"`
	Votes      []VoteInfo `json:"votes"`
}

func GetConfirmInfo added in v0.3.0

func GetConfirmInfo(confirm *payload.Confirm) ConfirmInfo

type DefaultOutputInfo added in v0.2.2

type DefaultOutputInfo struct{}

type InputInfo

type InputInfo struct {
	TxID     string `json:"txid"`
	VOut     uint16 `json:"vout"`
	Sequence uint32 `json:"sequence"`
}

type OutputInfo

type OutputInfo struct {
	Value         string            `json:"value"`
	Index         uint32            `json:"n"`
	Address       string            `json:"address"`
	AssetID       string            `json:"assetid"`
	OutputLock    uint32            `json:"outputlock"`
	OutputType    uint32            `json:"type"`
	OutputPayload OutputPayloadInfo `json:"payload"`
}

type OutputPayloadInfo added in v0.2.2

type OutputPayloadInfo interface{}

type Params

type Params map[string]interface{}

func FromArray

func FromArray(array []interface{}, fields ...string) Params

func (Params) ArrayString added in v0.1.1

func (p Params) ArrayString(key string) ([]string, bool)

func (Params) Bool

func (p Params) Bool(key string) (bool, bool)

func (Params) Float

func (p Params) Float(field string) (float64, bool)

func (Params) Int

func (p Params) Int(field string) (int64, bool)

func (Params) String

func (p Params) String(key string) (string, bool)

func (Params) Uint

func (p Params) Uint(field string) (uint32, bool)

type PayloadInfo

type PayloadInfo interface{}

type PeerInfo added in v0.3.0

type PeerInfo struct {
	NetAddress     string `json:"netaddress"`
	Services       string `json:"services"`
	RelayTx        bool   `json:"relaytx"`
	LastSend       string `json:"lastsend"`
	LastRecv       string `json:"lastrecv"`
	ConnTime       string `json:"conntime"`
	TimeOffset     int64  `json:"timeoffset"`
	Version        uint32 `json:"version"`
	Inbound        bool   `json:"inbound"`
	StartingHeight uint32 `json:"startingheight"`
	LastBlock      uint32 `json:"lastblock"`
	LastPingTime   string `json:"lastpingtime"`
	LastPingMicros int64  `json:"lastpingmicros"`
}

type ProducerInfo added in v0.3.0

type ProducerInfo struct {
	OwnerPublicKey string `json:"ownerpublickey"`
	NodePublicKey  string `json:"nodepublickey"`
	NickName       string `json:"nickname"`
	Url            string `json:"url"`
	Location       uint64 `json:"location"`
	NetAddress     string `json:"netaddress"`
	Signature      string `json:"signature"`
}

type ProgramInfo

type ProgramInfo struct {
	Code      string `json:"code"`
	Parameter string `json:"parameter"`
}

type RegisterAssetInfo

type RegisterAssetInfo struct {
	Asset      payload.Asset `json:"asset"`
	Amount     string        `json:"amount"`
	Controller string        `json:"controller"`
}

type ServerInfo added in v0.3.0

type ServerInfo struct {
	Compile   string      `json:"compile"`   // The compile version of this server node
	Height    uint32      `json:"height"`    // The ServerNode latest block height
	Version   uint32      `json:"version"`   // The network protocol the ServerNode used
	Services  string      `json:"services"`  // The services the server supports
	Port      uint16      `json:"port"`      // The nodes's port
	RPCPort   uint16      `json:"rpcport"`   // The RPC service port
	RestPort  uint16      `json:"restport"`  // The RESTful service port
	WSPort    uint16      `json:"wsport"`    // The webservcie port
	Neighbors []*PeerInfo `json:"neighbors"` // The connected neighbor peers.
}

type SideChainPowInfo added in v0.1.1

type SideChainPowInfo struct {
	BlockHeight     uint32 `json:"blockheight"`
	SideBlockHash   string `json:"sideblockhash"`
	SideGenesisHash string `json:"sidegenesishash"`
	Signature       string `json:"signature"`
}

type SidechainIllegalDataInfo added in v0.3.0

type SidechainIllegalDataInfo struct {
	IllegalType         uint8    `json:"illegaltype"`
	Height              uint32   `json:"height"`
	IllegalSigner       string   `json:"illegalsigner"`
	Evidence            string   `json:"evidence"`
	CompareEvidence     string   `json:"compareevidence"`
	GenesisBlockAddress string   `json:"genesisblockaddress"`
	Signs               []string `json:"signs"`
}

type TransactionContextInfo added in v0.4.0

type TransactionContextInfo struct {
	*TransactionInfo
	BlockHash     string `json:"blockhash"`
	Confirmations uint32 `json:"confirmations"`
	Time          uint32 `json:"time"`
	BlockTime     uint32 `json:"blocktime"`
}

func GetTransactionContextInfo added in v0.4.0

func GetTransactionContextInfo(header *Header, tx *Transaction) *TransactionContextInfo

type TransactionInfo

type TransactionInfo struct {
	TxID           string             `json:"txid"`
	Hash           string             `json:"hash"`
	Size           uint32             `json:"size"`
	VSize          uint32             `json:"vsize"`
	Version        TransactionVersion `json:"version"`
	TxType         TxType             `json:"type"`
	PayloadVersion byte               `json:"payloadversion"`
	Payload        PayloadInfo        `json:"payload"`
	Attributes     []AttributeInfo    `json:"attributes"`
	Inputs         []InputInfo        `json:"vin"`
	Outputs        []OutputInfo       `json:"vout"`
	LockTime       uint32             `json:"locktime"`
	Programs       []ProgramInfo      `json:"programs"`
}

func GetTransactionInfo

func GetTransactionInfo(tx *Transaction) *TransactionInfo

type TransferCrossChainAssetInfo

type TransferCrossChainAssetInfo struct {
	CrossChainAddresses []string         `json:"crosschainaddresses"`
	OutputIndexes       []uint64         `json:"outputindexes"`
	CrossChainAmounts   []common.Fixed64 `json:"crosschainamounts"`
}

type UTXOInfo added in v0.1.1

type UTXOInfo struct {
	TxType        byte   `json:"txtype"`
	TxID          string `json:"txid"`
	AssetID       string `json:"assetid"`
	VOut          uint32 `json:"vout"`
	Address       string `json:"address"`
	Amount        string `json:"amount"`
	OutputLock    uint32 `json:"outputlock"`
	Confirmations uint32 `json:"confirmations"`
}

type VoteContentInfo added in v0.2.2

type VoteContentInfo struct {
	VoteType       outputpayload.VoteType `json:"votetype"`
	CandidatesInfo []CandidateVotes       `json:"candidates"`
}

type VoteInfo added in v0.3.0

type VoteInfo struct {
	Signer string `json:"signer"`
	Accept bool   `json:"accept"`
}

type VoteOutputInfo added in v0.2.2

type VoteOutputInfo struct {
	Version  byte              `json:"version"`
	Contents []VoteContentInfo `json:"contents"`
}

type WithdrawFromSideChainInfo added in v0.1.1

type WithdrawFromSideChainInfo struct {
	BlockHeight                uint32   `json:"blockheight"`
	GenesisBlockAddress        string   `json:"genesisblockaddress"`
	SideChainTransactionHashes []string `json:"sidechaintransactionhashes"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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