rpc

package
v0.0.0-...-16720d6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: GPL-3.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block_Header

type Block_Header struct {
	Depth        int64    `json:"depth"`
	Difficulty   string   `json:"difficulty"`
	Hash         string   `json:"hash"`
	Height       int64    `json:"height"`
	Topoheight   int64    `json:"topoheight"`
	MajorVersion uint64   `json:"major_version"`
	MinorVersion uint64   `json:"minor_version"`
	Nonce        uint64   `json:"nonce"`
	OrphanStatus bool     `json:"orphan_status"`
	Syncblock    bool     `json:"syncblock"`
	Txcount      int64    `json:"txcount"`
	Reward       uint64   `json:"reward"`
	Tips         []string `json:"tips"`
	Timestamp    uint64   `json:"timestamp"`
}

type Destinations

type Destinations struct {
	Amount  uint64 `json:"amount"`
	Address string `json:"address"`
}

type GetBalanceReply

type GetBalanceReply struct {
	Balance         uint64 `json:"balance"`
	UnlockedBalance uint64 `json:"unlocked_balance"`
}

type GetBlockHashReply

type GetBlockHashReply struct {
	BlockHeader Block_Header `json:"block_header"`
	Status      string       `json:"status"`
}

type GetBlockTemplateReply

type GetBlockTemplateReply struct {
	Blocktemplate_blob string `json:"blocktemplate_blob"`
	Blockhashing_blob  string `json:"blockhashing_blob"`
	Expected_reward    uint64 `json:"expected_reward"`
	Difficulty         uint64 `json:"difficulty"`
	Height             uint64 `json:"height"`
	Prev_Hash          string `json:"prev_hash"`
	Reserved_Offset    uint64 `json:"reserved_offset"`
	Epoch              uint64 `json:"epoch"` // used to expire pool jobs
	Status             string `json:"status"`
}

type GetInfoReply

type GetInfoReply struct {
	Difficulty         int64   `json:"difficulty"`
	Stableheight       int64   `json:"stableheight"`
	Topoheight         int64   `json:"topoheight"`
	Averageblocktime50 float32 `json:"averageblocktime50"`
	Target             int64   `json:"target"`
	Testnet            bool    `json:"testnet"`
	TopBlockHash       string  `json:"top_block_hash"`
	DynamicFeePerKB    int64   `json:"dynamic_fee_per_kb"`
	TotalSupply        int64   `json:"total_supply"`
	MedianBlockSize    int64   `json:"median_block_Size"`
	Version            string  `json:"version"`
	Height             int64   `json:"height"`
	TxPoolSize         int64   `json:"tx_pool_size"`
	Status             string  `json:"status"`
}

type JSONRpcResp

type JSONRpcResp struct {
	Id     *json.RawMessage       `json:"id"`
	Result *json.RawMessage       `json:"result"`
	Error  map[string]interface{} `json:"error"`
}

type RPCClient

type RPCClient struct {
	sync.RWMutex

	Accepts          int64
	Rejects          int64
	LastSubmissionAt int64
	FailsCount       int64
	Url              *url.URL

	Name string
	// contains filtered or unexported fields
}

func NewRPCClient

func NewRPCClient(cfg *pool.Upstream) (*RPCClient, error)

func (*RPCClient) Check

func (r *RPCClient) Check(reserveSize int, address string) (bool, error)

func (*RPCClient) GetBalance

func (r *RPCClient) GetBalance(url string) (*GetBalanceReply, error)

func (*RPCClient) GetBlockByHash

func (r *RPCClient) GetBlockByHash(hash string) (*GetBlockHashReply, error)

func (*RPCClient) GetBlockTemplate

func (r *RPCClient) GetBlockTemplate(reserveSize int, address string) (*GetBlockTemplateReply, error)

func (*RPCClient) GetInfo

func (r *RPCClient) GetInfo() (*GetInfoReply, error)

func (*RPCClient) GetLastBlockHeader

func (r *RPCClient) GetLastBlockHeader() (*GetBlockHashReply, error)

func (*RPCClient) Info

func (r *RPCClient) Info() *GetInfoReply

func (*RPCClient) SendTransaction

func (r *RPCClient) SendTransaction(url string, transferParams Transfer_Params) (*TransferSplit_Result, error)

func (*RPCClient) Sick

func (r *RPCClient) Sick() bool

func (*RPCClient) SubmitBlock

func (r *RPCClient) SubmitBlock(blocktemplate_blob string, blockhashing_blob string) (*JSONRpcResp, error)

func (*RPCClient) UpdateInfo

func (r *RPCClient) UpdateInfo() (*GetInfoReply, error)

type SubmitBlock_Result

type SubmitBlock_Result struct {
	BLID   string `json:"blid"`
	Status string `json:"status"`
}

type TransferSplit_Params

type TransferSplit_Params Transfer_Params

transfer split

type TransferSplit_Result

type TransferSplit_Result struct {
	Fee_list     []uint64 `json:"fee_list"`
	Amount_list  []uint64 `json:"amount_list"`
	Tx_key_list  []string `json:"tx_key_list"`
	Tx_hash_list []string `json:"tx_hash_list"`
	Tx_blob_list []string `json:"tx_blob_list"`
}

transfer split

type Transfer_Params

type Transfer_Params struct {
	Destinations []Destinations `json:"destinations"`
	//Fee          uint64         `json:"fee"`
	Mixin        uint64 `json:"mixin"`
	Unlock_time  uint64 `json:"unlock_time"`
	Payment_ID   string `json:"payment_id"`
	Get_tx_key   bool   `json:"get_tx_key"`
	Priority     uint64 `json:"priority"`
	Do_not_relay bool   `json:"do_not_relay"`
	Get_tx_hex   bool   `json:"get_tx_hex"`
}

Jump to

Keyboard shortcuts

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