Documentation ¶
Index ¶
- type BlockHeader
- type GetBlockCountReply
- type GetBlockHeaderReply
- type GetBlockTemplateReply
- type GetInfoReply
- type JSONRpcResp
- type RPCClient
- func (r *RPCClient) Check(reserveSize int, address string) (bool, error)
- func (r *RPCClient) GetBlockCount() (*GetBlockCountReply, error)
- func (r *RPCClient) GetBlockHeaderByHeight(height int64) (*GetBlockHeaderReply, error)
- func (r *RPCClient) GetBlockTemplate(reserveSize int, address string) (*GetBlockTemplateReply, error)
- func (r *RPCClient) GetInfo() (*GetInfoReply, error)
- func (r *RPCClient) Info() *GetInfoReply
- func (r *RPCClient) SetClient(client *http.Client)
- func (r *RPCClient) Sick() bool
- func (r *RPCClient) SubmitBlock(hash string) (*JSONRpcResp, error)
- func (r *RPCClient) UpdateInfo() (*GetInfoReply, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockHeader ¶
type BlockHeader struct { BlockSize int `json:"block_size"` Depth int `json:"depth"` Difficulty int64 `json:"difficulty"` Hash string `json:"hash"` Height int `json:"height"` MajorVersion int `json:"major_version"` MinorVersion int `json:"minor_version"` Nonce uint32 `json:"nonce"` NumTxes int `json:"num_txes"` OrphanStatus bool `json:"orphan_status"` PrevHash string `json:"prev_hash"` Reward int64 `json:"reward"` Timestamp uint32 `json:"timestamp"` }
type GetBlockCountReply ¶
type GetBlockHeaderReply ¶
type GetBlockHeaderReply struct { BlockHeader BlockHeader `json:"block_header"` Status string `json:"status"` Untrusted bool `json:"untrusted"` }
type GetBlockTemplateReply ¶
type GetBlockTemplateReply struct { Difficulty int64 `json:"difficulty"` Height int64 `json:"height"` Blob string `json:"blocktemplate_blob"` ReservedOffset int `json:"reserved_offset"` PrevHash string `json:"prev_hash"` ExpectedReward int64 `json:"expected_reward"` SeedHash string `json:"seed_hash"` NextSeedHash string `json:"next_seed_hash"` }
type GetInfoReply ¶
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 //login string //password string Name string // contains filtered or unexported fields }
func (*RPCClient) GetBlockCount ¶
func (r *RPCClient) GetBlockCount() (*GetBlockCountReply, error)
func (*RPCClient) GetBlockHeaderByHeight ¶
func (r *RPCClient) GetBlockHeaderByHeight(height int64) (*GetBlockHeaderReply, 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) Info ¶
func (r *RPCClient) Info() *GetInfoReply
func (*RPCClient) SubmitBlock ¶
func (r *RPCClient) SubmitBlock(hash string) (*JSONRpcResp, error)
func (*RPCClient) UpdateInfo ¶
func (r *RPCClient) UpdateInfo() (*GetInfoReply, error)
Click to show internal directories.
Click to hide internal directories.