mycognosist / solar

A minimal Secure Scuttlebutt replication node.
Other
22 stars 2 forks source link

Query peers in db #21

Closed mycognosist closed 1 year ago

mycognosist commented 1 year ago

Adds the ability to store and query the public key and latest sequence number of all feeds in the local database. I think this will be really useful for testing replication. Basically corresponds to the replicate.upto MUXRPC method in go-ssb.

I'm not too sure about the get_peers naming. Might change it later as the API grows.

Example JSON-RPC response (pretty printed):

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "id": "@4+aQ4kCvSvghIq2yTh6LPz0ELZ3x4CKd93JTwkoudPM=.ed25519",
            "sequence": 48
        },
        {
            "id": "@HEqy940T6uB+T+d9Jaa58aNfRzLx9eRWqkZljBmnkmk=.ed25519",
            "sequence": 25179
        },
        {
            "id": "@MDErHCTxklXc7QZ43fnyzERbRJ7fccRfCYF11EqIFEI=.ed25519",
            "sequence": 3
        },
        {
            "id": "@o8lWpyLeSqV/BJV9pbxFhKpwm6Lw5k+sqexYK+zT9Tc=.ed25519",
            "sequence": 5
        }
    ]
}