Refactor block_by_* api calls to reuse code, reword API docs with more information.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
DataHoarder 2023-08-01 08:03:39 +02:00
parent 7c3e71171f
commit 73194bd79f
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk
4 changed files with 238 additions and 253 deletions

View file

@ -101,4 +101,5 @@ To update module dependencies, use these commands:
```bash
$ for f in $(find . -name go.mod); do (cd $(dirname $f); GOPROXY=direct go get -u ./...); done
$ for f in $(find . -name go.mod); do (cd $(dirname $f); GOPROXY=direct go mod tidy); done
$ go work sync
```

View file

@ -121,20 +121,6 @@ func main() {
return sideBlock
}
fillSideBlockChannelResult := func(params url.Values, sideBlocks chan *index.SideBlock) chan *index.SideBlock {
result := make(chan *index.SideBlock)
fillUncles := !params.Has("noUncles")
fillMined := !params.Has("noMainStatus")
fillMiner := !params.Has("noMiner")
go func() {
defer close(result)
for sideBlock := range sideBlocks {
result <- fillSideBlockResult(fillUncles, fillMined, fillMiner, sideBlock)
}
}()
return result
}
getBlockWithUncles := func(id types.Hash) (block *sidechain.PoolBlock, uncles []*sidechain.PoolBlock) {
block = p2api.ByTemplateId(id)
if block == nil {
@ -1146,7 +1132,7 @@ func main() {
})
//other redirects
serveMux.HandleFunc("/api/redirect/last_found{kind:|/raw|/info}", func(writer http.ResponseWriter, request *http.Request) {
serveMux.HandleFunc("/api/redirect/last_found{kind:|/full|/light|/raw|/info|/payouts|/coinbase}", func(writer http.ResponseWriter, request *http.Request) {
b := index.QueryFirstResult(indexDb.GetFoundBlocks("", 1))
if b == nil {
writer.WriteHeader(http.StatusNotFound)
@ -1154,7 +1140,7 @@ func main() {
}
http.Redirect(writer, request, fmt.Sprintf("/api/block_by_id/%s%s?%s", b.MainBlock.SideTemplateId.String(), mux.Vars(request)["kind"], request.URL.RawQuery), http.StatusFound)
})
serveMux.HandleFunc("/api/redirect/tip{kind:|/raw|/info}", func(writer http.ResponseWriter, request *http.Request) {
serveMux.HandleFunc("/api/redirect/tip{kind:|/full|/light|/raw|/info|/payouts|/coinbase}", func(writer http.ResponseWriter, request *http.Request) {
http.Redirect(writer, request, fmt.Sprintf("/api/block_by_id/%s%s?%s", indexDb.GetSideBlockTip().TemplateId.String(), mux.Vars(request)["kind"], request.URL.RawQuery), http.StatusFound)
})
@ -1445,34 +1431,36 @@ func main() {
_ = httputils.EncodeJson(request, writer, difficulty)
})
serveMux.HandleFunc("/api/block_by_{by:id|height}/{block:[0-9a-f]+|[0-9]+}{kind:|/light|/raw|/info|/payouts|/coinbase}", func(writer http.ResponseWriter, request *http.Request) {
serveMux.HandleFunc("/api/block_by_{by:id|height}/{block:[0-9a-f]+|[0-9]+}{kind:|/full|/light|/raw|/payouts|/coinbase}", func(writer http.ResponseWriter, request *http.Request) {
params := request.URL.Query()
var block *index.SideBlock
blockId := mux.Vars(request)["block"]
var sideBlock *index.SideBlock
if mux.Vars(request)["by"] == "id" {
if id, err := types.HashFromString(mux.Vars(request)["block"]); err == nil {
if b := indexDb.GetTipSideBlockByTemplateId(id); b != nil {
block = b
if id, err := types.HashFromString(blockId); err == nil {
if b := indexDb.GetSideBlockByMainId(id); b != nil {
sideBlock = b
} else if b = indexDb.GetTipSideBlockByTemplateId(id); b != nil {
sideBlock = b
} else if bs := index.QueryIterateToSlice(indexDb.GetSideBlocksByTemplateId(id)); len(bs) != 0 {
block = bs[0]
} else if b = indexDb.GetSideBlockByMainId(id); b != nil {
block = b
sideBlock = bs[0]
} else if mb := indexDb.GetMainBlockByCoinbaseId(id); mb != nil {
if b = indexDb.GetSideBlockByMainId(mb.Id); b != nil {
block = b
sideBlock = b
}
}
}
} else if mux.Vars(request)["by"] == "height" {
if height, err := strconv.ParseUint(mux.Vars(request)["block"], 10, 0); err == nil {
if height, err := strconv.ParseUint(blockId, 10, 0); err == nil {
if b := indexDb.GetTipSideBlockByHeight(height); b != nil {
block = b
sideBlock = b
}
}
}
if block == nil {
if sideBlock == nil {
writer.Header().Set("Content-Type", "application/json; charset=utf-8")
writer.WriteHeader(http.StatusNotFound)
buf, _ := utils.MarshalJSON(struct {
@ -1484,9 +1472,11 @@ func main() {
return
}
switch mux.Vars(request)["kind"] {
case "/light":
raw := p2api.LightByMainIdWithHint(block.MainId, block.TemplateId)
requestKind := mux.Vars(request)["kind"]
switch requestKind {
case "/light", "/full", "/raw":
raw := p2api.LightByMainIdWithHint(sideBlock.MainId, sideBlock.TemplateId)
if raw == nil {
writer.Header().Set("Content-Type", "application/json; charset=utf-8")
@ -1500,68 +1490,57 @@ func main() {
return
}
writer.Header().Set("Content-Type", "application/json; charset=utf-8")
writer.WriteHeader(http.StatusOK)
_ = httputils.EncodeJson(request, writer, raw)
case "/raw":
raw := p2api.LightByMainIdWithHint(block.MainId, block.TemplateId)
if raw == nil {
writer.Header().Set("Content-Type", "application/json; charset=utf-8")
writer.WriteHeader(http.StatusNotFound)
buf, _ := utils.MarshalJSON(struct {
Error string `json:"error"`
}{
Error: "not_found",
})
_, _ = writer.Write(buf)
return
}
// Process block if needed
if _, err := raw.PreProcessBlockWithOutputs(func(h types.Hash) *sidechain.PoolBlock {
b := p2api.LightByTemplateId(h)
if len(b) > 0 {
return b[0]
if requestKind == "/full" || requestKind == "/raw" {
// Process block if needed
if _, err := raw.PreProcessBlockWithOutputs(func(h types.Hash) *sidechain.PoolBlock {
b := p2api.LightByTemplateId(h)
if len(b) > 0 {
return b[0]
}
return nil
}, func() (outputs transaction.Outputs, bottomHeight uint64) {
preAllocatedShares := sidechain.PreAllocateShares(consensus.ChainWindowSize * 2)
preAllocatedRewards := make([]uint64, 0, len(preAllocatedShares))
return Outputs(p2api, indexDb, sideBlock, indexDb.DerivationCache(), preAllocatedShares, preAllocatedRewards)
}); err != nil {
writer.Header().Set("Content-Type", "application/json; charset=utf-8")
writer.WriteHeader(http.StatusNotFound)
buf, _ := utils.MarshalJSON(struct {
Error string `json:"error"`
}{
Error: "could_not_process",
})
_, _ = writer.Write(buf)
return
}
return nil
}, func() (outputs transaction.Outputs, bottomHeight uint64) {
preAllocatedShares := sidechain.PreAllocateShares(consensus.ChainWindowSize * 2)
preAllocatedRewards := make([]uint64, 0, len(preAllocatedShares))
return Outputs(p2api, indexDb, block, indexDb.DerivationCache(), preAllocatedShares, preAllocatedRewards)
}); err != nil {
writer.Header().Set("Content-Type", "application/json; charset=utf-8")
writer.WriteHeader(http.StatusNotFound)
buf, _ := utils.MarshalJSON(struct {
Error string `json:"error"`
}{
Error: "could_not_process",
})
_, _ = writer.Write(buf)
return
}
writer.Header().Set("Content-Type", "text/plain")
writer.WriteHeader(http.StatusOK)
buf, _ := raw.MarshalBinary()
_, _ = writer.Write(buf)
if requestKind == "raw" {
writer.Header().Set("Content-Type", "text/plain")
writer.WriteHeader(http.StatusOK)
buf, _ := raw.MarshalBinary()
_, _ = writer.Write(buf)
} else {
writer.Header().Set("Content-Type", "application/json; charset=utf-8")
writer.WriteHeader(http.StatusOK)
_ = httputils.EncodeJson(request, writer, raw)
}
case "/payouts":
writer.Header().Set("Content-Type", "application/json; charset=utf-8")
writer.WriteHeader(http.StatusOK)
result, err := indexDb.GetPayoutsBySideBlock(block)
result, err := indexDb.GetPayoutsBySideBlock(sideBlock)
if err != nil {
panic(err)
}
defer result.Close()
_ = httputils.StreamJsonIterator(request, writer, result.Next)
case "/coinbase":
foundBlock := indexDb.GetMainBlockById(block.MainId)
foundBlock := indexDb.GetMainBlockById(sideBlock.MainId)
if foundBlock == nil {
shares, _ := PayoutHint(p2api, indexDb, block)
shares, _ := PayoutHint(p2api, indexDb, sideBlock)
if shares != nil {
poolBlock := p2api.LightByMainId(block.MainId)
poolBlock := p2api.LightByMainId(sideBlock.MainId)
if poolBlock != nil {
addresses := make(map[address.PackedAddress]*index.MainCoinbaseOutput, len(shares))
@ -1624,10 +1603,7 @@ func main() {
default:
writer.Header().Set("Content-Type", "application/json; charset=utf-8")
writer.WriteHeader(http.StatusOK)
c := make(chan *index.SideBlock, 1)
c <- block
close(c)
_ = httputils.EncodeJson(request, writer, <-fillSideBlockChannelResult(params, c))
_ = httputils.EncodeJson(request, writer, fillSideBlockResult(!params.Has("noUncles"), !params.Has("noMainStatus"), !params.Has("noMiner"), sideBlock))
}
})

View file

@ -17,7 +17,7 @@ type MainBlock struct {
Difficulty uint64 `json:"difficulty"`
// Metadata should be jsonb blob, can be NULL. metadata such as pool ownership, links to other p2pool networks, and other interesting data
Metadata map[string]any `json:"metadata"`
Metadata map[string]any `json:"metadata,omitempty"`
// sidechain data for blocks we own
// SideTemplateId can be NULL

View file

@ -26,14 +26,43 @@ pre {
<div class="center" style="min-width: 800px; width: 50%">
<div>
<h2>API Documentation</h2>
<p>This site and API is in development. As such, returned data could be different, or methods be deprecated / replaced anytime. Though it will be avoided if possible :)</p>
<p>All the data showed on this site comes from the API or Monero. So if new features are added on site, it's possible to do so via the API.</p>
<p>This site and API is in development. As such, returned data could be different, or methods be deprecated / replaced anytime. Though it will be avoided if possible without affecting performance :)</p>
<p>All the data showed on this site comes from the API, P2Pool or Monero. So if new features are added on site, it's possible to do so via the API.</p>
<p>At the moment there is no broad rate-limiting. If abuse is detected, temporary rate limits can be put in place. You can always run your own instance of this site / API / consensus, see <a href="{%s p.Context().GetUrl("git.gammaspectra.live") %}/P2Pool/p2pool-observer">source code</a>.</p>
<p>Some historical data could be incomplete. These values have been replaced with all 0's / null bytes or 255 / 0xFF bytes depending on value. Some raw block records do not exist.</p>
<p>Some historical data could be incomplete. Some block records do not exist.</p>
<p>In general, mandatory parameters are specified on the path, optional parameters on query.</p>
<p><strong>Knowledge of P2Pool internals is strongly advised.</strong> Feel free to ask questions on IRC.</p>
<p><strong>Knowledge of P2Pool internals is strongly advised.</strong> Feel free to ask questions on IRC or Matrix.</p>
<p>Unless specified, all returned data is JSON with status code 200. A not found error will issue a status code 404 and JSON of <code>{"error": "not_found"}</code> or similar.</p>
</div>
<div>
<h3>Common types and fields</h3>
<p>
Fields within JSON objects may be omitted if marked as <em>omitempty</em> on its definition within the source code. An empty/zero representation is assumed.
</br>
For example, a types.Hash marked as <em>omitempty</em> would represent the value <span class="smaller mono">0000000000000000000000000000000000000000000000000000000000000000</span>.
</br>
For pointers/structs, the zero or nil value is considered empty. In lists, an empty / length of zero is assumed when empty.
</br>
Refer to source code to check the struct definition when in doubt.
</p>
<h4>types.Hash</h4>
<p>Represents a 256-bit hash value. This can refer to a block template id, main id, parents, transaction ids, proof of work hashes or any other value.</p>
<p>This value is encoded as 64 hexadecimal characters.</p>
<h4>crypto.PublicKeyBytes / crypto.PrivateKeyBytes</h4>
<p>Represents an <em>edwards25519</em> Point or Scalar in binary form. Encoded as a 256-bit value. This can refer to a public keys on a block, transaction keys or any other value.</p>
<p>This value is encoded as 64 hexadecimal characters.</p>
<h4>address.Address</h4>
<p>Represents a Monero address. Includes valid checksums.</p>
<p>This value is encoded using special base58.</p>
<h4>types.Difficulty</h4>
<p>Represents a 128-bit unsigned integer value. This can refer to weight, block difficulty or cumulative difficulty.</p>
<p>This value is encoded as a 64-bit unsigned integer when the highest 64-bits are not set. Otherwise, it is encoded as 32 hexadecimal characters.</p>
</div>
<hr/>
@ -108,12 +137,12 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/side_blocks_in_wi
"window_outputs": 30,
"transaction_count": 2,
"difficulty": 2107950958,
"cumulative_difficulty": "0000000000000000001b0a11dd0c9de0",
"cumulative_difficulty": 7610896210501088,
"pow_difficulty": 3167867138,
"pow_hash": "3e19a8e6c1db97bae77fb19b68b5bf6c927e3b212063ee219e26155b01000000",
"inclusion": 1,
"miner_address": "47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw",
"mined_main_at_height": false
"main_difficulty": 310626726029
},
{
"main_id": "30e8afa1c6961afae7686f4c9c2ee5ad77bd87bdcbf7da00958af53b3349264a",
@ -132,7 +161,7 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/side_blocks_in_wi
"window_outputs": 30,
"transaction_count": 2,
"difficulty": 2108162718,
"cumulative_difficulty": "0000000000000000001b0a115f67d672",
"cumulative_difficulty": 7610894102550130,
"pow_difficulty": 5140029450,
"pow_hash": "591082e76b158724c0a1a3ea8ffdec93eaa33a8d371eda2ad85ae9d500000000",
"inclusion": 1,
@ -145,7 +174,7 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/side_blocks_in_wi
"difficulty": 2109635914
}
],
"mined_main_at_height": false
"main_difficulty": 310626726029
},
{
"main_id": "6d1865f59d8cd38f5de6a498a2a5465040194f63122187b6e439743913aac202",
@ -167,10 +196,10 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/side_blocks_in_wi
"difficulty": 2109635914,
"cumulative_difficulty": "0000000000000000001b0a106401568a",
"pow_difficulty": 2153295646,
"pow_hash": "b7912df968b3935e914ff5daf257a6d276bc84f5c23d9055a2389efe01000000",
"pow_hash": 7610889884751498,
"inclusion": 1,
"miner_address": "457fCKqWYSacjDRLjqah9kTga8KCQRNwL4WP7EfBNQKghYF3RZunjGHCoPSd6F7Y6mVRpT6eCgkEtin3cKvSCf11AqcP33g",
"mined_main_at_height": false
"main_difficulty": 310568847048
},
{
"main_id": "f5582e27b94a34713b607d0f47821142c8b88f8a3335d5b2b1d679c909a9651f",
@ -189,12 +218,12 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/side_blocks_in_wi
"window_outputs": 31,
"transaction_count": 115,
"difficulty": 2109635914,
"cumulative_difficulty": "0000000000000000001b0a106401568a",
"cumulative_difficulty": 7610889884751498,
"pow_difficulty": 3604028547,
"pow_hash": "1d01609ded322d6665fb96410042cc5cc9604be078b77967a818143101000000",
"inclusion": 1,
"miner_address": "4BBb6ZBPPPWivZnx2m3m7YUUGQv54F9HfjPWurf2Xy2UDQwwPyb956dGQ3p9whrxNJ568zc3Ygfr9McVT1UJyRKtLi1jcMb",
"mined_main_at_height": false
"main_difficulty": 310847993727
}
]
</pre>
@ -227,12 +256,12 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/side_blocks_in_wi
"window_outputs": 28,
"transaction_count": 75,
"difficulty": 2099479471,
"cumulative_difficulty": "0000000000000000001b0a2473836c2c",
"cumulative_difficulty": 7610976044280876,
"pow_difficulty": 2770364525,
"pow_hash": "ea3d41d8874fb1de05aee76a0fb6df7267b07e34ee95cdf1f924e28c01000000",
"inclusion": 1,
"miner_address": "47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw",
"mined_main_at_height": false
"main_difficulty": 311336952550
},
{
"main_id": "fea4ee3769b350f2aad0571ff54eb555dbdf7f0cb811c19dea66bef286b041c4",
@ -251,12 +280,12 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/side_blocks_in_wi
"window_outputs": 28,
"transaction_count": 73,
"difficulty": 2103245329,
"cumulative_difficulty": "0000000000000000001b0a23792e7d07",
"cumulative_difficulty": 7610971844410631,
"pow_difficulty": 5249306449,
"pow_hash": "4ab091d18ac65c212feff8f1a971aee1da50c177620827326b5d75d100000000",
"inclusion": 1,
"miner_address": "47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw",
"mined_main_at_height": false
"main_difficulty": 311336952550
},
{
"main_id": "277a19bf024b4895553bbefc047eeb7733b95a97df6d8422759ec874d2d626c1",
@ -275,7 +304,7 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/side_blocks_in_wi
"window_outputs": 28,
"transaction_count": 72,
"difficulty": 2104858109,
"cumulative_difficulty": "0000000000000000001b0a227e77f578",
"cumulative_difficulty": 7610967638144376,
"pow_difficulty": 4514527717,
"pow_hash": "fc127598502b38c4977f7faef3f7db6bab11bab42353baed9ab58cf300000000",
"inclusion": 1,
@ -288,7 +317,7 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/side_blocks_in_wi
"difficulty": 2105207888
}
],
"mined_main_at_height": false
"main_difficulty": 311336952550
},
{
"main_id": "ff68eedc72252289e066d2dd59c209dc1502500d2cf4501fb69a91b69e2415b8",
@ -307,12 +336,12 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/side_blocks_in_wi
"window_outputs": 29,
"transaction_count": 47,
"difficulty": 2099621378,
"cumulative_difficulty": "0000000000000000001b0a1f8d604ce0",
"cumulative_difficulty": 7610955003350240,
"pow_difficulty": 5985480395,
"pow_hash": "6e0cc4b1e989a18a8f7a65c5aa5ad252a071cd57d877cac4f14bb2b700000000",
"inclusion": 1,
"miner_address": "47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw",
"mined_main_at_height": false
"main_difficulty": 311336952550
}
]
</pre>
@ -329,40 +358,46 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/side_blocks_in_wi
curl --silent https://{%s p.Context().NetServiceAddress %}/api/payouts/47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw
[
{
"template_id": "b87002e6b77723aaf9bd23f5425bd4d1e5d59a5f964b611dbcac44cf87d5fd3e",
"side_height": 4882060,
"main_id": "25aa3d6170869ce66aebb0f8932acf04885a64db70caa75e973b3111d3f643f8",
"main_height": 2863472,
"timestamp": 1681401091,
"coinbase_id": "aeb38695bd15beacb65b790fac17f76f020dd54c06eb2d724a6514d1d4af9cf5",
"coinbase_reward": 216527042165,
"coinbase_private_key": "e759ec6979d5640518c7776adde8cfa0d5af17a7a4831eba037f20877be9b90e",
"coinbase_output_index": 1,
"global_output_index": 71636253
"miner": 3,
"template_id": "cebb0c11be67c43c1a01cf2ac43e6bafe745a92012bbbb04be03842f56c5cc78",
"side_height": 5428093,
"main_id": "8e0c7b08f92be1bdc5c4153f7a8c3e536f1353aff898684477cc6ba857b8510e",
"main_height": 2910747,
"timestamp": 1687085695,
"coinbase_id": "e1b20914f4ff768277c19daa65ef5f2ace7cda6f3f2586caf569c3008b7510b1",
"coinbase_reward": 3400854816,
"coinbase_private_key": "9438ef07d1bb10ae05e68cdf900938807fe8639acf7dab27feedc08119072b02",
"coinbase_output_index": 26,
"global_output_index": 75393989,
"including_height": 5427726
},
{
"template_id": "05442258dc454342d3573106f0a8a57e1f47fb939f4a6d233abe194facc1d620",
"side_height": 4881901,
"main_id": "41a719bb13c3b652f2a204aaee03c645e6d773964efe701ce317507554170a7b",
"main_height": 2863457,
"timestamp": 1681399294,
"coinbase_id": "7b5994fe3ab9c7cb9a2e7a46e8a333a2ea47707fc06332a4bc0fbd5ec23e7e52",
"coinbase_reward": 186918635945,
"coinbase_private_key": "0666e8c11e90792d0cc04b5722cfe5cbb64cd2daa4e270ccbb4e1c323948bc02",
"coinbase_output_index": 19,
"global_output_index": 71635134
"miner": 3,
"template_id": "9bab936c12790d7e006ef1e97bf00572e85eb2f5647ce6320491fc93ba47f6a0",
"side_height": 5427897,
"main_id": "8bf0f5f17c53a68e5fb36a89781acd84c5936c4b06287aad09c038dac8b52860",
"main_height": 2910737,
"timestamp": 1687083786,
"coinbase_id": "413b6cac611c49d543d058a7d4ea908ba8a3774ced6781c2fdcdbbc0b187f24a",
"coinbase_reward": 103013108631,
"coinbase_private_key": "4344896bdacc7c58758090b955c7fd098f7414cdf773ec39fd12808f1fb4090f",
"coinbase_output_index": 11,
"global_output_index": 75393229,
"including_height": 5427531
},
{
"template_id": "bbca455a6032045d730e9311c8b83ec090ff93366bbd8dac7a6f6492425220cb",
"side_height": 4881818,
"main_id": "d528a54cff102eab4e6e311978921f15348ea88afa8ddc066eb6d5255ba09c81",
"main_height": 2863442,
"timestamp": 1681398196,
"coinbase_id": "2202f2e572b626c9b8751e2fa7e24e41a874a8bca98178046722257b96dd7835",
"coinbase_reward": 178951925576,
"coinbase_private_key": "b62ac1dc82ce0145eefcd5ab40511c7cf5a4b1579f440d055a7b1a70da166b0a",
"coinbase_output_index": 19,
"global_output_index": 71634339
"miner": 3,
"template_id": "566257bf73bc937a7b5bb6c3b6c1a2008db078a56d4fcbb2e34bde6f2b847d55",
"side_height": 5427764,
"main_id": "d74f9c0201c248911d6c306f7e6b5d58dea469ecf40ffd891e59dd0f6d082aea",
"main_height": 2910725,
"timestamp": 1687082281,
"coinbase_id": "561ed794fbdf5502fbd934fe7d7e4b9f4ccd4a8f7436fb93bc51c1e6dd431357",
"coinbase_reward": 170359596687,
"coinbase_private_key": "0332c944b6919f8e284993c35f810ce6b0c43cbf5f743f339fd4aaa197787109",
"coinbase_output_index": 14,
"global_output_index": 75392201,
"including_height": 5427402
}
]
</pre>
@ -378,49 +413,47 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/found_blocks?limi
[
{
"main_block": {
"id": "25aa3d6170869ce66aebb0f8932acf04885a64db70caa75e973b3111d3f643f8",
"height": 2863472,
"timestamp": 1681401091,
"reward": 612478640000,
"coinbase_id": "aeb38695bd15beacb65b790fac17f76f020dd54c06eb2d724a6514d1d4af9cf5",
"difficulty": 307908974778,
"metadata": null,
"side_template_id": "b87002e6b77723aaf9bd23f5425bd4d1e5d59a5f964b611dbcac44cf87d5fd3e",
"coinbase_private_key": "e759ec6979d5640518c7776adde8cfa0d5af17a7a4831eba037f20877be9b90e"
"id": "be284c7fc784ca83f92c2f1eac2e02524a99a63876179dae6c370a199d533d95",
"height": 2942191,
"timestamp": 1690866882,
"reward": 600373170000,
"coinbase_id": "691eb1e5b9222df2c667a481370acdd751c7f5f3cd0345ac9fc0f1feea396f7c",
"difficulty": 260315236919,
"side_template_id": "b76318caa4822826573ceebcabbd0309d2a710dd83700cb5d0cae206d9835cb4",
"coinbase_private_key": "5cdea4c89482c19588527238d32bdad97151c4e40800882183222d080ff5f203"
},
"side_height": 4882060,
"miner": 4,
"effective_height": 4882060,
"window_depth": 292,
"window_outputs": 31,
"transaction_count": 50,
"difficulty": 2127402638,
"cumulative_difficulty": "0000000000000000001b09c084ab2910",
"side_height": 5789985,
"miner": 2915,
"effective_height": 5789985,
"window_depth": 438,
"window_outputs": 41,
"transaction_count": 2,
"difficulty": 1301336116,
"cumulative_difficulty": 9202373148639334,
"inclusion": 1,
"miner_address": "4ADyLD6c7hzT5gCYxWnw7k2q5RPDxwqNTMsHcz9n91ir22YJbjBQ4LjGZgcLUVV7tyG33vXfB5SR1iCWaCjEQ7BNJUg6SyJ"
"miner_address": "42HEEF3NM9cHkJoPpDhNyJHuZ6DFhdtymCohF9CwP5KPM1Mp3eH2RVXCPRrxe4iWRogT7299R8PP7drGvThE8bHmRDq1qWp"
},
{
"main_block": {
"id": "41a719bb13c3b652f2a204aaee03c645e6d773964efe701ce317507554170a7b",
"height": 2863457,
"timestamp": 1681399294,
"reward": 600617180000,
"coinbase_id": "7b5994fe3ab9c7cb9a2e7a46e8a333a2ea47707fc06332a4bc0fbd5ec23e7e52",
"difficulty": 308497931397,
"metadata": null,
"side_template_id": "05442258dc454342d3573106f0a8a57e1f47fb939f4a6d233abe194facc1d620",
"coinbase_private_key": "0666e8c11e90792d0cc04b5722cfe5cbb64cd2daa4e270ccbb4e1c323948bc02"
"id": "ac6ae3cfe0f241e22aae6b7a165e7254f380d50c5a690994aa462120c00c4f16",
"height": 2942190,
"timestamp": 1690866866,
"reward": 608015760000,
"coinbase_id": "a7f784cc724f9e172d3bea13a18569b339e96d218b3fa54f9189abacbeb349ae",
"difficulty": 260396879898,
"side_template_id": "be9e779f4f8b2cd96c6e30a94c28c6d36af261ecf7cc195394471f112b850c49",
"coinbase_private_key": "896cde95bf6713d60b7ed4bafa88018e7418cd55db9232db08dc2de174cebd0b"
},
"side_height": 4881901,
"miner": 3,
"effective_height": 4881901,
"window_depth": 299,
"window_outputs": 25,
"transaction_count": 4,
"difficulty": 2137531229,
"cumulative_difficulty": "0000000000000000001b096aecb6d46c",
"side_height": 5789983,
"miner": 2915,
"effective_height": 5789983,
"window_depth": 438,
"window_outputs": 41,
"transaction_count": 49,
"difficulty": 1301263505,
"cumulative_difficulty": 9202370546222535,
"inclusion": 1,
"miner_address": "47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw"
"miner_address": "42HEEF3NM9cHkJoPpDhNyJHuZ6DFhdtymCohF9CwP5KPM1Mp3eH2RVXCPRrxe4iWRogT7299R8PP7drGvThE8bHmRDq1qWp"
}
]
</pre>
@ -435,54 +468,54 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/found_blocks?limi
<pre class="smaller">
curl --silent https://{%s p.Context().NetServiceAddress %}/api/shares?limit=2
[
{
"main_id": "e99f4f86db66e7f037e2108e25a0344d0a96eccba02f1ec13e50b3991141b7c5",
"main_height": 2863507,
"template_id": "4c8706e878fa4b50b4e43f86614291b04936a12d23207b4356d6527fec4c77e1",
"side_height": 4882328,
"parent_template_id": "4e96b17ff920d5090c46634f48237da103525c10b3f2eb63765892525d0555e8",
"miner": 3,
"effective_height": 4882328,
"nonce": 1157627952,
"extra_nonce": 2079385110,
"timestamp": 1681403943,
"software_id": 0,
"software_version": 196610,
"window_depth": 303,
"window_outputs": 26,
"transaction_count": 6,
"difficulty": 2081512088,
"cumulative_difficulty": "0000000000000000001b0a4af187bfe8",
"pow_difficulty": 3617012556,
"pow_hash": "04eb1dba4352b5574fb8517b2c5ec7d60b6627e551e1781271bdfb2f01000000",
"inclusion": 1,
"miner_address": "47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw",
"mined_main_at_height": false
},
{
"main_id": "0d228e68134741f208285deef59dcadeb8e43af87691c390a3f3da0633723570",
"main_height": 2863507,
"template_id": "4e96b17ff920d5090c46634f48237da103525c10b3f2eb63765892525d0555e8",
"side_height": 4882327,
"parent_template_id": "5885c5610c475d8bb3a4162c91511a08fc3493fa3a028bcc51648fe1ae8df6a1",
"miner": 2,
"effective_height": 4882327,
"nonce": 1778484165,
"extra_nonce": 2015373570,
"timestamp": 1681403939,
"software_id": 0,
"software_version": 196610,
"window_depth": 303,
"window_outputs": 26,
"transaction_count": 5,
"difficulty": 2081489188,
"cumulative_difficulty": "0000000000000000001b0a4a75766550",
"pow_difficulty": 8617237793,
"pow_hash": "aad50fc374723e9a4af60997ede2f007c87c02cbca278acf322d987f00000000",
"inclusion": 1,
"miner_address": "435QwkC3fJ4YeX929gmaBMeuUwR1wdmRrQBNyoKfpJdHKDbqnukHJeA768yt8ngnS7UTHRJ2yJmnWP8gCz6s3kkiBX8C363",
"mined_main_at_height": false
}
{
"main_id": "7717e2e59fb345ce3e5c5585b51632f32db2e98bb0a69b64a0b91f7b370be3b7",
"main_height": 2942216,
"template_id": "7f0ce404ab3d576d97dc4affacb5e443fb4c1f36f1bb09feed5b9af3dcca0169",
"side_height": 5790240,
"parent_template_id": "7070785f6ac7c486ab2ae7df443e6afc31010f87206b44c90be1339cd2ecfc70",
"miner": 2915,
"effective_height": 5790240,
"nonce": 1660977225,
"extra_nonce": 2706560389,
"timestamp": 1690869415,
"software_id": 0,
"software_version": 196613,
"window_depth": 424,
"window_outputs": 40,
"difficulty": 1327149158,
"cumulative_difficulty": 9202726518962104,
"pow_difficulty": 1720691274,
"pow_hash": "36685a8106e8b6a7450820f97cba0fa3cd2aa017fb4119f3737ffe7e02000000",
"inclusion": 1,
"transaction_count": 9,
"miner_address": "42HEEF3NM9cHkJoPpDhNyJHuZ6DFhdtymCohF9CwP5KPM1Mp3eH2RVXCPRrxe4iWRogT7299R8PP7drGvThE8bHmRDq1qWp",
"main_difficulty": 260565791438
},
{
"main_id": "9ce6483c303ada746b9e969c65235bcba0433865f6afd11153e94fb0e6d41046",
"main_height": 2942216,
"template_id": "7070785f6ac7c486ab2ae7df443e6afc31010f87206b44c90be1339cd2ecfc70",
"side_height": 5790239,
"parent_template_id": "d7477275674bd90bba39e4604cf2539ae99460856567895369cda165370ba081",
"miner": 5695,
"effective_height": 5790239,
"nonce": 460496,
"extra_nonce": 346986124,
"timestamp": 1690869412,
"software_id": 0,
"software_version": 196612,
"window_depth": 425,
"window_outputs": 40,
"difficulty": 1326689571,
"cumulative_difficulty": 9202725191812946,
"pow_difficulty": 1929563612,
"pow_hash": "1ba49ad252103dc9e5eba606a3c1fac0875e01b6163201d6b6f0d23902000000",
"inclusion": 1,
"transaction_count": 9,
"miner_address": "48bSCfGTKE4Kb3Fe3YWYgmNjgxjGqxZsP4mwHEQDVUQST2HxRGEX2566LbfmBE5bW2JcByTnjsWZiQZWj6f8XSpX4EDE9Gj",
"main_difficulty": 260565791438
}
]
</pre>
</div>
@ -491,8 +524,8 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/shares?limit=2
<hr/>
<div>
<h3 class="mono">/api/block_by_id/&lt;blockId&gt;[/light|/raw|/payouts|/coinbase]</h3>
<p>Response contains a block/share record on P2Pool by Template, Main Id, or Coinbase Id. You can select the JSON version or the binary format, or the light JSON format of the raw share.</p>
<h3 class="mono">/api/block_by_id/&lt;blockId&gt;[/full|/light|/raw|/info|/payouts|/coinbase]</h3>
<p>Response contains a block/share record on P2Pool by Template, Main Id, or Coinbase Id. You can select the JSON version or the binary format, or the full/light JSON format of the raw share.</p>
<p>Using <em>/payouts</em> you can query all payouts that include weights by this share.</p>
<p>Using <em>/coinbase</em> you can query all possible outputs and ownership for found and not found blocks.</p>
<pre class="smaller">
@ -504,7 +537,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_id/179cf
"side_height": 4877733,
"parent_template_id": "ffd6a96ce3131f043f273582a69d1eaa42b7557f47f7b241140cb22af9fbf556",
"miner": 3,
"uncle_of": "0000000000000000000000000000000000000000000000000000000000000000",
"effective_height": 4877733,
"nonce": 1694662668,
"extra_nonce": 2797508428,
@ -513,14 +545,14 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_id/179cf
"software_version": 196610,
"window_depth": 327,
"window_outputs": 33,
"transaction_count": 5,
"difficulty": 1956175240,
"cumulative_difficulty": "0000000000000000001b0115ccd40518",
"cumulative_difficulty": 7601017513575704,
"pow_difficulty": 1301275836828,
"pow_hash": "602d39809af709405eb8660028fdfa5bf80e71e6a4ec1fbb924ed80000000000",
"inclusion": 1,
"miner_address": "47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw",
"transaction_count": 5,
"mined_main_at_height": true,
"miner_address": "47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw",
"main_difficulty": 332971955880
}
</pre>
@ -531,8 +563,8 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_id/179cf
<hr/>
<div>
<h3 class="mono">/api/block_by_height/&lt;blockHeight&gt;[/light|/raw|/payouts|/coinbase]</h3>
<p>Response contains a block/share record on P2Pool by SideChain height. You can select the JSON version or the binary format, or the light JSON format of the raw share.</p>
<h3 class="mono">/api/block_by_height/&lt;blockHeight&gt;[/full|/light|/raw|/info|/payouts|/coinbase]</h3>
<p>Response contains a block/share record on P2Pool by SideChain height. You can select the JSON version or the binary format, or the full/light JSON format of the raw share.</p>
<p>Using <em>/payouts</em> you can query all payouts that include weights by this share.</p>
<p>Using <em>/coinbase</em> you can query all possible outputs and ownership for found and not found blocks.</p>
<pre class="smaller">
@ -544,7 +576,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"side_height": 4868351,
"parent_template_id": "b74acca03b7593386dd54b8132bf79522c9861b41f7797d0ce4f2af5f35cc170",
"miner": 1,
"uncle_of": "0000000000000000000000000000000000000000000000000000000000000000",
"effective_height": 4868351,
"nonce": 3271624915,
"extra_nonce": 1072029533,
@ -553,14 +584,13 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"software_version": 196609,
"window_depth": 323,
"window_outputs": 30,
"transaction_count": 28,
"difficulty": 2002581944,
"cumulative_difficulty": "0000000000000000001aedb5f2f0345a",
"cumulative_difficulty": 7579715115168858,
"pow_difficulty": 3782914221,
"pow_hash": "fe471ad3fbd112fabe2abebafeccd2cb8eb0077864e7cfe939eaa62201000000",
"inclusion": 1,
"transaction_count": 28,
"miner_address": "4ApeMQzcRS7huBW8HEGkug2e5kQxhhC2Ub9y8F9bc7arKHsCktAV24n5ezKM9PjX5yS3Pv4PPNMXT8rTAFVuKCRi1jEqJZd",
"mined_main_at_height": false,
"main_difficulty": 326506434325
}
</pre>
@ -599,7 +629,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"pow_hash":"f6ddc7bdb80b6050fc7dd9fea1ad009434b7bcda3e3cb309a295ad1b00000000",
"inclusion":1,
"miner_address":"4B4mXWBqrFYGk9W8t1J3UifSdnU723HHKf8VaWGSZGzLZUncHRJetPCjbDUha1udPd2ZpJrwYCmPv1jzvg3NCf7Z1YViuoa",
"mined_main_at_height":false,
"main_difficulty":344857075709
}
}
@ -612,7 +641,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"side_height":4973834,
"parent_template_id":"8d691190875157d160c8bc8787ab140b1855c1afcc7b8f3076bc3366711bb085",
"miner":2,
"uncle_of":"0000000000000000000000000000000000000000000000000000000000000000",
"effective_height":4973834,
"nonce":402718979,
"extra_nonce":3611692200,
@ -636,7 +664,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"difficulty":1902041368
}
],
"mined_main_at_height":false,
"main_difficulty":344857075709
}
}
@ -649,7 +676,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"side_height":4973835,
"parent_template_id":"372ee3a80d8ab9131878a56e5e2802aa3f797a55d38f76871f1eeeafd60cd828",
"miner":3,
"uncle_of":"0000000000000000000000000000000000000000000000000000000000000000",
"effective_height":4973835,
"nonce":3825436994,
"extra_nonce":2417583792,
@ -665,7 +691,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"pow_hash":"d6b5911b6b13e6258e2f1d23ab5256cf9b3c4a002e0722f15b4cc0e100000000",
"inclusion":1,
"miner_address":"47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw",
"mined_main_at_height":false,
"main_difficulty":344857075709
}
}
@ -678,7 +703,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"side_height":4973836,
"parent_template_id":"320a1a1d8849d48243670938efa640a271b289fae392ea35eb1a7daf88d3e2c8",
"miner":9,
"uncle_of":"0000000000000000000000000000000000000000000000000000000000000000",
"effective_height":4973836,
"nonce":132358,
"extra_nonce":1448692177,
@ -694,7 +718,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"pow_hash":"cf9774d250b905729cb988b24437ac5f27ccc55d78d6388ca7a8874700000000",
"inclusion":1,
"miner_address":"4AxaapsBMRYMJHFV5uApnFJth7stf4GiK9sqnLAH8SizguBbZ8YYtE2C3aF3UGVbh3ATRKdtd7ai1Hi1zfzMkdqmAZLqaGN",
"mined_main_at_height":false,
"main_difficulty":344857075709
}
}
@ -707,7 +730,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"side_height":4973837,
"parent_template_id":"3f089efbc7fd31eb98705665acbbe1e7d3b290866cb94f39a0d2e072f2a11f14",
"miner":2,
"uncle_of":"0000000000000000000000000000000000000000000000000000000000000000",
"effective_height":4973837,
"nonce":1879082776,
"extra_nonce":1309685883,
@ -723,7 +745,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"pow_hash":"979dbacd27e0c15bfa93a72bda30f9e4e472ab86cfc9bc5f71ceb4e300000000",
"inclusion":1,
"miner_address":"435QwkC3fJ4YeX929gmaBMeuUwR1wdmRrQBNyoKfpJdHKDbqnukHJeA768yt8ngnS7UTHRJ2yJmnWP8gCz6s3kkiBX8C363",
"mined_main_at_height":false,
"main_difficulty":344857075709
}
}
@ -736,7 +757,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"side_height":4973838,
"parent_template_id":"ba8514bd7403c16a61b7e20f34981d9cb72de09a7b0593d55ef14d55bff1908e",
"miner":3,
"uncle_of":"0000000000000000000000000000000000000000000000000000000000000000",
"effective_height":4973838,
"nonce":2868937852,
"extra_nonce":869103007,
@ -752,7 +772,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"pow_hash":"2d03c8818798cb1bde4a6d2d64d0a59a04b8228e94aff841599c632002000000",
"inclusion":1,
"miner_address":"47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw",
"mined_main_at_height":false,
"main_difficulty":344857075709
}
}
@ -765,7 +784,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"side_height":4973839,
"parent_template_id":"19278cd3a3022a25edf4b91a5544a88b8c8f6f78f84e862b01781de493b562c8",
"miner":2,
"uncle_of":"0000000000000000000000000000000000000000000000000000000000000000",
"effective_height":4973839,
"nonce":822086856,
"extra_nonce":1665899192,
@ -781,7 +799,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"pow_hash":"b1aa60a163d39b0524f7448954f770de8cbb873e346b63e37659062500000000",
"inclusion":1,
"miner_address":"435QwkC3fJ4YeX929gmaBMeuUwR1wdmRrQBNyoKfpJdHKDbqnukHJeA768yt8ngnS7UTHRJ2yJmnWP8gCz6s3kkiBX8C363",
"mined_main_at_height":false,
"main_difficulty":344857075709
}
}
@ -794,7 +811,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"side_height":4973840,
"parent_template_id":"000c39fc469e4062fe4da6fc8444c3c990ad817397c94abe13c46720a4c9ab75",
"miner":19,
"uncle_of":"0000000000000000000000000000000000000000000000000000000000000000",
"effective_height":4973840,
"nonce":1543602719,
"extra_nonce":2911703055,
@ -824,13 +840,11 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"reward":600000000000,
"coinbase_id":"9ba3e0449f6ff3a108a877f2f37eedf0b87f811ff5725634e109ba0d2789d479",
"difficulty":344633368046,
"metadata":null,
"side_template_id":"af88e464df1f31761996031f5c851f1a59d6ecb4b6e917407e1164ce6a569a07",
"coinbase_private_key":"1331ab860507192987e98497b971daac66e8804c51ad115ab6b2bf3d2abd270d"
},
"side_height":4973840,
"miner":19,
"uncle_of":"0000000000000000000000000000000000000000000000000000000000000000",
"effective_height":4973840,
"window_depth":332,
"window_outputs":31,
@ -1100,7 +1114,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"side_height":4973841,
"parent_template_id":"af88e464df1f31761996031f5c851f1a59d6ecb4b6e917407e1164ce6a569a07",
"miner":4,
"uncle_of":"0000000000000000000000000000000000000000000000000000000000000000",
"effective_height":4973841,
"nonce":2466322468,
"extra_nonce":893603150,
@ -1116,7 +1129,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"pow_hash":"bbe4a67f6a9bca4028ca1faa940d692f834978d10ed18e34d07b625c00000000",
"inclusion":1,
"miner_address":"4ADyLD6c7hzT5gCYxWnw7k2q5RPDxwqNTMsHcz9n91ir22YJbjBQ4LjGZgcLUVV7tyG33vXfB5SR1iCWaCjEQ7BNJUg6SyJ",
"mined_main_at_height":false,
"main_difficulty":344205037143
}
}
@ -1129,7 +1141,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"side_height":4973842,
"parent_template_id":"0ef3e5ddcb0c4f6398eb833361b3749f92fc232a049c52052c5da956c9bbc868",
"miner":19,
"uncle_of":"0000000000000000000000000000000000000000000000000000000000000000",
"effective_height":4973842,
"nonce":1090620480,
"extra_nonce":162834581,
@ -1145,7 +1156,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"pow_hash":"bc26c47392a94004bc736822520f67bbf56dfba432e6d75aa12ab2e900000000",
"inclusion":1,
"miner_address":"4B4mXWBqrFYGk9W8t1J3UifSdnU723HHKf8VaWGSZGzLZUncHRJetPCjbDUha1udPd2ZpJrwYCmPv1jzvg3NCf7Z1YViuoa",
"mined_main_at_height":false,
"main_difficulty":344205037143
}
}
@ -1158,7 +1168,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"side_height":4973843,
"parent_template_id":"5f72a35b571746ac3835b204020e548e65a7350d84d5d7a7aa3a749dc058f7ad",
"miner":3,
"uncle_of":"0000000000000000000000000000000000000000000000000000000000000000",
"effective_height":4973843,
"nonce":4026630147,
"extra_nonce":2353672144,
@ -1174,7 +1183,6 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
"pow_hash":"5c06f2ebd7fc22dca35bed2a0faa9e1aad7e36a5c89af94d587915b400000000",
"inclusion":1,
"miner_address":"47ab14EokGgCTX7RYoVhrNMjVA7GfW1jyMAmL7qBQz9fa4RZ6ZsBUgeRGuPWjqeM1wLptSJH5xuX2H4mAepMYvu6JqWMsGw",
"mined_main_at_height":false,
"main_difficulty":344205037143
}
}
@ -1187,11 +1195,11 @@ curl --silent https://{%s p.Context().NetServiceAddress %}/api/block_by_height/4
<h3>Redirect APIs</h3>
<p>Several endpoints are available that redirect/forward your request via <em>Location</em> HTTP header to the relevant API listed above.</p>
<p>
<h4 class="mono">/api/last_found[/raw]?...</h4>
<h4 class="mono">/api/last_found[/raw|...]?...</h4>
Redirects to the <em>/api/block_by_id/...</em> record for the last block found on the Monero network by P2Pool.
</p>
<p>
<h4 class="mono">/api/tip[/raw]?...</h4>
<h4 class="mono">/api/tip[/raw|...]?...</h4>
Redirects to the <em>/api/block_by_id/...</em> record for the last share found by P2Pool.
</p>
</div>