steemit / devportal

Steem Platform Developer Documentation.
https://developers.steem.io
MIT License
122 stars 74 forks source link

Understanding the Steem Blockchain Configuration Values #47

Closed TimCliff closed 6 years ago

TimCliff commented 6 years ago

Original Story:

@kennybll recently created this blog post which would probably be a good addition to the dev portal:

https://steemit.com/steem/@kennybll/steem-code-deep-dive-config

Re-storied by @inertia186:

As an API client developer, I would like to know what all of the results of get_config means, so that I can utilize them to generalize my client.

Many of these values would be handy for API clients. If an API client accepts a URL to a node, one of the first things the client can do is interogate the node with get_config to find out basic things like address prefix, symbols (WIP), and type of blockchain (testnet/maintet).

The original story talked about a deep dive into the config header. But all of those values are hard to find for non-c++ developers. And they're all present in the get_config results, e.g.:

curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_config", "params":[], "id":1}' https://api.steemit.com | jq

Not only that, but they're properly named in the method results with STEEM_ as the prefix instead of STEEMIT_.

AC

inertia186 commented 6 years ago

The path:

https://github.com/steemit/steem/blob/master/libraries/protocol/include/steemit/protocol/config.hpp

... is actually:

https://github.com/steemit/steem/blob/master/libraries/protocol/include/steem/protocol/config.hpp

Probably due to a directory structure change after the article was posted.

~I believe this could be its own .yml file in _data. Something like:~ (see AC instead)

_data/protocol/include-config.yml

Once it's part of devportal, we can reference an entry from other areas of devportal, like apidefinitions, when an api method or broadcast op relies on a particular config. For example, STEEMIT_MAX_ACCOUNT_WITNESS_VOTES restricts account_witness_vote.