Compare commits

...

2 commits

Author SHA1 Message Date
DataHoarder 11a2e1bccc
Update dependencies 2023-03-03 10:53:33 +01:00
DataHoarder 0adf4de11a
Added GetMinerData rpc call 2023-03-03 10:53:08 +01:00
4 changed files with 73 additions and 87 deletions

27
go.mod
View file

@ -3,33 +3,34 @@ module git.gammaspectra.live/P2Pool/go-monero
go 1.18
require (
git.gammaspectra.live/P2Pool/moneroutil v0.0.0-20221005073118-99e30759b459
github.com/dustin/go-humanize v1.0.0
git.gammaspectra.live/P2Pool/moneroutil v0.0.0-20221007140323-a2daa2d5fc48
github.com/dustin/go-humanize v1.0.1
github.com/go-zeromq/zmq4 v0.15.0
github.com/gosuri/uitable v0.0.4
github.com/sclevine/spec v1.4.0
github.com/spf13/cobra v1.5.0
github.com/spf13/cobra v1.6.1
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b
golang.org/x/net v0.0.0-20221004154528-8021a29435af
golang.org/x/crypto v0.6.0
golang.org/x/net v0.7.0
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/go-zeromq/goczmq/v4 v4.2.2 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.2 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 // indirect
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/uint128 v1.2.0 // indirect
)

60
go.sum
View file

@ -1,34 +1,32 @@
git.gammaspectra.live/P2Pool/moneroutil v0.0.0-20221005073118-99e30759b459 h1:DmFBoQT/4YVyzSQOKsL4h+uXGtHcTEmTlbExZV3bHiE=
git.gammaspectra.live/P2Pool/moneroutil v0.0.0-20221005073118-99e30759b459/go.mod h1:l7sI/MEzfmDvDggbmcAzch0sv27opIpw7yqJkkPP6Wo=
git.gammaspectra.live/P2Pool/moneroutil v0.0.0-20221007140323-a2daa2d5fc48 h1:ExrYG0RSrx/I4McPWgUF4B8R2OkblMrMki2ia8vG6Bw=
git.gammaspectra.live/P2Pool/moneroutil v0.0.0-20221007140323-a2daa2d5fc48/go.mod h1:XeSC8jK8RXnnzVAmp9e9AQZCDIbML3UoCRkxxGA+lpU=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
github.com/go-zeromq/goczmq/v4 v4.2.2 h1:HAJN+i+3NW55ijMJJhk7oWxHKXgAuSBkoFfvr8bYj4U=
github.com/go-zeromq/goczmq/v4 v4.2.2/go.mod h1:Sm/lxrfxP/Oxqs0tnHD6WAhwkWrx+S+1MRrKzcxoaYE=
github.com/go-zeromq/zmq4 v0.15.0 h1:SLqukpmLTx0JsLaOaCCjwy5eBdfJ+ouJX/677HoFbJM=
github.com/go-zeromq/zmq4 v0.15.0/go.mod h1:sD47DcXifeUFsVTB2ps8ijqTpEuTAlYgfuLoiWEXdCE=
github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY=
github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
@ -36,36 +34,34 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8=
github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b h1:huxqepDufQpLLIRXiVkTvnxrzJlpwmIWAObmcCcUFr0=
golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/net v0.0.0-20221004154528-8021a29435af h1:wv66FM3rLZGPdxpYL+ApnDe2HzHcTFta3z5nsc13wI4=
golang.org/x/net v0.0.0-20221004154528-8021a29435af/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 h1:cu5kTvlzcw1Q5S9f5ip1/cpiB4nXvw1XYzFPGgzLUOY=
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI=
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI=
lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=

View file

@ -16,6 +16,7 @@ const (
methodGetBlockHeaderByHash = "get_block_header_by_hash"
methodGetBlockHeaderByHeight = "get_block_header_by_height"
methodGetBlockTemplate = "get_block_template"
methodGetMinerData = "get_miner_data"
methodGetCoinbaseTxSum = "get_coinbase_tx_sum"
methodGetConnections = "get_connections"
methodGetFeeEstimate = "get_fee_estimate"
@ -33,7 +34,6 @@ const (
// GetAlternateChains displays alternative chains seen by the node.
//
// (restricted).
//
func (c *Client) GetAlternateChains(
ctx context.Context,
) (*GetAlternateChainsResult, error) {
@ -51,7 +51,6 @@ func (c *Client) GetAlternateChains(
// about the use of each RPC method and endpoint.
//
// (restricted).
//
func (c *Client) RPCAccessTracking(
ctx context.Context,
) (*RPCAccessTrackingResult, error) {
@ -66,7 +65,6 @@ func (c *Client) RPCAccessTracking(
}
// HardForkInfo looks up informaiton about the last hard fork.
//
func (c *Client) HardForkInfo(
ctx context.Context,
) (*HardForkInfoResult, error) {
@ -83,7 +81,6 @@ func (c *Client) HardForkInfo(
// GetBans retrieves the list of banned IPs.
//
// (restricted).
//
func (c *Client) GetBans(ctx context.Context) (*GetBansResult, error) {
resp := &GetBansResult{}
@ -108,7 +105,6 @@ type SetBansRequestParameters struct {
// SetBans bans a particular host.
//
// (restricted).
//
func (c *Client) SetBans(
ctx context.Context, params SetBansRequestParameters,
) (*SetBansResult, error) {
@ -125,7 +121,6 @@ func (c *Client) SetBans(
// GetVersion retrieves the version of monerod that the node uses.
//
// (restricted).
//
func (c *Client) GetVersion(ctx context.Context) (*GetVersionResult, error) {
resp := &GetVersionResult{}
@ -139,7 +134,6 @@ func (c *Client) GetVersion(ctx context.Context) (*GetVersionResult, error) {
// GenerateBlocksRequestParameters is the set of parameters to be passed to the
// GenerateBlocks RPC method.
//
type GenerateBlocksRequestParameters struct {
// AmountOfBlocks is the number of blocks to be generated.
//
@ -165,7 +159,6 @@ type GenerateBlocksRequestParameters struct {
// Difficulty is set permanently to 1 for regtest.
//
// (restricted).
//
func (c *Client) GenerateBlocks(
ctx context.Context, params GenerateBlocksRequestParameters,
) (*GenerateBlocksResult, error) {
@ -223,7 +216,6 @@ func (c *Client) RelayTx(
}
// GetBlockTemplate gets a block template on which mining a new block.
//
func (c *Client) GetBlockTemplate(
ctx context.Context, walletAddress string, reserveSize uint,
) (*GetBlockTemplateResult, error) {
@ -241,6 +233,17 @@ func (c *Client) GetBlockTemplate(
return resp, nil
}
func (c *Client) GetMinerData(ctx context.Context) (*GetMinerDataResult, error) {
resp := &GetMinerDataResult{}
err := c.JSONRPC(ctx, methodGetMinerData, nil, resp)
if err != nil {
return nil, fmt.Errorf("jsonrpc: %w", err)
}
return resp, nil
}
func (c *Client) GetConnections(
ctx context.Context,
) (*GetConnectionsResult, error) {
@ -256,7 +259,6 @@ func (c *Client) GetConnections(
// GetInfo retrieves general information about the state of the node and the
// network.
//
func (c *Client) GetInfo(ctx context.Context) (*GetInfoResult, error) {
resp := &GetInfoResult{}
@ -298,7 +300,6 @@ func (c *Client) GetCoinbaseTxSum(
}
// InnerJSON parses the content of the JSON embedded in `GetBlockResult`.
//
func (j *GetBlockResult) InnerJSON() (*GetBlockResultJSON, error) {
res := &GetBlockResultJSON{}
@ -329,7 +330,6 @@ func (c *Client) GetBlockHeadersRange(
// GetBlockHeaderByHeight retrieves block header information for either one or
// multiple blocks.
//
func (c *Client) GetBlockHeaderByHeight(
ctx context.Context, height uint64,
) (*GetBlockHeaderByHeightResult, error) {
@ -348,7 +348,6 @@ func (c *Client) GetBlockHeaderByHeight(
// GetBlockHeaderByHash retrieves block header information for either one or
// multiple blocks.
//
func (c *Client) GetBlockHeaderByHash(
ctx context.Context, hashes []string,
) (*GetBlockHeaderByHashResult, error) {
@ -367,7 +366,6 @@ func (c *Client) GetBlockHeaderByHash(
// GetBlockRequestParameters represents the set of possible parameters that can
// be used for submitting a call to the `get_block` jsonrpc method.
//
type GetBlockRequestParameters struct {
Height uint64 `json:"height,omitempty"`
Hash string `json:"hash,omitempty"`
@ -375,7 +373,6 @@ type GetBlockRequestParameters struct {
// GetBlock fetches full block information from a block at a particular hash OR
// height.
//
func (c *Client) GetBlock(
ctx context.Context, params GetBlockRequestParameters,
) (*GetBlockResult, error) {

View file

@ -2,7 +2,6 @@ package daemon
// RPCResultFooter contains the set of fields that every RPC result message
// will contain.
//
type RPCResultFooter struct {
// Status dictates whether the request worked or not. "OK" means good.
//
@ -27,7 +26,6 @@ type RPCResultFooter struct {
// GetAlternateChainsResult is the result of a call to the GetAlternateChains
// RPC method.
//
type GetAlternateChainsResult struct {
// Chains is the array of alternate chains seen by the node.
//
@ -76,7 +74,6 @@ type GetAlternateChainsResult struct {
// AccessTrackingResult is the result of a call to the RPCAccessTracking RPC
// method.
//
type RPCAccessTrackingResult struct {
Data []struct {
// Count is the number of times that the monero daemon received
@ -103,7 +100,6 @@ type RPCAccessTrackingResult struct {
}
// HardForkInfoResult is the result of a call to the HardForkInfo RPC method.
//
type HardForkInfoResult struct {
// EarliestHeight is the earliest height at which <version> is allowed.
//
@ -146,7 +142,6 @@ type HardForkInfoResult struct {
}
// GetVersionResult is the result of a call to the GetVersion RPC method.
//
type GetVersionResult struct {
Release bool `json:"release"`
Version uint64 `json:"version"`
@ -155,7 +150,6 @@ type GetVersionResult struct {
}
// GetBansResult is the result of a call to the GetBans RPC method.
//
type GetBansResult struct {
// Bans contains the list of nodes banned by this node.
//
@ -179,14 +173,12 @@ type GetBansResult struct {
}
// SetBansResult is the result of a call to the SetBans RPC method.
//
type SetBansResult struct {
RPCResultFooter `json:",inline"`
}
// GetFeeEstimateResult is the result of a call to the GetFeeEstimate RPC
// method.
//
type GetFeeEstimateResult struct {
// Fee is the per kB fee estimate.
//
@ -201,7 +193,6 @@ type GetFeeEstimateResult struct {
}
// GetInfoResult is the result of a call to the GetInfo RPC method.
//
type GetInfoResult struct {
AdjustedTime uint64 `json:"adjusted_time"`
AltBlocksCount int `json:"alt_blocks_count"`
@ -247,7 +238,6 @@ type GetInfoResult struct {
// GetBlockTemplateResult is the result of a call to the GetBlockTemplate RPC
// method.
//
type GetBlockTemplateResult struct {
// BlockhashingBlob is the blob on which to try to find a valid nonce.
//
@ -281,6 +271,25 @@ type GetBlockTemplateResult struct {
RPCResultFooter `json:",inline"`
}
// GetMinerDataResult is the result of a call to the GetMinerData RPC
// method.
type GetMinerDataResult struct {
MajorVersion uint8 `json:"major_version"`
Height uint64 `json:"height"`
PrevId string `json:"prev_id"`
SeedHash string `json:"seed_hash"`
Difficulty uint64 `json:"difficulty"`
MedianWeight uint64 `json:"median_weight"`
AlreadyGeneratedCoins uint64 `json:"already_generated_coins"`
MedianTimestamp uint64 `json:"median_timestamp"`
TxBacklog []struct {
Id string `json:"id"`
BlobSize uint64 `json:"blob_size"`
Weight uint64 `json:"weight"`
Fee uint64 `json:"fee"`
} `json:"tx_backlog"`
}
type Peer struct {
Host string `json:"host"`
ID uint64 `json:"id"`
@ -292,7 +301,6 @@ type Peer struct {
}
// GetPeerListResult is the result of a call to the GetPeerList RPC method.
//
type GetPeerListResult struct {
GrayList []Peer `json:"gray_list"`
WhiteList []Peer `json:"white_list"`
@ -302,7 +310,6 @@ type GetPeerListResult struct {
// GetConnectionsResult is the result of a call to the GetConnections RPC
// method.
//
type GetConnectionsResult struct {
Connections []struct {
Address string `json:"address"`
@ -344,7 +351,6 @@ type GetOutsResult struct {
}
// GetHeightResult is the result of a call to the GetHeight RPC method.
//
type GetHeightResult struct {
Hash string `json:"hash"`
Height uint64 `json:"height"`
@ -353,7 +359,6 @@ type GetHeightResult struct {
}
// GetNetStatsResult is the result of a call to the GetNetStats RPC method.
//
type GetNetStatsResult struct {
StartTime int64 `json:"start_time"`
TotalBytesIn uint64 `json:"total_bytes_in"`
@ -366,7 +371,6 @@ type GetNetStatsResult struct {
// GetPublicNodesResult is the result of a call to the GetPublicNodes RPC
// method.
//
type GetPublicNodesResult struct {
WhiteList []Peer `json:"white"`
GrayList []Peer `json:"gray"`
@ -376,7 +380,6 @@ type GetPublicNodesResult struct {
// GenerateBlocksResult is the result of a call to the GenerateBlocks RPC
// method.
//
type GenerateBlocksResult struct {
Blocks []string `json:"blocks"`
Height int `json:"height"`
@ -385,7 +388,6 @@ type GenerateBlocksResult struct {
}
// GetBlockCountResult is the result of a call to the GetBlockCount RPC method.
//
type GetBlockCountResult struct {
Count uint64 `json:"count"`
@ -393,14 +395,12 @@ type GetBlockCountResult struct {
}
// RelayTxResult is the result of a call to the RelayTx RPC method.
//
type RelayTxResult struct {
RPCResultFooter `json:",inline"`
}
// GetCoinbaseTxSumResult is the result of a call to the GetCoinbaseTxSum RPC
// method.
//
type GetCoinbaseTxSumResult struct {
EmissionAmount int64 `json:"emission_amount"`
EmissionAmountTop64 int `json:"emission_amount_top64"`
@ -520,7 +520,6 @@ type BlockHeader struct {
}
// GetBlockResult is the result of a call to the GetBlock RPC method.
//
type GetBlockResult struct {
// Blob is a hexadecimal representation of the block.
//
@ -543,7 +542,6 @@ type GetBlockResult struct {
}
// GetBlockResultJSON is the internal json-formatted block information.
//
type GetBlockResultJSON struct {
// MajorVersion (same as in the block header)
//
@ -624,7 +622,6 @@ func (c *GetBlockResultJSON) MinerOutputs() uint64 {
}
// SyncInfoResult is the result of a call to the SyncInfo RPC method.
//
type SyncInfoResult struct {
Credits uint64 `json:"credits"`
@ -670,7 +667,6 @@ type SyncInfoResult struct {
// GetLastBlockHeaderResult is the result of a call to the GetLastBlockHeader
// RPC method.
//
type GetLastBlockHeaderResult struct {
BlockHeader BlockHeader `json:"block_header"`
@ -679,7 +675,6 @@ type GetLastBlockHeaderResult struct {
// GetBlockHeadersRangeResult is the result of a call to the
// GetBlockHeadersRange RPC method.
//
type GetBlockHeadersRangeResult struct {
Headers []BlockHeader `json:"headers"`
@ -688,7 +683,6 @@ type GetBlockHeadersRangeResult struct {
// GetBlockHeaderByHeightResult is the result of a call to the
// GetBlockHeaderByHeight RPC method.
//
type GetBlockHeaderByHeightResult struct {
BlockHeader BlockHeader `json:"block_header"`
@ -697,7 +691,6 @@ type GetBlockHeaderByHeightResult struct {
// GetBlockHeaderByHashResult is the result of a call to the
// GetBlockHeaderByHash RPC method.
//
type GetBlockHeaderByHashResult struct {
BlockHeader BlockHeader `json:"block_header"`
BlockHeaders []BlockHeader `json:"block_headers"`
@ -727,7 +720,6 @@ type MiningStatusResult struct {
// GetTransactionPoolStatsResult is the result of a call to the
// GetTransactionPoolStats RPC method.
//
type GetTransactionPoolStatsResult struct {
PoolStats struct {
BytesMax uint64 `json:"bytes_max"`