2

I setup an archive node, the node already fully synced, and I call baking_rights rpc, but it returns "401 Unauthorized".

 curl -v 'http://localhost:8732/chains/main/blocks/1/helpers/baking_rights?all=true&cycle=0&max_priority=63'
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8732 (#0)
> GET /chains/main/blocks/1/helpers/baking_rights?all=true&cycle=0&max_priority=63 HTTP/1.1
> Host: localhost:8732
> User-Agent: curl/7.61.1
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< content-length: 0
< content-type: application/json
<
* Connection #0 to host localhost left intact

I didn't found any documents about rpc authorizing. Tezos-node version is 10.2. What did I miss?

1 Answer 1

3

Yes, you missed the documentation about the new ACLs that were introduced. The new ACLs broke RPC for just about everyone. Here is a node config snippet that allows all RPCs from localhost, adjust your config similarly:

"listen-addrs": [ ":8732" ],
      "acl": [ { "address": ":8732", "blacklist": [] } ]

Also, FYI, baking_rights and endorsing_rights query by cycle will absolutely KILL your server. Be prepared for 4-8m response times on these queries. Due to Granada, there are literal millions of rights that your node must process through each time you query.

The official workaround to get rights, as per core devs, is to query level by level vs by a single cycle. Example:

endorsing_rights?level=123&delegate=tz1....
endorsing_rights?level=124&delegate=tz1....
endorsing_rights?level=125&delegate=tz1....
...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.