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

Fix discovery external docs URL #309

Merged
merged 2 commits into from
Jan 20, 2021
Merged

Conversation

ziogaschr
Copy link
Member

@ziogaschr ziogaschr commented Jan 20, 2021

The RPC discovery document was returning links to GitHub repo of ethereum/go-ethereum. This PR makes those links, link back to our etclabscore/core-geth repo.

On top of that, this PR also adds link to our documentation site for the whole discovery document. This link has to be updated to the final page made available by #306.

Fixes #297

@ziogaschr ziogaschr force-pushed the fix/discovery-externaldocs-url branch from 26da9ed to 735fd88 Compare January 20, 2021 15:15
Copy link
Contributor

@meowsbits meowsbits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Example snippet provided as generated locally:

{
  "openrpc": "1.2.6", 
  "info": {
    "title": "Core-Geth RPC API", 
    "version": "1.11.22-unstable/generated-at:2021-01-20T15:07:56-06:00"
  }, 
  "externalDocs": {
    "description": "ETC Labs Documentation", 
    "url": "https://etclabscore.github.io/core-geth/"
  }, 
  "servers": [
    {
      "url": "ws://127.0.0.1:8546", 
      "name": "tcp"
    }
  ], 
  "methods": [
    {
      "name": "admin_addPeer", 
      "description": "```go\nfunc (api *privateAdminAPI) AddPeer(url string) (bool, error) {\n\tserver := api.node.Server()\n\tif server == nil {\n\t\treturn false, ErrNodeStopped\n\t}\n\tnode, err := enode.Parse(enode.ValidSchemes, url)\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"invalid enode: %v\", err)\n\t}\n\tserver.AddPeer(node)\n\treturn true, nil\n}// AddPeer requests connecting to a remote node, and also maintaining the new\n// connection at all times, even reconnecting if it is lost.\n\n```", 
      "summary": "AddPeer requests connecting to a remote node, and also maintaining the new\nconnection at all times, even reconnecting if it is lost.\n", 
      "paramStructure": "by-position", 
      "params": [
        {
          "name": "url", 
          "description": "string", 
          "summary": "", 
          "schema": {
            "type": ["string"]
          }, 
          "required": true, 
          "deprecated": false
        }
      ], 
      "result": {
        "name": "bool", 
        "description": "bool", 
        "summary": "", 
        "schema": {
          "type": ["boolean"]
        }, 
        "required": true, 
        "deprecated": false
      }, 
      "deprecated": false, 
      "externalDocs": {
        "description": "Github remote link", 
        "url": "https://github.com/etclabscore/core-geth/blob/master/node/api.go#L65"
      }
    }, 

@meowsbits meowsbits merged commit c3a0b59 into master Jan 20, 2021
@meowsbits meowsbits deleted the fix/discovery-externaldocs-url branch January 20, 2021 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rpc: discovery to return correct link for methods' externalDocs
2 participants