servers

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AUXBLOCK_GENERATED_INTERVAL_SECONDS = 5

	MixedUTXO  utxoType = 0x00
	VoteUTXO   utxoType = 0x01
	NormalUTXO utxoType = 0x02
)
View Source
const TlsPort = 443

Variables

View Source
var LocalPow *pow.PowService
View Source
var ServerNode Noder

Functions

func AuxHelp

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

func CreateAuxBlock

func CreateAuxBlock(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 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 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 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 GetUnspendOutput

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

func GetUnspends

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

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 SubmitAuxBlock

func SubmitAuxBlock(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(txn *Transaction) ErrCode

func VoteStatus added in v0.2.2

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

Types

type ArbitratorGroupInfo

type ArbitratorGroupInfo struct {
	OnDutyArbitratorIndex int
	Arbitrators           []string
}

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 CoinbaseInfo

type CoinbaseInfo struct {
	CoinbaseData string
}

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 Neighbor added in v0.2.0

type Neighbor struct {
	ID         uint64 // The neighbor ID
	HexID      string // The neighbor ID in hex format
	Height     uint64 // The neighbor height
	Services   uint64 // The services the neighbor node supplied
	Relay      bool   // If this neighbor relay block and transactions
	External   bool   // If this neighbor is an external node
	State      string // The state of this neighbor node
	NetAddress string // The tcp address of this neighbor node
}

type NodeState added in v0.2.0

type NodeState struct {
	Compile     string // The compile version of this server node
	ID          uint64 // The nodes's id
	HexID       string // The nodes's id in hex format
	Height      uint64 // The ServerNode latest block height
	Version     uint32 // The network protocol the ServerNode used
	Services    uint64 // The services the local node supplied
	Relay       bool   // The relay capability of the ServerNode (merge into capbility flag)
	TxnCnt      uint64 // The transactions be transmit by
	RxTxnCnt    uint64 // The transaction received by this ServerNode
	Port        uint16 // The nodes's port
	PRCPort     uint16 // The RPC service prot
	RestPort    uint16 // The RESTful service port
	WSPort      uint16 // The webservcie port
	OpenPort    uint16 // The open service port
	OpenService bool   // If open service is enabled
	Neighbors   []Neighbor
}

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(filed string) (float64, bool)

func (Params) Int

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

func (Params) String

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

func (Params) Uint

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

type PayloadInfo

type PayloadInfo interface{}

type Producer added in v0.2.2

type Producer struct {
	OwnerPublicKey string `json:"ownerpublickey"`
	NodePublicKey  string `json:"nodepublickey"`
	Nickname       string `json:"nickname"`
	Url            string `json:"url"`
	Location       uint64 `json:"location"`
	Active         bool   `json:"active"`
	Votes          string `json:"votes"`
	NetAddress     string `json:"netaddress"`
	Index          uint64 `json:"index"`
}

type Producers added in v0.2.2

type Producers struct {
	Producers   []Producer `json:"producers"`
	TotalVotes  string     `json:"totalvotes"`
	TotalCounts uint64     `json:"totalcounts"`
}

type ProgramInfo

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

type RegisterAssetInfo

type RegisterAssetInfo struct {
	Asset      payload.Asset
	Amount     string
	Controller string
}

type RegisterProducerInfo added in v0.2.2

type RegisterProducerInfo 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 SideChainPowInfo added in v0.1.1

type SideChainPowInfo struct {
	BlockHeight     uint32
	SideBlockHash   string
	SideGenesisHash string
	SignedData      string
}

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"`
	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         TransactionType    `json:"type"`
	PayloadVersion byte               `json:"payloadversion"`
	Payload        PayloadInfo        `json:"payload"`
	Attributes     []AttributeInfo    `json:"attributes"`
	Programs       []ProgramInfo      `json:"programs"`
}

func GetTransactionInfo

func GetTransactionInfo(header *Header, tx *Transaction) *TransactionInfo

type TransferCrossChainAssetInfo

type TransferCrossChainAssetInfo struct {
	CrossChainAddresses []string
	OutputIndexes       []uint64
	CrossChainAmounts   []common.Fixed64
}

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 UpdateProducerInfo added in v0.2.2

type UpdateProducerInfo struct {
	*RegisterProducerInfo
}

type VoteContentInfo added in v0.2.2

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

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
	GenesisBlockAddress        string
	SideChainTransactionHashes []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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