Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCD Scope/Documentation #1312

Closed
jackzampolin opened this issue Jun 20, 2018 · 6 comments
Closed

LCD Scope/Documentation #1312

jackzampolin opened this issue Jun 20, 2018 · 6 comments
Labels
T:Docs Changes and features related to documentation.

Comments

@jackzampolin
Copy link
Member

It should be clear to users where to get network as well as ledger information from the gaiad process. It sounds like this should come out of an lcd instance. There should be some clear documentation around what information comes out of the lcd as well as an understanding of what lives there and what lives on gaiad.

cc @faboweb @nylira

@cwgoes cwgoes added T:Docs Changes and features related to documentation. lcd labels Jun 20, 2018
@faboweb
Copy link
Contributor

faboweb commented Jun 21, 2018

As we don't have socket support in the LCD I propose NewRoundStep should come from tendermint for now.
In the end, everything should go through the LCD I guess so developers only need to interface with one thing.
Which information is missing in the LCD apart from getting a list of nodes?

@nylira
Copy link
Contributor

nylira commented Jun 21, 2018

Missing Endpoints

There some critical RPC endpoints missing from the LCD:

/net_info
/dump_consensus_state
/consensus_state
/subscribe
/unsubscribe

Subscribe is a critical part of the network monitor backend. I subscribe to newBlock and NewRoundStep to give information to the user about what's happening in the most recent and upcoming blocks. Examples:

client.subscribe({ query: "tm.event = 'NewBlock'" }
client.subscribe({ query: `tm.event = 'NewRoundStep` }

Compatibility

The Tendermint RPC is not entirely compatible with the Cosmos LCD because the former does not support bech32 addresses. This makes it a huge pain to correlate the validator info in Tendermint's /dump_consensus_state compared to the LCD's /stake/validators. Validator addresses and public keys are in entirely different formats. This is what I'm talking about:

https://rpc.nylira.net/dump_consensus_state (hex)
https://lcd.nylira.net/stake/validators (bech32)

Accum Bug

The accum values for gaia-6002 are changing constantly, but the /validatorsets/latest endpoint is not refreshing that value. Check out these two pages, and try refreshing the page.

https://lcd.nylira.net/validatorsets/latest (bugged)
https://rpc.nylira.net/validators (bugged)

Not sure where the bug is coming from, but a working accum value from these endpoints would be immensely helpful. I can get working accum values from:

https://rpc.nylira.net/dump_consensus_state

But again, the dump_consensus_state from the Tendermint RPC does not show bech32 addresses, so I cannot correlate these values with validator addresses from the LCD.

@jackzampolin
Copy link
Member Author

cc @adrianbrink ☝️

@faboweb
Copy link
Contributor

faboweb commented Jun 22, 2018

Thank you for the detailed listing of requirements. Are all of these endpoints launch critical?

@nylira
Copy link
Contributor

nylira commented Jun 22, 2018

Yes, they are all being used right now in the block explorer. It would be nice if I only needed the LCD to get all of this.

@zmanian wrote a function to convert RPC hex validator addresses to LCD bech32 addresses, so the "Compatibility" point may be resolved:

function extractAndDecode(val:Validator) {
    var key= Buffer.from(val.pub_key.value,'base64')
    var encoded_key = Buffer.concat([Buffer.from('1624DE62','hex'),Buffer.from('20','hex'), key])
    return bech32.encode("cosmosvalpub",bech32.toWords(encoded_key))   
}

@fedekunze
Copy link
Collaborator

Moved to #2113. Please add remaining endpoints there if any

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:Docs Changes and features related to documentation.
Projects
None yet
Development

No branches or pull requests

5 participants