OdyseeTeam / chainquery

Chainquery parses and syncs the LBRY blockchain data into structured SQL
https://lbry.tech
MIT License
2.25k stars 42 forks source link

Add support for reposts (and blocked/filtered content) #140

Closed kauffj closed 4 years ago

tzarebczan commented 4 years ago

Here's a sample of a repost. The repost itself may also have its own metadata, but there's none present yet. You also don't know if something is a filter vs a block yet, besides keying off the channel name itself (not sure if this will improve).

A whole channel may be blocked/filtered via a repost, so any downstream services using this data will need to reference that as well.

{
  "lbry://repost#602808e9e83262ed4a81cbc4e7421662255fb2d1": {
    "address": "bQhwHStHWa8W8sFjD83MJCRwckEvh43QhZ",
    "amount": "0.01",
    "canonical_url": "lbry://@tom+laptop#4/repost#6",
    "claim_id": "602808e9e83262ed4a81cbc4e7421662255fb2d1",
    "claim_op": "create",
    "confirmations": 2873,
    "height": 703628,
    "is_channel_signature_valid": true,
    "meta": {
      "activation_height": 703628,
      "creation_height": 703628,
      "creation_timestamp": 1579710083,
      "effective_amount": "0.01",
      "expiration_height": 2806028,
      "is_controlling": true,
      "reposted": 0,
      "support_amount": "0.0",
      "take_over_height": 703628,
      "trending_global": 0.0,
      "trending_group": 0,
      "trending_local": 0.0,
      "trending_mixed": 0.0
    },
    "name": "repost",
    "normalized_name": "repost",
    "nout": 0,
    "permanent_url": "lbry://repost#602808e9e83262ed4a81cbc4e7421662255fb2d1",
    "reposted_claim": {
      "address": "bUAokaLYaAwp2pc1KVvAERVSrjPNNqYVkF",
      "amount": "0.1",
      "canonical_url": "lbry://test-upload-mp4-converted#b",
      "claim_id": "ba6042f59b90623a1cca07ce3e7483516f6fca43",
      "claim_op": "create",
      "confirmations": 7614,
      "height": 698887,
      "meta": {
        "activation_height": 698887,
        "creation_height": 698887,
        "creation_timestamp": 1578949431,
        "effective_amount": "6.1",
        "expiration_height": 2801287,
        "is_controlling": true,
        "reposted": 1,
        "support_amount": "6.0",
        "take_over_height": 698887,
        "trending_global": 0.0,
        "trending_group": 0,
        "trending_local": 0.0,
        "trending_mixed": 0.0
      },
      "name": "test-upload-mp4-converted",
      "normalized_name": "test-upload-mp4-converted",
      "nout": 0,
      "permanent_url": "lbry://test-upload-mp4-converted#ba6042f59b90623a1cca07ce3e7483516f6fca43",
      "short_url": "lbry://test-upload-mp4-converted#b",
      "timestamp": 1578949431,
      "txid": "92fc95d9dc8fc31e67c610c693cc5f2a54254d551a53c433bb1e70cde641ef18",
      "type": "claim",
      "value": {
        "languages": [
          "en"
        ],
        "license": "None",
        "release_time": "1578949342",
        "source": {
          "hash": "bdad33224479a7f755042db37591aeb7cfd9c3ac5c948f632674dea614141762ed82931f006fa3fe1f91122b32aa7ddd",
          "media_type": "video/mp4",
          "name": "test-helpscout.mp4",
          "sd_hash": "49526c867c8ee490e6ea6b1e3279a1e77a639bbe33d9fc48a1a32cc25850e01b1060247f96e243a3dd5922dbc06889cb",
          "size": "2791280"
        },
        "stream_type": "video",
        "thumbnail": {
          "url": "https://spee.ch/2/Qf3YdXlqbDUX4iftIY7P9cw0.png"
        },
        "title": "test",
        "video": {
          "duration": 65,
          "height": 1080,
          "width": 1920
        }
      },
      "value_type": "stream"
    },
    "short_url": "lbry://repost#6",
    "signing_channel": {
      "address": "bUfk4BTi34sFh96LhvyPk5wtyxHXcCp1KL",
      "amount": "0.9",
      "canonical_url": "lbry://@tom+laptop#4",
      "claim_id": "4a3ddf64575bccb1cfc7bc1d648bd1618e858ed3",
      "claim_op": "update",
      "confirmations": 25970,
      "has_signing_key": false,
      "height": 680531,
      "meta": {
        "activation_height": 670755,
        "claims_in_channel": 1,
        "creation_height": 670755,
        "creation_timestamp": 1574445252,
        "effective_amount": "0.9",
        "expiration_height": 2773155,
        "is_controlling": true,
        "reposted": 0,
        "support_amount": "0.0",
        "take_over_height": 670755,
        "trending_global": 0.0,
        "trending_group": 0,
        "trending_local": 0.0,
        "trending_mixed": 0.0
      },
      "name": "@tom+laptop",
      "normalized_name": "@tom+laptop",
      "nout": 0,
      "permanent_url": "lbry://@tom+laptop#4a3ddf64575bccb1cfc7bc1d648bd1618e858ed3",
      "short_url": "lbry://@tom+laptop#4",
      "timestamp": 1576012289,
      "txid": "c5157c9f1d0519718616810bd72eef4c76b52ac71538672315d32754d0623225",
      "type": "claim",
      "value": {
        "cover": {
          "url": "https://spee.ch/4/68f1a89a-b6df-464f-a481-0885b34ffaa5.jpg"
        },
        "public_key": "3056301006072a8648ce3d020106052b8104000a03420004cdcf9cd281b737145a4c3a1e9aa3c89fd8ac853384786b70b7f6301a496bc9433c7ca6338ae135c6ff4b135bafdba461a844d110065b0e8b9727cbfb2864c7c4",
        "public_key_id": "bESKRxkWxTVBWDQZca4y4axT4wHLL8wQ7j",
        "thumbnail": {
          "url": "https://spee.ch/8/85b94654-dbc3-4f54-b054-f1c587379f75.png"
        }
      },
      "value_type": "channel"
    },
    "timestamp": 1579710083,
    "txid": "53062738ecf0c372918aa69c96652ad1a5103e6acefc47e19b3daef2d1a72867",
    "type": "claim",
    "value": {
      "claim_hash": "Q8pvb1GDdD7OB8ocOmKQm/VCYLo="
    },
    "value_type": "repost"
  }
}
tiger5226 commented 4 years ago

We can close this as reposts work fine now in chainquery. We discussed this with @kauffj as well, and chainquery will remain the repo for raw blockchain data. Downstream services based on chainquery data will handle blocking content based on reposts found here.