Jump to content

[RippledError(noPermission)] when querying ledger data


Graine

Recommended Posts

Hi, 
I am trying to get a complete ledgerState data for a ledger, but I get noPermission error. 
Docs say it means I need admin privileges, but the command itself is not in "list of admin commands", and I could get parts of ledgerState from WebSocket tool. 

Do I really need to run my own rippled? 

This is the command I'm using to get it: 
return api.getLedger({includeState: true, includeAllData: true} )

Disclaimer: I am the furthest thing from a software engineer. If this rubs you the wrong way, I am sorry. 

Link to comment
Share on other sites

You need admin permissions to retrieve the entire ledger with one command. You can, however, retrieve the ledger in sections without admin permissions. You can use that command to get the header and transactions with metadata. You can then use the ledger_data RPC command to get chunks of the ledger, returning the "marker" to get each additional chunk. I'm not sure if anyone has written code to automate this, but it would definitely be worth having.

Link to comment
Share on other sites

  • 2 weeks later...
On 6/7/2017 at 8:13 PM, JoelKatz said:

You need admin permissions to retrieve the entire ledger with one command. You can, however, retrieve the ledger in sections without admin permissions. You can use that command to get the header and transactions with metadata. You can then use the ledger_data RPC command to get chunks of the ledger, returning the "marker" to get each additional chunk. I'm not sure if anyone has written code to automate this, but it would definitely be worth having.

 
While I have succeeded in retrieving the ledger_data via RPC, the "marker" field is the only one that changes the output of the command. 

I have tried specifying 'type': 'account'  (as seen at https://github.com/ripple/rippled/pull/2066) to request only AccountRoot entries from the ledger, but I keep getting the regular ledger chunks :(. 

Here's the body of my request in case I have been making a mistake all along. 
 

Quote

{

"method": "ledger_data",

"params": [

{

"limit": 5,

"type": 'account',

"ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8"

 

}

]

}

Anyways, thank you for your reply, Mr. Katz!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...