dtr-org / docs.unit-e.io

Unit-e documentation
https://docs.unit-e.io/
MIT License
9 stars 3 forks source link

Generate RPC API documentation #6

Closed cornelius closed 5 years ago

cornelius commented 5 years ago

This commit adds full documentation for all unit-e RPC calls. The information is generated from the help information from the client itself so it's easy to keep it up to date with the released versions and with the latest development state. The commit represents the current state of dtr-org/unit-e master.

It's done in a generic way so this could also be applied to upstream. This might be a nice contribution to the documentation upstream.

There are still a few things missing and a few glitches:

These things will be addressed in subsequent commits.

Some notes for reviewing this pull request:

cmihai commented 5 years ago

Nit: I would run autopep8 on all the committed Python files, but that's just a personal code style preference.

Gnappuraz commented 5 years ago

It looks like there is an indentation issue

/home/travis/build/dtr-org/docs.unit-e.io/reference/rpc/createrawtransaction.rst:23: WARNING: Unexpected section title.
[
{
/home/travis/build/dtr-org/docs.unit-e.io/reference/rpc/logging.rst:17: WARNING: Unexpected indentation.
cornelius commented 5 years ago

There's the just the question of how/whether to document "hidden" RPC methods, which don't have a help text (for example, proposerstatus, used by the wallet GUI).

What's the rationale for "hiding" these RPC methods? I tend to think that if they exist and can be accessed they should also be documented. If they are not supposed to be used for certain purposes this could be part of the documentation.

Also, can/should we host all the documentation somewhere for easier access? I could bring a Raspberry Pi to act as a fileserver, maybe?

The documentation is already served on http://docs.unit-e.io. It's currently password protected. The master branch is automatically pushed there.

Nit: I would run autopep8 on all the committed Python files, but that's just a personal code style preference.

No, that's a good point. Maybe we should document our Python style guide somewhere. We have that for C++ in a very good way, but for Python this is not very explicit (and it could be as simple as run xyz on the code to get proper formatting).

cornelius commented 5 years ago

It looks like there is an indentation issue

/home/travis/build/dtr-org/docs.unit-e.io/reference/rpc/createrawtransaction.rst:23: WARNING: Unexpected section title.
[
{
/home/travis/build/dtr-org/docs.unit-e.io/reference/rpc/logging.rst:17: WARNING: Unexpected indentation.

I'll fix it.

cornelius commented 5 years ago

No, that's a good point. Maybe we should document our Python style guide somewhere. We have that for C++ in a very good way, but for Python this is not very explicit (and it could be as simple as run xyz on the code to get proper formatting).

I see that upstream has done some work on this in the developer notes as well as the linter code so I suppose we will inherit some of that with the next upstream merge.