lbry-sdk APIs

Methods and signatures provided by the lbry-sdk daemon are documented below. To build, download, or run the daemon, see the project README.

You can find the repo for this API on GitHub:

https://github.com/lbryio/lbry

block_show

Get contents of a block

Arguments

  • blockhash
    str
    hash of the block to look up
  • height
    int
    height of the block to look up

Returns

(dict) Requested block

Show contents of the first block.


curl -d'{"method": "block_show", "params": {"height": 1}}' http://localhost:5279/
lbrynet block_show --height=1
requests.post("http://localhost:5279", json={"method": "block_show", "params": {"height": 1}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "bits": "207fffff",
    "chainwork": "0000000000000000000000000000000000000000000000000000000000000004",
    "confirmations": 206,
    "difficulty": 3.051711610163642e-05,
    "hash": "7becced05821dd104a9ab6eef6b2f38c99b0c3878323fc15c1cc611ad91e53e3",
    "height": 1,
    "mediantime": 1556077736,
    "merkleroot": "0eb255bf11da75f13619a3a6362c299ee0922d4fa1fa87feef7cf40d918242d1",
    "nameclaimroot": "0000000000000000000000000000000000000000000000000000000000000001",
    "nextblockhash": "6bcadc6204901c805ec98e656b72191e8742a0bc5d07cc3028689efd4cf80c52",
    "nonce": 3,
    "previousblockhash": "6e3fcf1299d4ec5d79c3a4c91d624a4acf9e2e173d95a1a0504f677669687556",
    "size": 211,
    "target": "7fffff0000000000000000000000000000000000000000000000000000000000",
    "time": 1556077736,
    "tx": [
      "0eb255bf11da75f13619a3a6362c299ee0922d4fa1fa87feef7cf40d918242d1"
    ],
    "version": 536870912,
    "versionHex": "20000000"
  }
}

get

Download stream from a LBRY name.

Arguments

  • uri
    optionalstr
    uri of the content to download
  • file_name
    optionalstr
    specified name for the downloaded file
  • timeout
    optionalint
    download timeout in number of seconds

Returns

{
    "completed": "(bool) true if download is completed",
    "file_name": "(str) name of file",
    "download_directory": "(str) download directory",
    "points_paid": "(float) credit paid to download file",
    "stopped": "(bool) true if download is stopped",
    "stream_hash": "(str) stream hash of file",
    "stream_name": "(str) stream name",
    "suggested_file_name": "(str) suggested file name",
    "sd_hash": "(str) sd hash of file",
    "download_path": "(str) download path of file",
    "mime_type": "(str) mime type of file",
    "key": "(str) key attached to file",
    "total_bytes_lower_bound": "(int) lower bound file size in bytes",
    "total_bytes": "(int) file upper bound size in bytes",
    "written_bytes": "(int) written size in bytes",
    "blobs_completed": "(int) number of fully downloaded blobs",
    "blobs_in_stream": "(int) total blobs on stream",
    "blobs_remaining": "(int) total blobs remaining to download",
    "status": "(str) downloader status",
    "claim_id": "(str) None if claim is not found else the claim id",
    "txid": "(str) None if claim is not found else the transaction id",
    "nout": "(int) None if claim is not found else the transaction output index",
    "outpoint": "(str) None if claim is not found else the tx and output",
    "metadata": "(dict) None if claim is not found else the claim metadata",
    "channel_claim_id": "(str) None if claim is not found or not signed",
    "channel_name": "(str) None if claim is not found or not signed",
    "claim_name": "(str) None if claim is not found else the claim name"
}

Get a file


curl -d'{"method": "get", "params": {"uri": "astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45"}}' http://localhost:5279/
lbrynet get astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45
requests.post("http://localhost:5279", json={"method": "get", "params": {"uri": "astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "blobs_completed": 1,
    "blobs_in_stream": 1,
    "blobs_remaining": 0,
    "channel_claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
    "channel_name": "@channel",
    "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
    "claim_name": "astream",
    "completed": false,
    "download_directory": "/tmp/tmpi5ikthmq",
    "download_path": "/tmp/tmpi5ikthmq/tmpgj4k6kov",
    "file_name": "tmpgj4k6kov",
    "key": "22704f415def3f1a19bc06e98c7d956b",
    "metadata": {
      "source": {
        "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
        "media_type": "application/octet-stream",
        "name": "tmpgj4k6kov",
        "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
        "size": "11"
      }
    },
    "mime_type": "application/octet-stream",
    "nout": 0,
    "outpoint": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201:0",
    "points_paid": 0.0,
    "protobuf": "0163e5f11888e87965a10c5ec2082b2bd3808d19fb7ac4b03623e50c0b4f0f9722fda4bd5bc277abf48c10d2ff230a5585b0cb35ef537e13dc76030f1e3cc2aff62892ccbb0b54b24bd4dace2600841745c1626d3e0a7f0a7d0a20b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9120b746d70676a346b366b6f76180b22186170706c69636174696f6e2f6f637465742d73747265616d323018a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
    "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
    "status": "running",
    "stopped": false,
    "stream_hash": "86db94d08df28799a62cafd24a6afa939fb98c0b5a78edfa14a026b616a99528493a85780a8b1f7eb7cb86c6d1b95707",
    "stream_name": "tmpgj4k6kov",
    "suggested_file_name": "tmpgj4k6kov",
    "total_bytes": 16,
    "total_bytes_lower_bound": 0,
    "tx": null,
    "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
    "written_bytes": 11
  }
}

publish

Create or update a stream claim at a given name (use 'stream create/update' for more control).

Arguments

  • name
    str
    name of the content (can only consist of a-z A-Z 0-9 and -(dash))
  • bid
    optionaldecimal
    amount to back the claim
  • file_path
    optionalstr
    path to file to be associated with name.
  • fee_currency
    optionalstring
    specify fee currency
  • fee_amount
    optionaldecimal
    content download fee
  • fee_address
    optionalstr
    address where to send fee payments, will use value from --claim_address if not provided
  • title
    optionalstr
    title of the publication
  • description
    optionalstr
    description of the publication
  • author
    optionalstr
    author of the publication. The usage for this field is not the same as for channels. The author field is used to credit an author who is not the publisher and is not represented by the channel. For example, a pdf file of 'The Odyssey' has an author of 'Homer' but may by published to a channel such as '@classics', or to no channel at all
  • clear_tags
    optionalbool
    clear existing tags (prior to adding new ones)
  • tags
    optionallist
    add content tags
  • clear_languages
    optionalbool
    clear existing languages (prior to adding new ones)
  • languages
    optionallist
    languages used by the channel, using RFC 5646 format, eg: for English `--languages=en` for Spanish (Spain) `--languages=es-ES` for Spanish (Mexican) `--languages=es-MX` for Chinese (Simplified) `--languages=zh-Hans` for Chinese (Traditional) `--languages=zh-Hant`
  • clear_locations
    optionalbool
    clear existing locations (prior to adding new ones)
  • locations
    optionallist
    locations relevant to the stream, consisting of 2 letter `country` code and a `state`, `city` and a postal `code` along with a `latitude` and `longitude`. for JSON RPC: pass a dictionary with aforementioned attributes as keys, eg: ... "locations": [{'country': 'US', 'state': 'NH'}] ... for command line: pass a colon delimited list with values in the following order: "COUNTRY:STATE:CITY:CODE:LATITUDE:LONGITUDE" making sure to include colon for blank values, for example to provide only the city: ... --locations="::Manchester" with all values set: ... --locations="US:NH:Manchester:03101:42.990605:-71.460989" optionally, you can just pass the "LATITUDE:LONGITUDE": ... --locations="42.990605:-71.460989" finally, you can also pass JSON string of dictionary on the command line as you would via JSON RPC ... --locations="{'country': 'US', 'state': 'NH'}"
  • license
    optionalstr
    publication license
  • license_url
    optionalstr
    publication license url
  • thumbnail_url
    optionalstr
    thumbnail url
  • release_time
    optionalint
    original public release of content, seconds since UNIX epoch
  • width
    optionalint
    image/video width, automatically calculated from media file
  • height
    optionalint
    image/video height, automatically calculated from media file
  • duration
    optionalint
    audio/video duration in seconds, automatically calculated
  • channel_id
    optionalstr
    claim id of the publisher channel
  • channel_name
    optionalstr
    name of publisher channel
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.
  • account_id
    optionalstr
    account to use for funding the transaction
  • claim_address
    optionalstr
    address where the claim is sent to, if not specified it will be determined automatically from the account
  • preview
    optionalbool
    do not broadcast the transaction

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}

Publish a file


curl -d'{"method": "publish", "params": {"name": "a-new-stream", "bid": "1.0", "file_path": "/tmp/tmpvyxdi1iq", "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "channel_account_id": [], "preview": false}}' http://localhost:5279/
lbrynet publish a-new-stream --bid=1.0 --file_path=/tmp/tmpvyxdi1iq
requests.post("http://localhost:5279", json={"method": "publish", "params": {"name": "a-new-stream", "bid": "1.0", "file_path": "/tmp/tmpvyxdi1iq", "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "channel_account_id": [], "preview": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001c53d22a05ad95c9bcd52090e44e21f20c8ff452be512d1b2a1ddb16076fb88d8010000006a47304402202c20d367f2f48a3c53e9ca7d3c72e6056a29659c118f58ffdfbf751f22539cbb02203e1eead006dd154eaed92816d6f1c5fd1f3a5e3adef70396b443c0a8602f4bd4012103c53bcf3c01e87e6a5863c3470a3ddf173cdb21d15c0b3375080595fffd4a13ddffffffff0200e1f50500000000adb50c612d6e65772d73747265616d4c82000a7f0a7d0a20b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9120b746d707679786469316971180b22186170706c69636174696f6e2f6f637465742d73747265616d3230ff2e50fe6d7df07acc4e0870ed9eb08f3e6f0632e1f8db2c2c2ae1e53433111cf5111a7875eac7eb6a06cd6ba9617c746d7576a914ef86396f2580e06f2e6dc9f110981fa669d120c388ace0b46217000000001976a9141362e8c52aab7e128c792d977830f21b3c250c4088ac00000000",
    "inputs": [
      {
        "address": "mqaFJy11HUVjgpEe5ZxxCpB6jvN8RUWSGa",
        "amount": "4.947555",
        "confirmations": 4,
        "height": 215,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "txid": "d888fb7660b1dda1b2d112e52b45ffc8201fe2440e0952cd9b5cd95aa0223dc5",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "n3MSayPMj3TWpgVES4L2RNALm6M94mjvzT",
        "amount": "1.0",
        "claim_id": "43fb98b084e9512c7b2461d03e6cd3ee97d208ba",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "name": "a-new-stream",
        "nout": 0,
        "permanent_url": "a-new-stream#43fb98b084e9512c7b2461d03e6cd3ee97d208ba",
        "txid": "bd9e3a3e420d6ae637bdedaf16d460807d9579e419991de53b7d6660801a7b15",
        "type": "claim",
        "value": {
          "source": {
            "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
            "media_type": "application/octet-stream",
            "name": "tmpvyxdi1iq",
            "sd_hash": "ff2e50fe6d7df07acc4e0870ed9eb08f3e6f0632e1f8db2c2c2ae1e53433111cf5111a7875eac7eb6a06cd6ba9617c74",
            "size": "11"
          }
        },
        "value_type": "stream"
      },
      {
        "address": "mhHTd2xX1grCmrjhFdznRNzZdcrmqphThR",
        "amount": "3.923448",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "txid": "bd9e3a3e420d6ae637bdedaf16d460807d9579e419991de53b7d6660801a7b15",
        "type": "payment"
      }
    ],
    "total_fee": "0.024107",
    "total_input": "4.947555",
    "total_output": "4.923448",
    "txid": "bd9e3a3e420d6ae637bdedaf16d460807d9579e419991de53b7d6660801a7b15"
  }
}

resolve

Get the claim that a URL refers to.

Arguments

  • urls
    optionalstr, list
    one or more urls to resolve

Returns

Dictionary of results, keyed by url
'': {
        If a resolution error occurs:
        'error': Error message

        If the url resolves to a channel or a claim in a channel:
        'certificate': {
            'address': (str) claim address,
            'amount': (float) claim amount,
            'effective_amount': (float) claim amount including supports,
            'claim_id': (str) claim id,
            'claim_sequence': (int) claim sequence number (or -1 if unknown),
            'decoded_claim': (bool) whether or not the claim value was decoded,
            'height': (int) claim height,
            'depth': (int) claim depth,
            'has_signature': (bool) included if decoded_claim
            'name': (str) claim name,
            'permanent_url': (str) permanent url of the certificate claim,
            'supports: (list) list of supports [{'txid': (str) txid,
                                                 'nout': (int) nout,
                                                 'amount': (float) amount}],
            'txid': (str) claim txid,
            'nout': (str) claim nout,
            'signature_is_valid': (bool), included if has_signature,
            'value': ClaimDict if decoded, otherwise hex string
        }

        If the url resolves to a channel:
        'claims_in_channel': (int) number of claims in the channel,

        If the url resolves to a claim:
        'claim': {
            'address': (str) claim address,
            'amount': (float) claim amount,
            'effective_amount': (float) claim amount including supports,
            'claim_id': (str) claim id,
            'claim_sequence': (int) claim sequence number (or -1 if unknown),
            'decoded_claim': (bool) whether or not the claim value was decoded,
            'height': (int) claim height,
            'depth': (int) claim depth,
            'has_signature': (bool) included if decoded_claim
            'name': (str) claim name,
            'permanent_url': (str) permanent url of the claim,
            'channel_name': (str) channel name if claim is in a channel
            'supports: (list) list of supports [{'txid': (str) txid,
                                                 'nout': (int) nout,
                                                 'amount': (float) amount}]
            'txid': (str) claim txid,
            'nout': (str) claim nout,
            'signature_is_valid': (bool), included if has_signature,
            'value': ClaimDict if decoded, otherwise hex string
        }
}

Resolve a claim


curl -d'{"method": "resolve", "params": {"urls": ["astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45"]}}' http://localhost:5279/
lbrynet resolve astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45
requests.post("http://localhost:5279", json={"method": "resolve", "params": {"urls": ["astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45"]}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45": {
      "certificate": {
        "address": "mjHyVVVGzDDNzHwri4hHakXnNX5wjnftZe",
        "amount": "1.0",
        "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "claim_sequence": -1,
        "decoded_claim": true,
        "depth": 7,
        "effective_amount": "1.0",
        "has_signature": false,
        "height": 210,
        "name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "protobuf": "00125a0a583056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc420b4e6577204368616e6e656c",
        "supports": [],
        "txid": "b64ea3e349d0884f7db92012a6b86f921dbd7fcd2b931566331c54494bee0db5",
        "valid_at_height": 210,
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
          "title": "New Channel"
        }
      },
      "claim": {
        "address": "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
        "amount": "1.0",
        "channel_name": "@channel",
        "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "claim_sequence": -1,
        "decoded_claim": true,
        "depth": 3,
        "effective_amount": "1.0",
        "has_signature": true,
        "height": 214,
        "is_channel_signature_valid": true,
        "name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "protobuf": "0163e5f11888e87965a10c5ec2082b2bd3808d19fb7ac4b03623e50c0b4f0f9722fda4bd5bc277abf48c10d2ff230a5585b0cb35ef537e13dc76030f1e3cc2aff62892ccbb0b54b24bd4dace2600841745c1626d3e0a7f0a7d0a20b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9120b746d70676a346b366b6f76180b22186170706c69636174696f6e2f6f637465742d73747265616d323018a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
        "signature_is_valid": true,
        "signing_channel": {
          "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
          "name": "@channel",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
            "title": "New Channel"
          }
        },
        "supports": [],
        "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
        "valid_at_height": 214,
        "value": {
          "source": {
            "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
            "media_type": "application/octet-stream",
            "name": "tmpgj4k6kov",
            "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
            "size": "11"
          }
        }
      },
      "claims_in_channel": 0
    }
  }
}

routing_table_get

Get DHT routing information

Arguments

Returns

(dict) dictionary containing routing and peer information
{
    "buckets": {
        : [
            {
                "address": (str) peer address,
                "udp_port": (int) peer udp port,
                "tcp_port": (int) peer tcp port,
                "node_id": (str) peer node id,
            }
        ]
    },
    "node_id": (str) the local dht node id
}
// example(s) to come later

status

Get daemon status

Arguments

Returns

(dict) lbrynet-daemon status
{
    'installation_id': (str) installation id - base58,
    'is_running': (bool),
    'skipped_components': (list) [names of skipped components (str)],
    'startup_status': { Does not include components which have been skipped
        'blob_manager': (bool),
        'blockchain_headers': (bool),
        'database': (bool),
        'dht': (bool),
        'exchange_rate_manager': (bool),
        'hash_announcer': (bool),
        'peer_protocol_server': (bool),
        'stream_manager': (bool),
        'upnp': (bool),
        'wallet': (bool),
    },
    'connection_status': {
        'code': (str) connection status code,
        'message': (str) connection status message
    },
    'blockchain_headers': {
        'downloading_headers': (bool),
        'download_progress': (float) 0-100.0
    },
    'wallet': {
        'blocks': (int) local blockchain height,
        'blocks_behind': (int) remote_height - local_height,
        'best_blockhash': (str) block hash of most recent block,
        'is_encrypted': (bool),
        'is_locked': (bool),
    },
    'dht': {
        'node_id': (str) lbry dht node id - hex encoded,
        'peers_in_routing_table': (int) the number of peers in the routing table,
    },
    'blob_manager': {
        'finished_blobs': (int) number of finished blobs in the blob manager,
    },
    'hash_announcer': {
        'announce_queue_size': (int) number of blobs currently queued to be announced
    },
    'stream_manager': {
        'managed_files': (int) count of files in the stream manager,
    },
    'upnp': {
        'aioupnp_version': (str),
        'redirects': {
            : (int) external_port,
        },
        'gateway': (str) manufacturer and model,
        'dht_redirect_set': (bool),
        'peer_redirect_set': (bool),
        'external_ip': (str) external ip address,
    }
}

Get status


curl -d'{"method": "status", "params": {}}' http://localhost:5279/
lbrynet status
requests.post("http://localhost:5279", json={"method": "status", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "blob_manager": {
      "finished_blobs": 0
    },
    "connection_status": {
      "code": "connected",
      "message": "No connection problems detected"
    },
    "installation_id": "8C8mbiCN3u9yZchsz6dsdoK6XM67XwxAEd3JHHEWDeJ52S4CMCV6RXUAMFkp9SGvYC",
    "is_running": true,
    "skipped_components": [
      "dht",
      "upnp",
      "hash_announcer",
      "peer_protocol_server"
    ],
    "startup_status": {
      "blob_manager": true,
      "blockchain_headers": true,
      "database": true,
      "exchange_rate_manager": true,
      "stream_manager": true,
      "wallet": true
    },
    "stream_manager": {
      "managed_files": 0
    },
    "wallet": {
      "best_blockhash": "412f3019be1d8b31676eacd2bb48a63dff080178c070c51062daf62ea2fcbec8",
      "blocks": 206,
      "blocks_behind": 0,
      "is_encrypted": false,
      "is_locked": false
    }
  }
}

stop

Stop lbrynet API server.

Arguments

Returns

(string) Shutdown message
// example(s) to come later

version

Get lbrynet API server version information

Arguments

Returns

(dict) Dictionary of lbry version information
{
    'build': (str) build type (e.g. "dev", "rc", "release"),
    'ip': (str) remote ip, if available,
    'lbrynet_version': (str) lbrynet_version,
    'lbryum_version': (str) lbryum_version,
    'lbryschema_version': (str) lbryschema_version,
    'os_release': (str) os release string
    'os_system': (str) os name
    'platform': (str) platform string
    'processor': (str) processor type,
    'python_version': (str) python version,
}

Get version


curl -d'{"method": "version", "params": {}}' http://localhost:5279/
lbrynet version
requests.post("http://localhost:5279", json={"method": "version", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "build": "dev",
    "desktop": "GNOME",
    "distro": {
      "codename": "xenial",
      "id": "ubuntu",
      "like": "debian",
      "version": "16.04",
      "version_parts": {
        "build_number": "",
        "major": "16",
        "minor": "04"
      }
    },
    "lbrynet_version": "0.36.0rc4",
    "os_release": "4.4.0-116-generic",
    "os_system": "Linux",
    "platform": "Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial",
    "processor": "x86_64",
    "python_version": "3.7.2"
  }
}

account_add

Add a previously created account from a seed, private key or public key (read-only). Specify --single_key for single address or vanity address accounts.

Arguments

  • account_name
    str
    name of the account to add
  • seed
    optionalstr
    seed to generate new account from
  • private_key
    optionalstr
    private key for new account
  • public_key
    optionalstr
    public key for new account
  • single_key
    optionalbool
    create single key account, default is multi-key

Returns

{
    "id": "account_id",
    "is_default": "this account is used by default",
    "ledger": "name of crypto currency and network",
    "name": "optional account name",
    "seed": "human friendly words from which account can be recreated",
    "encrypted": "if account is encrypted",
    "private_key": "extended private key",
    "public_key": "extended public key",
    "address_generator": "settings for generating addresses",
    "modified_on": "date of last modification to account settings"
}

Add an account from seed


curl -d'{"method": "account_add", "params": {"account_name": "new account", "seed": "oval warfare name inquiry vintage clerk offer easily breeze early upon shrug", "single_key": false}}' http://localhost:5279/
lbrynet account add "new account" --seed="oval warfare name inquiry vintage clerk offer easily breeze early upon shrug"
requests.post("http://localhost:5279", json={"method": "account_add", "params": {"account_name": "new account", "seed": "oval warfare name inquiry vintage clerk offer easily breeze early upon shrug", "single_key": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "address_generator": {
      "change": {
        "gap": 6,
        "maximum_uses_per_address": 1
      },
      "name": "deterministic-chain",
      "receiving": {
        "gap": 20,
        "maximum_uses_per_address": 1
      }
    },
    "encrypted": false,
    "id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1556077739.3577678,
    "name": "new account",
    "private_key": "tprv8ZgxMBicQKsPf7bahVCyKG7SuA1qV4LtGZM21Ddbz5cNPu2Jk8XEsJjfdgd1aw83z7JciiwvhHThShpBxKgiKg1byptgMx6pKfWqoHdsjhm",
    "public_key": "tpubD6NzVbkrYhZ4YadNb8sZifmZUBXmePXnqrwoHjfuQMQmEPH5NXLq3oMXoo9hkZqq2WgP5bC4H6xrwyuPYeF1B8ftAak8DMtGkkZ5RuxTpRQ",
    "seed": "oval warfare name inquiry vintage clerk offer easily breeze early upon shrug"
  }
}

account_balance

Return the balance of an account

Arguments

  • account_id
    optionalstr
    If provided only the balance for this account will be given. Otherwise default account.
  • confirmations
    optionalint
    Only include transactions with this many confirmed blocks.

Returns

(decimal) amount of lbry credits in wallet

Get default account balance


curl -d'{"method": "account_balance", "params": {}}' http://localhost:5279/
lbrynet account balance
requests.post("http://localhost:5279", json={"method": "account_balance", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": "7.999876"
}

Get balance for specific account by id


curl -d'{"method": "account_balance", "params": {"account_id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz"}}' http://localhost:5279/
lbrynet account balance "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz"
requests.post("http://localhost:5279", json={"method": "account_balance", "params": {"account_id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": "2.0"
}

account_create

Create a new account. Specify --single_key if you want to use the same address for all transactions (not recommended).

Arguments

  • account_name
    str
    name of the account to create
  • single_key
    optionalbool
    create single key account, default is multi-key

Returns

{
    "id": "account_id",
    "is_default": "this account is used by default",
    "ledger": "name of crypto currency and network",
    "name": "optional account name",
    "seed": "human friendly words from which account can be recreated",
    "encrypted": "if account is encrypted",
    "private_key": "extended private key",
    "public_key": "extended public key",
    "address_generator": "settings for generating addresses",
    "modified_on": "date of last modification to account settings"
}

Create an account


curl -d'{"method": "account_create", "params": {"account_name": "generated account", "single_key": false}}' http://localhost:5279/
lbrynet account create "generated account"
requests.post("http://localhost:5279", json={"method": "account_create", "params": {"account_name": "generated account", "single_key": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "address_generator": {
      "change": {
        "gap": 6,
        "maximum_uses_per_address": 1
      },
      "name": "deterministic-chain",
      "receiving": {
        "gap": 20,
        "maximum_uses_per_address": 1
      }
    },
    "encrypted": false,
    "id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1556077739.1657531,
    "name": "generated account",
    "private_key": "tprv8ZgxMBicQKsPf7bahVCyKG7SuA1qV4LtGZM21Ddbz5cNPu2Jk8XEsJjfdgd1aw83z7JciiwvhHThShpBxKgiKg1byptgMx6pKfWqoHdsjhm",
    "public_key": "tpubD6NzVbkrYhZ4YadNb8sZifmZUBXmePXnqrwoHjfuQMQmEPH5NXLq3oMXoo9hkZqq2WgP5bC4H6xrwyuPYeF1B8ftAak8DMtGkkZ5RuxTpRQ",
    "seed": "oval warfare name inquiry vintage clerk offer easily breeze early upon shrug"
  }
}

account_decrypt

Decrypt an encrypted account, this will remove the wallet password. The account must be unlocked to decrypt it

Arguments

  • account_id
    optionalstr
    id for the account to decrypt

Returns

(bool) true if wallet is decrypted, otherwise false
// example(s) to come later

account_encrypt

Encrypt an unencrypted account with a password

Arguments

  • new_password
    str
    password to encrypt account
  • account_id
    optionalstr
    id for the account to encrypt, encrypts default account if not provided

Returns

(bool) true if wallet is decrypted, otherwise false
// example(s) to come later

account_fund

Transfer some amount (or --everything) to an account from another account (can be the same account). Amounts are interpreted as LBC. You can also spread the transfer across a number of --outputs (cannot be used together with --everything).

Arguments

  • to_account
    optionalstr
    send to this account
  • from_account
    optionalstr
    spend from this account
  • amount
    str
    the amount to transfer lbc
  • everything
    optionalbool
    transfer everything (excluding claims), default: false.
  • outputs
    optionalint
    split payment across many outputs, default: 1.
  • broadcast
    optionalbool
    actually broadcast the transaction, default: false.

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}

Transfer 2 LBC from default account to specific account


curl -d'{"method": "account_fund", "params": {"to_account": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz", "amount": "2.0", "everything": false, "broadcast": true}}' http://localhost:5279/
lbrynet account fund --to_account="mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz" --amount=2.0 --broadcast
requests.post("http://localhost:5279", json={"method": "account_fund", "params": {"to_account": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz", "amount": "2.0", "everything": false, "broadcast": true}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001cf0a008ff3b57b494a3b7839783a85fbf72c1929cbf44ef7d224528ea7fc00a1000000006b483045022100b7c9b672c053f5b197a9f727aa8981eacdacca388ff82e2640c6b3b41606aa2502200ca329fc549cf5fb32a936d5f208a8253726ea05356b0f32aebc60a1aa0f9e590121023940fdcd842ea987a2acb00a292045db7e14eec4f0712cd40031dd9d959862dcffffffff0200c2eb0b000000001976a914a9cd1eaa01ac5caf8891cd6f337152e5234d7bce88ac90d7ae2f000000001976a9141c1171066ceee286872b30ffd3edd1d40c1116f688ac00000000",
    "inputs": [
      {
        "address": "mrg98LNnLLsoGqmrCi69mGoqtU4PizWtx3",
        "amount": "10.0",
        "confirmations": 6,
        "height": 201,
        "is_change": false,
        "is_mine": true,
        "nout": 0,
        "txid": "a100fca78e5224d2f74ef4cb29192cf7fb853a7839783b4a497bb5f38f000acf",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mvznDSoPZGY6PonmBdC9e7JwXGGdy4g6w8",
        "amount": "2.0",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "txid": "eb74d8df69334bb492848f9dedb7255e72b686ba91e60568f3a3db49522110ae",
        "type": "payment"
      },
      {
        "address": "mi5N7HKhPix6pQEhqFkjC3525Ffqg1BCoP",
        "amount": "7.999876",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "txid": "eb74d8df69334bb492848f9dedb7255e72b686ba91e60568f3a3db49522110ae",
        "type": "payment"
      }
    ],
    "total_fee": "0.000124",
    "total_input": "10.0",
    "total_output": "9.999876",
    "txid": "eb74d8df69334bb492848f9dedb7255e72b686ba91e60568f3a3db49522110ae"
  }
}

Spread LBC between multiple addresses


curl -d'{"method": "account_fund", "params": {"to_account": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz", "from_account": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz", "amount": "1.5", "everything": false, "outputs": 2, "broadcast": true}}' http://localhost:5279/
lbrynet account fund --to_account="mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz" --from_account="mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz" --amount=1.5 --outputs=2 --broadcast
requests.post("http://localhost:5279", json={"method": "account_fund", "params": {"to_account": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz", "from_account": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz", "amount": "1.5", "everything": false, "outputs": 2, "broadcast": true}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001ae10215249dba3f36805e691ba86b6725e25b7ed9d8f8492b44b3369dfd874eb000000006a47304402207c7beab511858462243bd0f6eedc9a450ff5961f4b8fca699073e8a4227c4c68022014b7ff75186247c0acc6110ef79e2159999b6db0fea23ce2702bd4784afce7bd0121033375f3d6b6704f4ef17c551b5acd8734b4d1966b95782d6c179aad8600b5dcd2ffffffff03c0687804000000001976a91436b1657ce376c78bddef6cc9eb8e9c48cfebef6588acc0687804000000001976a91436b1657ce376c78bddef6cc9eb8e9c48cfebef6588ac6cb9fa02000000001976a914ece85ac4638c1c0a9b057387bf6c0f76d2f53b2d88ac00000000",
    "inputs": [
      {
        "address": "mvznDSoPZGY6PonmBdC9e7JwXGGdy4g6w8",
        "amount": "2.0",
        "confirmations": 1,
        "height": 207,
        "is_change": true,
        "is_mine": true,
        "nout": 0,
        "txid": "eb74d8df69334bb492848f9dedb7255e72b686ba91e60568f3a3db49522110ae",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mkW9J8gxRqhwbDx1gK4B3Sc3o6FDcf3goy",
        "amount": "0.75",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "txid": "edbe5ed65722464fce72de7f343f10abd8b0071c3fc9b293b4ecf9d8647683ef",
        "type": "payment"
      },
      {
        "address": "mkW9J8gxRqhwbDx1gK4B3Sc3o6FDcf3goy",
        "amount": "0.75",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "txid": "edbe5ed65722464fce72de7f343f10abd8b0071c3fc9b293b4ecf9d8647683ef",
        "type": "payment"
      },
      {
        "address": "n37c7byRyphXt3AGqDMDyGPJYYVYK9y4fo",
        "amount": "0.499859",
        "confirmations": -2,
        "height": -2,
        "nout": 2,
        "txid": "edbe5ed65722464fce72de7f343f10abd8b0071c3fc9b293b4ecf9d8647683ef",
        "type": "payment"
      }
    ],
    "total_fee": "0.000141",
    "total_input": "2.0",
    "total_output": "1.999859",
    "txid": "edbe5ed65722464fce72de7f343f10abd8b0071c3fc9b293b4ecf9d8647683ef"
  }
}

Transfer all LBC to a specified account


curl -d'{"method": "account_fund", "params": {"from_account": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz", "everything": true, "broadcast": true}}' http://localhost:5279/
lbrynet account fund --from_account="mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz" --everything --broadcast
requests.post("http://localhost:5279", json={"method": "account_fund", "params": {"from_account": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz", "everything": true, "broadcast": true}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000003ef837664d8f9ecb493b2c93f1c07b0d8ab103f347fde72ce4f462257d65ebeed020000006b483045022100aac50a3cab18e533be58da3e7bf7166e1ff2d096d90ddce5d6d6704127822e0b02203eda14f3a269808025d3ed6d882f5d82aced9e35fbcfab322bbf601082c19588012102c6014823dcf0b1b46eddc364677bad1270b26b41c4da78331b65371d12244f8dffffffffef837664d8f9ecb493b2c93f1c07b0d8ab103f347fde72ce4f462257d65ebeed000000006a47304402205dc26134270561193c31196baf620b30f888b3d4dc497ac96051a65135252580022039826749346dec65c6206408b1d9281761376e38154606b03e4384307cbb1c2a01210304090a288111952625f97f9f450cbcb4abc3a61067909a8c39192c51c9d2ce99ffffffffef837664d8f9ecb493b2c93f1c07b0d8ab103f347fde72ce4f462257d65ebeed010000006a473044022019ea77268e69a6514fcdc744c8793cbcccff115ae0832cb4c80d7419a6724d9b022065daf165f9cd4966e9f27ab02294f019aed466bc51e426fa1e7e24c95f04663901210304090a288111952625f97f9f450cbcb4abc3a61067909a8c39192c51c9d2ce99ffffffff015027eb0b000000001976a914b3189b39617295883f901eeaedd7df16c733340688ac00000000",
    "inputs": [
      {
        "address": "n37c7byRyphXt3AGqDMDyGPJYYVYK9y4fo",
        "amount": "0.499859",
        "confirmations": 1,
        "height": 208,
        "is_change": true,
        "is_mine": true,
        "nout": 2,
        "txid": "edbe5ed65722464fce72de7f343f10abd8b0071c3fc9b293b4ecf9d8647683ef",
        "type": "payment"
      },
      {
        "address": "mkW9J8gxRqhwbDx1gK4B3Sc3o6FDcf3goy",
        "amount": "0.75",
        "confirmations": 1,
        "height": 208,
        "is_change": true,
        "is_mine": true,
        "nout": 0,
        "txid": "edbe5ed65722464fce72de7f343f10abd8b0071c3fc9b293b4ecf9d8647683ef",
        "type": "payment"
      },
      {
        "address": "mkW9J8gxRqhwbDx1gK4B3Sc3o6FDcf3goy",
        "amount": "0.75",
        "confirmations": 1,
        "height": 208,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "txid": "edbe5ed65722464fce72de7f343f10abd8b0071c3fc9b293b4ecf9d8647683ef",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mwqvj53DdW9NFvzNHSSiC5bXBMmrLgo2ab",
        "amount": "1.999604",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "txid": "059938a2b6a9cf8e6fe06eb60a6f2c35b378818a6aa700b891017f5b8b1f5abc",
        "type": "payment"
      }
    ],
    "total_fee": "0.000255",
    "total_input": "1.999859",
    "total_output": "1.999604",
    "txid": "059938a2b6a9cf8e6fe06eb60a6f2c35b378818a6aa700b891017f5b8b1f5abc"
  }
}

account_list

List details of all of the accounts or a specific account.

Arguments

  • account_id
    optionalstr
    If provided only the balance for this account will be given
  • confirmations
    optionalint
    required confirmations (default: 0)
  • include_claims
    optionalbool
    include claims, requires than a LBC account is specified (default: false)
  • show_seed
    optionalbool
    show the seed for the account

Returns

[
    {
        "id": "account_id",
        "is_default": "this account is used by default",
        "ledger": "name of crypto currency and network",
        "name": "optional account name",
        "seed": "human friendly words from which account can be recreated",
        "encrypted": "if account is encrypted",
        "private_key": "extended private key",
        "public_key": "extended public key",
        "address_generator": "settings for generating addresses",
        "modified_on": "date of last modification to account settings"
    }
]

List your accounts


curl -d'{"method": "account_list", "params": {"include_claims": false, "show_seed": false}}' http://localhost:5279/
lbrynet account list
requests.post("http://localhost:5279", json={"method": "account_list", "params": {"include_claims": false, "show_seed": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "lbc_regtest": [
      {
        "address_generator": {
          "change": {
            "gap": 6,
            "maximum_uses_per_address": 1
          },
          "name": "deterministic-chain",
          "receiving": {
            "gap": 20,
            "maximum_uses_per_address": 1
          }
        },
        "certificates": 0,
        "coins": 10.0,
        "encrypted": false,
        "id": "mnmhSLyxSMttxYe3Xrc84DtwPb6dT3rQCv",
        "is_default": true,
        "name": "Account #mnmhSLyxSMttxYe3Xrc84DtwPb6dT3rQCv",
        "public_key": "tpubD6NzVbkrYhZ4YJE8wjGviPB6Kz4AGo8Co6pCCNfd4ds18CApbPNDn4H6jXcNJtdo88f3CyQYuYqyErC6pJs7ZfFPWfhiz3jbq4zNu2njJMb",
        "satoshis": 1000000000
      }
    ]
  }
}

account_lock

Lock an unlocked account

Arguments

  • account_id
    optionalstr
    id for the account to lock

Returns

(bool) true if account is locked, otherwise false
// example(s) to come later

account_max_address_gap

Finds ranges of consecutive addresses that are unused and returns the length of the longest such range: for change and receiving address chains. This is useful to figure out ideal values to set for 'receiving_gap' and 'change_gap' account settings.

Arguments

  • account_id
    str
    account for which to get max gaps

Returns

(map) maximum gap for change and receiving addresses
// example(s) to come later

account_remove

Remove an existing account.

Arguments

  • account_id
    str
    id of the account to remove

Returns

{
    "id": "account_id",
    "is_default": "this account is used by default",
    "ledger": "name of crypto currency and network",
    "name": "optional account name",
    "seed": "human friendly words from which account can be recreated",
    "encrypted": "if account is encrypted",
    "private_key": "extended private key",
    "public_key": "extended public key",
    "address_generator": "settings for generating addresses",
    "modified_on": "date of last modification to account settings"
}

Remove an account


curl -d'{"method": "account_remove", "params": {"account_id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz"}}' http://localhost:5279/
lbrynet account remove mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz
requests.post("http://localhost:5279", json={"method": "account_remove", "params": {"account_id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "address_generator": {
      "change": {
        "gap": 6,
        "maximum_uses_per_address": 1
      },
      "name": "deterministic-chain",
      "receiving": {
        "gap": 20,
        "maximum_uses_per_address": 1
      }
    },
    "encrypted": false,
    "id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1556077739.1657531,
    "name": "generated account",
    "private_key": "tprv8ZgxMBicQKsPf7bahVCyKG7SuA1qV4LtGZM21Ddbz5cNPu2Jk8XEsJjfdgd1aw83z7JciiwvhHThShpBxKgiKg1byptgMx6pKfWqoHdsjhm",
    "public_key": "tpubD6NzVbkrYhZ4YadNb8sZifmZUBXmePXnqrwoHjfuQMQmEPH5NXLq3oMXoo9hkZqq2WgP5bC4H6xrwyuPYeF1B8ftAak8DMtGkkZ5RuxTpRQ",
    "seed": "oval warfare name inquiry vintage clerk offer easily breeze early upon shrug"
  }
}

account_send

Send the same number of credits to multiple addresses.

Arguments

  • account_id
    optionalstr
    account to fund the transaction
  • preview
    optionalbool
    do not broadcast the transaction

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}
// example(s) to come later

account_set

Change various settings on an account.

Arguments

  • account_id
    str
    id of the account to change
  • default
    optionalbool
    make this account the default
  • new_name
    optionalstr
    new name for the account
  • receiving_gap
    optionalint
    set the gap for receiving addresses
  • receiving_max_uses
    optionalint
    set the maximum number of times to use a receiving address
  • change_gap
    optionalint
    set the gap for change addresses
  • change_max_uses
    optionalint
    set the maximum number of times to use a change address

Returns

{
    "id": "account_id",
    "is_default": "this account is used by default",
    "ledger": "name of crypto currency and network",
    "name": "optional account name",
    "seed": "human friendly words from which account can be recreated",
    "encrypted": "if account is encrypted",
    "private_key": "extended private key",
    "public_key": "extended public key",
    "address_generator": "settings for generating addresses",
    "modified_on": "date of last modification to account settings"
}

Modify maximum number of times a change address can be reused


curl -d'{"method": "account_set", "params": {"account_id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz", "default": false, "change_max_uses": 10}}' http://localhost:5279/
lbrynet account set mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz --change_max_uses=10
requests.post("http://localhost:5279", json={"method": "account_set", "params": {"account_id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz", "default": false, "change_max_uses": 10}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "address_generator": {
      "change": {
        "gap": 6,
        "maximum_uses_per_address": 10
      },
      "name": "deterministic-chain",
      "receiving": {
        "gap": 20,
        "maximum_uses_per_address": 1
      }
    },
    "encrypted": false,
    "id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1556077739.4119582,
    "name": "new account",
    "private_key": "tprv8ZgxMBicQKsPf7bahVCyKG7SuA1qV4LtGZM21Ddbz5cNPu2Jk8XEsJjfdgd1aw83z7JciiwvhHThShpBxKgiKg1byptgMx6pKfWqoHdsjhm",
    "public_key": "tpubD6NzVbkrYhZ4YadNb8sZifmZUBXmePXnqrwoHjfuQMQmEPH5NXLq3oMXoo9hkZqq2WgP5bC4H6xrwyuPYeF1B8ftAak8DMtGkkZ5RuxTpRQ",
    "seed": "oval warfare name inquiry vintage clerk offer easily breeze early upon shrug"
  }
}

account_unlock

Unlock an encrypted account

Arguments

  • password
    str
    password to use for unlocking
  • account_id
    optionalstr
    id for the account to unlock, unlocks default account if not provided

Returns

(bool) true if account is unlocked, otherwise false
// example(s) to come later

address_is_mine

Checks if an address is associated with the current wallet.

Arguments

  • address
    str
    address to check
  • account_id
    optionalstr
    id of the account to use

Returns

(bool) true, if address is associated with current wallet

Check if address is mine


curl -d'{"method": "address_is_mine", "params": {"address": "mrWPQx8YZVPkM4Ri4JhpC2Cu6bHV1xyRXH"}}' http://localhost:5279/
lbrynet address is_mine mrWPQx8YZVPkM4Ri4JhpC2Cu6bHV1xyRXH
requests.post("http://localhost:5279", json={"method": "address_is_mine", "params": {"address": "mrWPQx8YZVPkM4Ri4JhpC2Cu6bHV1xyRXH"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": true
}

address_list

List account addresses

Arguments

  • account_id
    optionalstr
    id of the account to use
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

{
    "page": "Page number of the current items.",
    "page_size": "Number of items to show on a page.",
    "total_pages": "Total number of pages.",
    "items": [
        "an address in base58"
    ]
}

List addresses in default account


curl -d'{"method": "address_list", "params": {}}' http://localhost:5279/
lbrynet address list
requests.post("http://localhost:5279", json={"method": "address_list", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": [
    "mvWP7gJXqukpvDj797FrYYKBAA9jHDdxUC",
    "mn9r8mkpX8xLGqDgzW4jGYJDAXxD4yvTbP",
    "mi5N7HKhPix6pQEhqFkjC3525Ffqg1BCoP",
    "mjMaV9KtYq1A1Wquyv8XoB2ZTGvUBiQDzD",
    "mhHTd2xX1grCmrjhFdznRNzZdcrmqphThR",
    "mwqvj53DdW9NFvzNHSSiC5bXBMmrLgo2ab",
    "mrg98LNnLLsoGqmrCi69mGoqtU4PizWtx3",
    "mrWPQx8YZVPkM4Ri4JhpC2Cu6bHV1xyRXH",
    "mjHyVVVGzDDNzHwri4hHakXnNX5wjnftZe",
    "mtdnA7zf8HKjhkuP9TZYQBDH1LF8P7sLod",
    "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
    "n4kXKwXvgiKo94kxBCWNzDEPu1oefb7eKn",
    "n1Sh8ukFDJMWDMiychK8YnAun9fjWp558Z",
    "mx17rDC8WsYLF17x9MqDk79GFiUD3fbCeG",
    "muR85zXcc4yCAkHNGeUgcX19eWSMuDD3WZ",
    "mz74dVVxyxKLMnWcYo9F6QuJSfaQxtgQYS",
    "n3MSayPMj3TWpgVES4L2RNALm6M94mjvzT",
    "mt9aRtrZHuRQpiVRp1JRaF5pQxU6SWGXXS",
    "mzxCeZ4KmAzUs9R4pmRHF36Z5f6v7EdNTH",
    "mgs3ruJfNZKg9QHgRB9HhDo6FLwpu5SPxj",
    "miWsYUnWddxGq5jCu7HU1XfmRhk6Vnox8H",
    "n28rB5iBxTC8YLXxcMiN4DKKfFM2PVRcnf",
    "msDuX39wHvf9STk7v9WAAYQvoGVuxH7UVs",
    "mjgwtJPVRdGw6Uk9AS3xhUYaC3ZFdgyKyz",
    "mgPETWJGDco8GkwDB4rb9uEWWTbq68YsFT",
    "mjdgqTYBkT9PZyV6kT54XsjimscxvVoPma",
    "mqeDC3NSUNE9qKA29h71gyFtfVxJGi46Bj"
  ]
}

List addresses in specified account


curl -d'{"method": "address_list", "params": {"account_id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz"}}' http://localhost:5279/
lbrynet address list --account_id="mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz"
requests.post("http://localhost:5279", json={"method": "address_list", "params": {"account_id": "mz4TwuwbWnzfhRtaaMNkaXWV5L1ttYoghz"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": [
    "n3N4XaE5UcJf6N983m3quYRjaevhMkyUCr",
    "muqzKjP1jYumPouqo21orCuMM7Mkd2viMF",
    "n37c7byRyphXt3AGqDMDyGPJYYVYK9y4fo",
    "mqfHP3RtjBJQZrGPXmVo96gJQcpkhEa8Wu",
    "mvznDSoPZGY6PonmBdC9e7JwXGGdy4g6w8",
    "mn3n9G7w6H5Md8PfT98twcfpv6k85c9Y1K",
    "mwACUH7ey6SxBew3GgaDdVez3CcQAmd2YF",
    "mnjnhEjbWYerFbDxLgiotrDy3WYxMTCx1x",
    "n2mxg9SWScnTstPeDAkN4kJhu3YQR7oT5p",
    "mpt2mWUAGeCj9dqzQgG95ZCib8R7ry9eT6",
    "n4FaAGtax6YQbEX7bDg6gRHAdqQuMHEdNm",
    "n487FhLZbagNXuqzFUFAFX1ojRtVwvoCY1",
    "mtPfQKZZkhpBQyahpTj7HGS3ufs9oEqfdN",
    "mp8zKu4w2PWhZ487oqdPwGfBzxqYr697oQ",
    "mroUpGMkGprMmG77GWVX1wckkjZnEiaQYQ",
    "mihpYFEyCy37qy6FFnsji1azcQyFkrrdqf",
    "mrZxxBqJF8jxGPEQnpeRu3f1XqmYSFgvUx",
    "mjJLYZmF4LBCpXxdP6z3dw5kUfEMcBMw5r",
    "mqssoWbigFig4xNFWTnnoPtcMN3eTLF9c3",
    "mobVo8Jj3kWbdG5JAVpWwnyGM8azKXWsfM",
    "mhPpDa3sk6QpaDg24jFdYsMWLC1LjwSeNG",
    "n2Qyaq8Dsez6x1Q69h3HxgfGCJPx1FTE9a",
    "myKt1b4WgGMhQhq2JN76mwKjhySs6c8N8H",
    "moVpyEgQq2zD1vXroarYPd5PqQ49AF6yno",
    "n1vaCuP8j5YzNDMUPKSuJ99SGR4zwm2jBi",
    "n1QgsFoq84LBfoQbghxsBs51CpKxHfYGsH"
  ]
}

address_unused

Return an address containing no balance, will create a new address if there is none.

Arguments

  • account_id
    optionalstr
    id of the account to use

Returns

"an address in base58"

Get an unused address


curl -d'{"method": "address_unused", "params": {}}' http://localhost:5279/
lbrynet address unused
requests.post("http://localhost:5279", json={"method": "address_unused", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": "mrWPQx8YZVPkM4Ri4JhpC2Cu6bHV1xyRXH"
}

blob_announce

Announce blobs to the DHT

Arguments

  • blob_hash
    optionalstr
    announce a blob, specified by blob_hash
  • stream_hash
    optionalstr
    announce all blobs associated with stream_hash
  • sd_hash
    optionalstr
    announce all blobs associated with sd_hash and the sd_hash itself

Returns

(bool) true if successful
// example(s) to come later

blob_delete

Delete a blob

Arguments

  • blob_hash
    str
    blob hash of the blob to delete

Returns

(str) Success/fail message

Delete a blob


curl -d'{"method": "blob_delete", "params": {"blob_hash": "90c4ecd1d28cb3a89c98a2fc8c90af4e0ee35e001a78639decdd8c4240a376337f86c4c4c68b08742a797d71d669f9d4"}}' http://localhost:5279/
lbrynet blob delete 90c4ecd1d28cb3a89c98a2fc8c90af4e0ee35e001a78639decdd8c4240a376337f86c4c4c68b08742a797d71d669f9d4
requests.post("http://localhost:5279", json={"method": "blob_delete", "params": {"blob_hash": "90c4ecd1d28cb3a89c98a2fc8c90af4e0ee35e001a78639decdd8c4240a376337f86c4c4c68b08742a797d71d669f9d4"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": "Deleted 90c4ecd1d28cb3a89c98a2fc8c90af4e0ee35e001a78639decdd8c4240a376337f86c4c4c68b08742a797d71d669f9d4"
}

blob_get

Download and return a blob

Arguments

  • blob_hash
    str
    blob hash of the blob to get
  • timeout
    optionalint
    timeout in number of seconds

Returns

(str) Success/Fail message or (dict) decoded data
// example(s) to come later

blob_list

Returns blob hashes. If not given filters, returns all blobs known by the blob manager

Arguments

  • needed
    optionalbool
    only return needed blobs
  • finished
    optionalbool
    only return finished blobs
  • uri
    optionalstr
    filter blobs by stream in a uri
  • stream_hash
    optionalstr
    filter blobs by stream hash
  • sd_hash
    optionalstr
    filter blobs by sd hash
  • page_size
    optionalint
    results page size
  • page
    optionalint
    page of results to return

Returns

(list) List of blob hashes

List your local blobs


curl -d'{"method": "blob_list", "params": {"needed": false, "finished": false}}' http://localhost:5279/
lbrynet blob list
requests.post("http://localhost:5279", json={"method": "blob_list", "params": {"needed": false, "finished": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": [
    "90c4ecd1d28cb3a89c98a2fc8c90af4e0ee35e001a78639decdd8c4240a376337f86c4c4c68b08742a797d71d669f9d4",
    "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
    "35d91c4edf495755035bb2848534aa39c9ad6be074f80372349c6aed57e1edba29975b778d35f3e0fbd9882f3454305d",
    "e5fb7b385911032a032d3540b6c738c20cbd4c3b7d87f01bff68abf408f92edc1e7bf1537956b3b6ed9094bca75519d5"
  ]
}

blob_reflect

Reflects specified blobs

Arguments

  • reflector_server
    optionalstr
    reflector address

Returns

(list) reflected blob hashes
// example(s) to come later

blob_reflect_all

Reflects all saved blobs

Arguments

Returns

(bool) true if successful
// example(s) to come later

channel_abandon

Abandon one of my channel claims.

Arguments

  • claim_id
    optionalstr
    claim_id of the claim to abandon
  • txid
    optionalstr
    txid of the claim to abandon
  • nout
    optionalint
    nout of the claim to abandon
  • account_id
    optionalstr
    id of the account to use
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until abandon is in mempool

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}

Abandon a channel claim


curl -d'{"method": "channel_abandon", "params": {"claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563", "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet channel abandon fb198d80d32b2b08c25e0ca16579e88818f1e563
requests.post("http://localhost:5279", json={"method": "channel_abandon", "params": {"claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563", "preview": false, "blocking": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001b50dee4b49541c336615932bcd7fbd1d926fb8a61220b97d4f88d049e3a34eb6000000006a47304402201d60efcb799dbe41c9c2b782d668965de3bbc7a4c0fe6505159d3b5ee68ad44902206b353dbd5562fdefcd814065511d05ff99a3bbf7724f172dad97dca2413518f6012103a7e63c58505e43a111503f473056687afeddac27e6b6b2f7ced7eecf1fa00569ffffffff0134b7f505000000001976a9142a1a8dee7c2717e3fee28aaa9e2da8935f362bd288ac00000000",
    "inputs": [
      {
        "address": "mjHyVVVGzDDNzHwri4hHakXnNX5wjnftZe",
        "amount": "1.0",
        "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "claim_op": "update",
        "confirmations": 8,
        "height": 210,
        "is_change": false,
        "is_mine": true,
        "name": "@channel",
        "nout": 0,
        "permanent_url": "@channel#fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "txid": "b64ea3e349d0884f7db92012a6b86f921dbd7fcd2b931566331c54494bee0db5",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
          "title": "New Channel"
        },
        "value_type": "channel"
      }
    ],
    "outputs": [
      {
        "address": "mjMaV9KtYq1A1Wquyv8XoB2ZTGvUBiQDzD",
        "amount": "0.999893",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "txid": "56b1417260af2654f5a13cb85474b00d61ffa22b076ebb91c62d9ecaa0ada875",
        "type": "payment"
      }
    ],
    "total_fee": "0.000107",
    "total_input": "1.0",
    "total_output": "0.999893",
    "txid": "56b1417260af2654f5a13cb85474b00d61ffa22b076ebb91c62d9ecaa0ada875"
  }
}

channel_create

Create a new channel by generating a channel private key and establishing an '@' prefixed claim.

Arguments

  • name
    str
    name of the channel prefixed with '@'
  • allow_duplicate_name
    optionalbool
    create new channel even if one already exists with given name. default: false.
  • bid
    decimal
    amount to back the claim
  • title
    optionalstr
    title of the publication
  • description
    optionalstr
    description of the publication
  • featured
    optionallist
    claim_ids of featured content in channel
  • tags
    optionallist
    content tags
  • languages
    optionallist
    languages used by the channel, using RFC 5646 format, eg: for English `--languages=en` for Spanish (Spain) `--languages=es-ES` for Spanish (Mexican) `--languages=es-MX` for Chinese (Simplified) `--languages=zh-Hans` for Chinese (Traditional) `--languages=zh-Hant`
  • locations
    optionallist
    locations of the channel, consisting of 2 letter `country` code and a `state`, `city` and a postal `code` along with a `latitude` and `longitude`. for JSON RPC: pass a dictionary with aforementioned attributes as keys, eg: ... "locations": [{'country': 'US', 'state': 'NH'}] ... for command line: pass a colon delimited list with values in the following order: "COUNTRY:STATE:CITY:CODE:LATITUDE:LONGITUDE" making sure to include colon for blank values, for example to provide only the city: ... --locations="::Manchester" with all values set: ... --locations="US:NH:Manchester:03101:42.990605:-71.460989" optionally, you can just pass the "LATITUDE:LONGITUDE": ... --locations="42.990605:-71.460989" finally, you can also pass JSON string of dictionary on the command line as you would via JSON RPC ... --locations="{'country': 'US', 'state': 'NH'}"
  • email
    optionalstr
    email of channel owner
  • website_url
    optionalstr
    website url
  • thumbnail_url
    optionalstr
    thumbnail url
  • cover_url
    optionalstr
    url of cover image
  • account_id
    optionalstr
    id of the account to store channel
  • claim_address
    optionalstr
    address where the channel is sent to, if not specified it will be determined automatically from the account
  • preview
    optionalbool
    do not broadcast the transaction

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}

Create a channel claim without metadata


curl -d'{"method": "channel_create", "params": {"name": "@channel", "bid": "1.0", "featured": [], "tags": [], "languages": [], "locations": [], "preview": false}}' http://localhost:5279/
lbrynet channel create @channel 1.0
requests.post("http://localhost:5279", json={"method": "channel_create", "params": {"name": "@channel", "bid": "1.0", "featured": [], "tags": [], "languages": [], "locations": [], "preview": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001ae10215249dba3f36805e691ba86b6725e25b7ed9d8f8492b44b3369dfd874eb010000006a4730440220607d944b1cbf454bbb00c88fde02622cb3d3f488dc54fe439f788ff671aa574a022007a9c689bf9890c6f68f600a29370dac7f114cab056fece7d659bae492136c6401210308b3714020920cc32e989c08f29522471b9f70415a9956e7188246ee6a97ac09ffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc6d7576a914296c185286d635612bb68b410c459e7b8f6823de88acc462a029000000001976a914b3189b39617295883f901eeaedd7df16c733340688ac00000000",
    "inputs": [
      {
        "address": "mi5N7HKhPix6pQEhqFkjC3525Ffqg1BCoP",
        "amount": "7.999876",
        "confirmations": 2,
        "height": 207,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "txid": "eb74d8df69334bb492848f9dedb7255e72b686ba91e60568f3a3db49522110ae",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mjHyVVVGzDDNzHwri4hHakXnNX5wjnftZe",
        "amount": "1.0",
        "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "name": "@channel",
        "nout": 0,
        "permanent_url": "@channel#fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "txid": "62dff9262371d94e4ca0044ac671f41462462d7a7664bdf013c4ab4a26f7693e",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc"
        },
        "value_type": "channel"
      },
      {
        "address": "mwqvj53DdW9NFvzNHSSiC5bXBMmrLgo2ab",
        "amount": "6.983769",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "txid": "62dff9262371d94e4ca0044ac671f41462462d7a7664bdf013c4ab4a26f7693e",
        "type": "payment"
      }
    ],
    "total_fee": "0.016107",
    "total_input": "7.999876",
    "total_output": "7.983769",
    "txid": "62dff9262371d94e4ca0044ac671f41462462d7a7664bdf013c4ab4a26f7693e"
  }
}

Create a channel claim with all metadata


curl -d'{"method": "channel_create", "params": {"name": "@bigchannel", "bid": "1.0", "title": "Big Channel", "description": "A channel with lots of videos.", "email": "creator@smallmedia.com", "featured": [], "tags": ["music", "art"], "languages": ["pt-BR", "uk"], "locations": ["BR", "UA::Kiyv"], "website_url": "http://smallmedia.com", "thumbnail_url": "http://smallmedia.com/logo.jpg", "cover_url": "http://smallmedia.com/logo.jpg", "preview": false}}' http://localhost:5279/
lbrynet channel create @bigchannel 1.0 --title="Big Channel" --description="A channel with lots of videos." --email="creator@smallmedia.com" --tags=music --tags=art --languages=pt-BR --languages=uk --locations=BR --locations=UA::Kiyv --website_url="http://smallmedia.com" --thumbnail_url="http://smallmedia.com/logo.jpg" --cover_url="http://smallmedia.com/logo.jpg"
requests.post("http://localhost:5279", json={"method": "channel_create", "params": {"name": "@bigchannel", "bid": "1.0", "title": "Big Channel", "description": "A channel with lots of videos.", "email": "creator@smallmedia.com", "featured": [], "tags": ["music", "art"], "languages": ["pt-BR", "uk"], "locations": ["BR", "UA::Kiyv"], "website_url": "http://smallmedia.com", "thumbnail_url": "http://smallmedia.com/logo.jpg", "cover_url": "http://smallmedia.com/logo.jpg", "preview": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001b50dee4b49541c336615932bcd7fbd1d926fb8a61220b97d4f88d049e3a34eb6010000006a47304402202eec9b45e251baaf8e0dd5e163026b514f5d486ce82529d83dfd6d02aa16d09902206715e043a313394c8b424157cd7c44ee219f4aff7bdf1afe7bda0cf3be030d460121020b1680a0a69801adea345ff0beb908cfcf11bb7d0c7d616012c3733ff98793a6ffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a034200047a63a1eca9bef77838f5b545afbf4f5043be004469ae7c585263c3947c76ce402fd2000956add3b8931b9af2b5dae34b8b9bf543a3522e5f62f4722915e3f18a121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a914fedbdfec725c05e8982496858c17df060639089588ace221d305000000001976a914a46e30bf03e3d6b4e2ba8a00c520ab4abdd69f7088ac00000000",
    "inputs": [
      {
        "address": "n1JYZ7tofTLUx52hujvBwG59j7ngnqHMFR",
        "amount": "1.9993355",
        "confirmations": 1,
        "height": 210,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "txid": "b64ea3e349d0884f7db92012a6b86f921dbd7fcd2b931566331c54494bee0db5",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "n4kXKwXvgiKo94kxBCWNzDEPu1oefb7eKn",
        "amount": "1.0",
        "claim_id": "1e79b4a803cab0fee12d9e2e20832fd57b9cad3d",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "name": "@bigchannel",
        "nout": 0,
        "permanent_url": "@bigchannel#1e79b4a803cab0fee12d9e2e20832fd57b9cad3d",
        "txid": "ee0bf5c31600c732d43d4cd3d2f08c9ab2b9cde267253d39e7aec2eaf0d45dbf",
        "type": "claim",
        "value": {
          "cover": {
            "url": "http://smallmedia.com/logo.jpg"
          },
          "description": "A channel with lots of videos.",
          "email": "creator@smallmedia.com",
          "languages": [
            "pt-BR",
            "uk"
          ],
          "locations": [
            {
              "country": "BR"
            },
            {
              "city": "Kiyv",
              "country": "UA"
            }
          ],
          "public_key": "3056301006072a8648ce3d020106052b8104000a034200047a63a1eca9bef77838f5b545afbf4f5043be004469ae7c585263c3947c76ce402fd2000956add3b8931b9af2b5dae34b8b9bf543a3522e5f62f4722915e3f18a",
          "tags": [
            "music",
            "art"
          ],
          "thumbnail": {
            "url": "http://smallmedia.com/logo.jpg"
          },
          "title": "Big Channel",
          "website_url": "http://smallmedia.com"
        },
        "value_type": "channel"
      },
      {
        "address": "mvWP7gJXqukpvDj797FrYYKBAA9jHDdxUC",
        "amount": "0.9772285",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "txid": "ee0bf5c31600c732d43d4cd3d2f08c9ab2b9cde267253d39e7aec2eaf0d45dbf",
        "type": "payment"
      }
    ],
    "total_fee": "0.022107",
    "total_input": "1.9993355",
    "total_output": "1.9772285",
    "txid": "ee0bf5c31600c732d43d4cd3d2f08c9ab2b9cde267253d39e7aec2eaf0d45dbf"
  }
}

channel_export

Export serialized channel signing information for a given certificate claim id

Arguments

  • claim_id
    str
    Claim ID to export information about

Returns

(str) Serialized certificate information
// example(s) to come later

channel_import

Import serialized channel signing information (to allow signing new claims to the channel)

Arguments

  • serialized_certificate_info
    str
    certificate info

Returns

(dict) Result dictionary
// example(s) to come later

channel_list

List my channel claims.

Arguments

  • account_id
    optionalstr
    id of the account to use
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

{
    "page": "Page number of the current items.",
    "page_size": "Number of items to show on a page.",
    "total_pages": "Total number of pages.",
    "items": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ]
}

List your channel claims


curl -d'{"method": "channel_list", "params": {}}' http://localhost:5279/
lbrynet channel list
requests.post("http://localhost:5279", json={"method": "channel_list", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": [
    {
      "address": "mjHyVVVGzDDNzHwri4hHakXnNX5wjnftZe",
      "amount": "1.0",
      "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
      "claim_op": "create",
      "confirmations": 1,
      "height": 209,
      "is_change": false,
      "is_mine": true,
      "name": "@channel",
      "nout": 0,
      "permanent_url": "@channel#fb198d80d32b2b08c25e0ca16579e88818f1e563",
      "txid": "62dff9262371d94e4ca0044ac671f41462462d7a7664bdf013c4ab4a26f7693e",
      "type": "claim",
      "value": {
        "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc"
      },
      "value_type": "channel"
    }
  ]
}

Paginate your channel claims


curl -d'{"method": "channel_list", "params": {"page": 1, "page_size": 20}}' http://localhost:5279/
lbrynet channel list --page=1 --page_size=20
requests.post("http://localhost:5279", json={"method": "channel_list", "params": {"page": 1, "page_size": 20}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mjHyVVVGzDDNzHwri4hHakXnNX5wjnftZe",
        "amount": "1.0",
        "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "claim_op": "create",
        "confirmations": 1,
        "height": 209,
        "is_change": false,
        "is_mine": true,
        "name": "@channel",
        "nout": 0,
        "permanent_url": "@channel#fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "txid": "62dff9262371d94e4ca0044ac671f41462462d7a7664bdf013c4ab4a26f7693e",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc"
        },
        "value_type": "channel"
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_pages": 1
  }
}

channel_update

Update an existing channel claim.

Arguments

  • claim_id
    str
    claim_id of the channel to update
  • bid
    optionaldecimal
    amount to back the claim
  • title
    optionalstr
    title of the publication
  • description
    optionalstr
    description of the publication
  • clear_featured
    optionalbool
    clear existing featured content (prior to adding new ones)
  • featured
    optionallist
    claim_ids of featured content in channel
  • clear_tags
    optionalbool
    clear existing tags (prior to adding new ones)
  • tags
    optionallist
    add content tags
  • clear_languages
    optionalbool
    clear existing languages (prior to adding new ones)
  • languages
    optionallist
    languages used by the channel, using RFC 5646 format, eg: for English `--languages=en` for Spanish (Spain) `--languages=es-ES` for Spanish (Mexican) `--languages=es-MX` for Chinese (Simplified) `--languages=zh-Hans` for Chinese (Traditional) `--languages=zh-Hant`
  • clear_locations
    optionalbool
    clear existing locations (prior to adding new ones)
  • locations
    optionallist
    locations of the channel, consisting of 2 letter `country` code and a `state`, `city` and a postal `code` along with a `latitude` and `longitude`. for JSON RPC: pass a dictionary with aforementioned attributes as keys, eg: ... "locations": [{'country': 'US', 'state': 'NH'}] ... for command line: pass a colon delimited list with values in the following order: "COUNTRY:STATE:CITY:CODE:LATITUDE:LONGITUDE" making sure to include colon for blank values, for example to provide only the city: ... --locations="::Manchester" with all values set: ... --locations="US:NH:Manchester:03101:42.990605:-71.460989" optionally, you can just pass the "LATITUDE:LONGITUDE": ... --locations="42.990605:-71.460989" finally, you can also pass JSON string of dictionary on the command line as you would via JSON RPC ... --locations="{'country': 'US', 'state': 'NH'}"
  • email
    optionalstr
    email of channel owner
  • website_url
    optionalstr
    website url
  • thumbnail_url
    optionalstr
    thumbnail url
  • cover_url
    optionalstr
    url of cover image
  • account_id
    optionalstr
    id of the account to store channel
  • claim_address
    optionalstr
    address where the channel is sent
  • new_signing_key
    optionalbool
    generate a new signing key, will invalidate all previous publishes
  • preview
    optionalbool
    do not broadcast the transaction

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}

Update a channel claim


curl -d'{"method": "channel_update", "params": {"claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563", "title": "New Channel", "featured": [], "clear_featured": false, "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "new_signing_key": false, "preview": false}}' http://localhost:5279/
lbrynet channel update fb198d80d32b2b08c25e0ca16579e88818f1e563 --title="New Channel"
requests.post("http://localhost:5279", json={"method": "channel_update", "params": {"claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563", "title": "New Channel", "featured": [], "clear_featured": false, "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "new_signing_key": false, "preview": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "01000000023e69f7264aabc413f0bd64767a2d466214f471c64a04a04c4ed9712326f9df62000000006a473044022061c9584682add45626aa96ad8945c5d8789c2b3e129870becf94c4724f7e27fb022010406edd79c6a72b69d7ebb92f2e09dffa91405afb9d22e6a255a339902b45d1012103a7e63c58505e43a111503f473056687afeddac27e6b6b2f7ced7eecf1fa00569ffffffffbc5a1f8b5b7f0191b800a76a8a8178b3352c6f0ab66ee06f8ecfa9b6a2389905000000006b483045022100fae66050244e2da3fccbfcd509fa5fff1658e0e742aef73ba769d8cb686260b6022067eba187c5804d336329c33b5292c1dcd744397b7fbbdbaaf14f7c84e57889ea012103daf1282e1910599c8cf49b5287846dc9003da014039fbdb5f0f1cc1b9ee416aaffffffff0200e1f50500000000a6b708406368616e6e656c1463e5f11888e87965a10c5ec2082b2bd3808d19fb4c6a00125a0a583056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc420b4e6577204368616e6e656c6d6d76a914296c185286d635612bb68b410c459e7b8f6823de88ac6ebeea0b000000001976a914d909b4ef1ab7f859c3c39f09f90a68d660c204d288ac00000000",
    "inputs": [
      {
        "address": "mjHyVVVGzDDNzHwri4hHakXnNX5wjnftZe",
        "amount": "1.0",
        "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "claim_op": "create",
        "confirmations": 1,
        "height": 209,
        "is_change": false,
        "is_mine": true,
        "name": "@channel",
        "nout": 0,
        "permanent_url": "@channel#fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "txid": "62dff9262371d94e4ca0044ac671f41462462d7a7664bdf013c4ab4a26f7693e",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc"
        },
        "value_type": "channel"
      },
      {
        "address": "mwqvj53DdW9NFvzNHSSiC5bXBMmrLgo2ab",
        "amount": "1.999604",
        "confirmations": 1,
        "height": 209,
        "is_change": true,
        "is_mine": true,
        "nout": 0,
        "txid": "059938a2b6a9cf8e6fe06eb60a6f2c35b378818a6aa700b891017f5b8b1f5abc",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mjHyVVVGzDDNzHwri4hHakXnNX5wjnftZe",
        "amount": "1.0",
        "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "claim_op": "update",
        "confirmations": -2,
        "height": -2,
        "name": "@channel",
        "nout": 0,
        "permanent_url": "@channel#fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "txid": "b64ea3e349d0884f7db92012a6b86f921dbd7fcd2b931566331c54494bee0db5",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
          "title": "New Channel"
        },
        "value_type": "channel"
      },
      {
        "address": "n1JYZ7tofTLUx52hujvBwG59j7ngnqHMFR",
        "amount": "1.9993355",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "txid": "b64ea3e349d0884f7db92012a6b86f921dbd7fcd2b931566331c54494bee0db5",
        "type": "payment"
      }
    ],
    "total_fee": "0.0002685",
    "total_input": "2.999604",
    "total_output": "2.9993355",
    "txid": "b64ea3e349d0884f7db92012a6b86f921dbd7fcd2b931566331c54494bee0db5"
  }
}

claim_list

List my stream and channel claims.

Arguments

  • account_id
    optionalstr
    id of the account to query
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

{
    "page": "Page number of the current items.",
    "page_size": "Number of items to show on a page.",
    "total_pages": "Total number of pages.",
    "items": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ]
}

List all your claims


curl -d'{"method": "claim_list", "params": {}}' http://localhost:5279/
lbrynet claim list
requests.post("http://localhost:5279", json={"method": "claim_list", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": [
    {
      "address": "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
      "amount": "1.0",
      "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
      "claim_op": "update",
      "confirmations": 1,
      "height": 214,
      "is_change": false,
      "is_channel_signature_valid": true,
      "is_mine": true,
      "name": "astream",
      "nout": 0,
      "permanent_url": "astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
      "signing_channel": {
        "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "name": "@channel",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
          "title": "New Channel"
        }
      },
      "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
      "type": "claim",
      "value": {
        "source": {
          "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
          "media_type": "application/octet-stream",
          "name": "tmpgj4k6kov",
          "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
          "size": "11"
        }
      },
      "value_type": "stream"
    },
    {
      "address": "mjHyVVVGzDDNzHwri4hHakXnNX5wjnftZe",
      "amount": "1.0",
      "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
      "claim_op": "update",
      "confirmations": 5,
      "height": 210,
      "is_change": false,
      "is_mine": true,
      "name": "@channel",
      "nout": 0,
      "permanent_url": "@channel#fb198d80d32b2b08c25e0ca16579e88818f1e563",
      "txid": "b64ea3e349d0884f7db92012a6b86f921dbd7fcd2b931566331c54494bee0db5",
      "type": "claim",
      "value": {
        "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
        "title": "New Channel"
      },
      "value_type": "channel"
    }
  ]
}

Paginate your claims


curl -d'{"method": "claim_list", "params": {"page": 1, "page_size": 20}}' http://localhost:5279/
lbrynet claim list --page=1 --page_size=20
requests.post("http://localhost:5279", json={"method": "claim_list", "params": {"page": 1, "page_size": 20}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
        "amount": "1.0",
        "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_change": false,
        "is_channel_signature_valid": true,
        "is_mine": true,
        "name": "astream",
        "nout": 0,
        "permanent_url": "astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "signing_channel": {
          "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
          "name": "@channel",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
            "title": "New Channel"
          }
        },
        "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
        "type": "claim",
        "value": {
          "source": {
            "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
            "media_type": "application/octet-stream",
            "name": "tmpgj4k6kov",
            "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
            "size": "11"
          }
        },
        "value_type": "stream"
      },
      {
        "address": "mjHyVVVGzDDNzHwri4hHakXnNX5wjnftZe",
        "amount": "1.0",
        "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "claim_op": "update",
        "confirmations": 5,
        "height": 210,
        "is_change": false,
        "is_mine": true,
        "name": "@channel",
        "nout": 0,
        "permanent_url": "@channel#fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "txid": "b64ea3e349d0884f7db92012a6b86f921dbd7fcd2b931566331c54494bee0db5",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
          "title": "New Channel"
        },
        "value_type": "channel"
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_pages": 1
  }
}

Search for stream and channel claims on the blockchain. Use --channel_id= to list all stream claims in a channel.

Arguments

  • name
    optionalstr
    find claims with this name
  • claim_id
    optionalstr
    find a claim with this claim_id
  • txid
    optionalstr
    find a claim with this txid:nout
  • nout
    optionalstr
    find a claim with this txid:nout
  • channel_id
    optionalstr
    limit search to specific channel claim id (returns stream claims)
  • winning
    optionalbool
    limit to winning claims
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

{
    "page": "Page number of the current items.",
    "page_size": "Number of items to show on a page.",
    "total_pages": "Total number of pages.",
    "items": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ]
}

Search for all claims in channel


curl -d'{"method": "claim_search", "params": {"channel_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563", "winning": false}}' http://localhost:5279/
lbrynet claim search --channel_id="fb198d80d32b2b08c25e0ca16579e88818f1e563"
requests.post("http://localhost:5279", json={"method": "claim_search", "params": {"channel_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563", "winning": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "absolute_channel_position": 0,
        "address": "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
        "amount": "1.0",
        "channel_name": "@channel",
        "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "claim_sequence": -1,
        "decoded_claim": true,
        "depth": 1,
        "effective_amount": "1.0",
        "has_signature": true,
        "height": 214,
        "is_channel_signature_valid": true,
        "name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "protobuf": "0163e5f11888e87965a10c5ec2082b2bd3808d19fb7ac4b03623e50c0b4f0f9722fda4bd5bc277abf48c10d2ff230a5585b0cb35ef537e13dc76030f1e3cc2aff62892ccbb0b54b24bd4dace2600841745c1626d3e0a7f0a7d0a20b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9120b746d70676a346b366b6f76180b22186170706c69636174696f6e2f6f637465742d73747265616d323018a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
        "signature_is_valid": true,
        "signing_channel": {
          "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
          "name": "@channel",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
            "title": "New Channel"
          }
        },
        "supports": [],
        "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
        "valid_at_height": 214,
        "value": {
          "source": {
            "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
            "media_type": "application/octet-stream",
            "name": "tmpgj4k6kov",
            "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
            "size": "11"
          }
        }
      }
    ],
    "page": 1,
    "page_size": 10,
    "total_pages": 1
  }
}

Search for claims matching a name


curl -d'{"method": "claim_search", "params": {"name": "astream", "winning": false}}' http://localhost:5279/
lbrynet claim search --name="astream"
requests.post("http://localhost:5279", json={"method": "claim_search", "params": {"name": "astream", "winning": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
        "amount": "1.0",
        "channel_name": "@channel",
        "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "claim_sequence": -1,
        "decoded_claim": true,
        "depth": 1,
        "effective_amount": "1.0",
        "has_signature": true,
        "height": 214,
        "is_channel_signature_valid": true,
        "name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "protobuf": "0163e5f11888e87965a10c5ec2082b2bd3808d19fb7ac4b03623e50c0b4f0f9722fda4bd5bc277abf48c10d2ff230a5585b0cb35ef537e13dc76030f1e3cc2aff62892ccbb0b54b24bd4dace2600841745c1626d3e0a7f0a7d0a20b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9120b746d70676a346b366b6f76180b22186170706c69636174696f6e2f6f637465742d73747265616d323018a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
        "signature_is_valid": true,
        "signing_channel": {
          "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
          "name": "@channel",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
            "title": "New Channel"
          }
        },
        "supports": [],
        "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
        "valid_at_height": 214,
        "value": {
          "source": {
            "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
            "media_type": "application/octet-stream",
            "name": "tmpgj4k6kov",
            "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
            "size": "11"
          }
        }
      }
    ],
    "page": 1,
    "page_size": 1,
    "total_pages": 1
  }
}

comment_create

Create and associate a comment with a claim using your channel identity.

Arguments

  • parent_comment_id
    optionalint
    The ID of a comment to make a response to

Returns

(dict) Comment object if successfully made
// example(s) to come later

comment_list

List comments associated with a claim.

Arguments

  • flat
    optionalbool
    Flag to indicate whether or not you want the replies to be flattened along with the rest of the comments attached to the claim. Off by default
  • parent_comment_id
    optionalint
    The ID of an existing comment to list replies from
  • max_replies_shown
    optionalint
    For every comment that we pull replies from, only retrieve up to this amount. Note: This is not the same as page size.
  • page
    optionalint
    The page you'd like to see in the comment list. The first page is 1, second page is 2, and so on.
  • page_size
    optionalint
    The amount of comments that you'd like to retrieve in one request

Returns

(dict)  Dict containing the following schema:
{
    "page":  (int) The page of comments as provided when limiting response to page_size.
    "page_size":  (int) Number of comments in the given page. -1 if page_size wasn't used
    "comments":  (list) Contains all the comments (as dicts) as provided by the specified parameters
}
// example(s) to come later

file_delete

Delete a LBRY file

Arguments

  • delete_from_download_dir
    optionalbool
    delete file from download directory, instead of just deleting blobs
  • delete_all
    optionalbool
    if there are multiple matching files, allow the deletion of multiple files. Otherwise do not delete anything.
  • sd_hash
    optionalstr
    delete by file sd hash
  • file_name
    optionalstr
    delete by file name in downloads folder
  • stream_hash
    optionalstr
    delete by file stream hash
  • rowid
    optionalint
    delete by file row id
  • claim_id
    optionalstr
    delete by file claim id
  • txid
    optionalstr
    delete by file claim txid
  • nout
    optionalint
    delete by file claim nout
  • claim_name
    optionalstr
    delete by file claim name
  • channel_claim_id
    optionalstr
    delete by file channel claim id
  • channel_name
    optionalstr
    delete by file channel claim name

Returns

(bool) true if deletion was successful

Delete a file


curl -d'{"method": "file_delete", "params": {"delete_from_download_dir": false, "delete_all": false, "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45"}}' http://localhost:5279/
lbrynet file delete --claim_id="dfb3809e63cc75981fd7880faa5b7b7b50faeb45"
requests.post("http://localhost:5279", json={"method": "file_delete", "params": {"delete_from_download_dir": false, "delete_all": false, "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": true
}

file_list

List files limited by optional filters

Arguments

  • sd_hash
    optionalstr
    get file with matching sd hash
  • file_name
    optionalstr
    get file with matching file name in the downloads folder
  • stream_hash
    optionalstr
    get file with matching stream hash
  • rowid
    optionalint
    get file with matching row id
  • claim_id
    optionalstr
    get file with matching claim id
  • outpoint
    optionalstr
    get file with matching claim outpoint
  • txid
    optionalstr
    get file with matching claim txid
  • nout
    optionalint
    get file with matching claim nout
  • channel_claim_id
    optionalstr
    get file with matching channel claim id
  • channel_name
    optionalstr
    get file with matching channel name
  • claim_name
    optionalstr
    get file with matching claim name
  • blobs_in_stream
    optionalint
    get file with matching blobs in stream
  • blobs_remaining
    optionalint
    amount of remaining blobs to download
  • sort
    optionalstr
    field to sort by (one of the above filter fields)
  • comparison
    optionalstr
    logical comparision, (eq | ne | g | ge | l | le)

Returns

[
    {
        "completed": "(bool) true if download is completed",
        "file_name": "(str) name of file",
        "download_directory": "(str) download directory",
        "points_paid": "(float) credit paid to download file",
        "stopped": "(bool) true if download is stopped",
        "stream_hash": "(str) stream hash of file",
        "stream_name": "(str) stream name",
        "suggested_file_name": "(str) suggested file name",
        "sd_hash": "(str) sd hash of file",
        "download_path": "(str) download path of file",
        "mime_type": "(str) mime type of file",
        "key": "(str) key attached to file",
        "total_bytes_lower_bound": "(int) lower bound file size in bytes",
        "total_bytes": "(int) file upper bound size in bytes",
        "written_bytes": "(int) written size in bytes",
        "blobs_completed": "(int) number of fully downloaded blobs",
        "blobs_in_stream": "(int) total blobs on stream",
        "blobs_remaining": "(int) total blobs remaining to download",
        "status": "(str) downloader status",
        "claim_id": "(str) None if claim is not found else the claim id",
        "txid": "(str) None if claim is not found else the transaction id",
        "nout": "(int) None if claim is not found else the transaction output index",
        "outpoint": "(str) None if claim is not found else the tx and output",
        "metadata": "(dict) None if claim is not found else the claim metadata",
        "channel_claim_id": "(str) None if claim is not found or not signed",
        "channel_name": "(str) None if claim is not found or not signed",
        "claim_name": "(str) None if claim is not found else the claim name"
    }
]

List local files


curl -d'{"method": "file_list", "params": {"reverse": false}}' http://localhost:5279/
lbrynet file list
requests.post("http://localhost:5279", json={"method": "file_list", "params": {"reverse": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": [
    {
      "blobs_completed": 1,
      "blobs_in_stream": 1,
      "blobs_remaining": 0,
      "channel_claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
      "channel_name": "@channel",
      "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
      "claim_name": "astream",
      "completed": true,
      "download_directory": "/tmp",
      "download_path": null,
      "file_name": "tmpgj4k6kov",
      "key": "22704f415def3f1a19bc06e98c7d956b",
      "metadata": {
        "source": {
          "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
          "media_type": "application/octet-stream",
          "name": "tmpgj4k6kov",
          "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
          "size": "11"
        }
      },
      "mime_type": "application/octet-stream",
      "nout": 0,
      "outpoint": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201:0",
      "points_paid": 0.0,
      "protobuf": "0163e5f11888e87965a10c5ec2082b2bd3808d19fb7ac4b03623e50c0b4f0f9722fda4bd5bc277abf48c10d2ff230a5585b0cb35ef537e13dc76030f1e3cc2aff62892ccbb0b54b24bd4dace2600841745c1626d3e0a7f0a7d0a20b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9120b746d70676a346b366b6f76180b22186170706c69636174696f6e2f6f637465742d73747265616d323018a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
      "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
      "status": "finished",
      "stopped": true,
      "stream_hash": "86db94d08df28799a62cafd24a6afa939fb98c0b5a78edfa14a026b616a99528493a85780a8b1f7eb7cb86c6d1b95707",
      "stream_name": "tmpgj4k6kov",
      "suggested_file_name": "tmpgj4k6kov",
      "total_bytes": 16,
      "total_bytes_lower_bound": 0,
      "tx": null,
      "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
      "written_bytes": null
    },
    {
      "blobs_completed": 1,
      "blobs_in_stream": 1,
      "blobs_remaining": 0,
      "channel_claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
      "channel_name": "@channel",
      "claim_id": "128e25d12ff779ff3098884a2a3eb2d4348069be",
      "claim_name": "blank-image",
      "completed": true,
      "download_directory": "/tmp",
      "download_path": null,
      "file_name": "tmp5yv80226.png",
      "key": "7501b49d9c77a6f44b94dac752e933be",
      "metadata": {
        "author": "Picaso",
        "description": "A blank PNG that is 5x7.",
        "fee": {
          "address": "mx17rDC8WsYLF17x9MqDk79GFiUD3fbCeG",
          "amount": 0.3,
          "currency": "LBC"
        },
        "image": {
          "height": 7,
          "width": 5
        },
        "languages": [
          "en"
        ],
        "license": "Public Domain",
        "license_url": "http://public-domain.org",
        "locations": [
          {
            "city": "Manchester",
            "country": "US",
            "state": "NH"
          }
        ],
        "release_time": "1556077748",
        "source": {
          "hash": "06003bbee8aece0543ed9d9cecc48be1d996cfeff9837a1aed1d961caeda82af",
          "media_type": "image/png",
          "name": "tmp5yv80226.png",
          "sd_hash": "35d91c4edf495755035bb2848534aa39c9ad6be074f80372349c6aed57e1edba29975b778d35f3e0fbd9882f3454305d",
          "size": "99"
        },
        "stream_type": "image",
        "tags": [
          "blank",
          "art"
        ],
        "thumbnail": {
          "url": "http://smallmedia.com/thumbnail.jpg"
        },
        "title": "Blank Image"
      },
      "mime_type": "image/png",
      "nout": 0,
      "outpoint": "d888fb7660b1dda1b2d112e52b45ffc8201fe2440e0952cd9b5cd95aa0223dc5:0",
      "points_paid": 0.0,
      "protobuf": "0163e5f11888e87965a10c5ec2082b2bd3808d19fbd7fda992806cb663c29d21fa3a89306fc9e617d19fb9abcfb3782e03ff5beac4b7d2bea1b0d24e194f67ee2f093b72fed1293c8a4797645fbb51aab6b72133cc0ad5010a720a2006003bbee8aece0543ed9d9cecc48be1d996cfeff9837a1aed1d961caeda82af120f746d7035797638303232362e706e6718632209696d6167652f706e67323035d91c4edf495755035bb2848534aa39c9ad6be074f80372349c6aed57e1edba29975b778d35f3e0fbd9882f3454305d120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728b4b9ffe5053222080112196fb4d5a2966ee28e029833ddb3d782b34ea785888723d7456d188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e63686573746572",
      "sd_hash": "35d91c4edf495755035bb2848534aa39c9ad6be074f80372349c6aed57e1edba29975b778d35f3e0fbd9882f3454305d",
      "status": "finished",
      "stopped": true,
      "stream_hash": "0811614e9dbb4fdedffcded1745101c0d9a682c4ba270af81b481268acd3c232695b9277d061fd5f5e01d9d60e96ac3e",
      "stream_name": "tmp5yv80226.png",
      "suggested_file_name": "tmp5yv80226.png",
      "total_bytes": 112,
      "total_bytes_lower_bound": 96,
      "tx": null,
      "txid": "d888fb7660b1dda1b2d112e52b45ffc8201fe2440e0952cd9b5cd95aa0223dc5",
      "written_bytes": null
    }
  ]
}

List files matching a parameter


curl -d'{"method": "file_list", "params": {"claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45", "reverse": false}}' http://localhost:5279/
lbrynet file list --claim_id="dfb3809e63cc75981fd7880faa5b7b7b50faeb45"
requests.post("http://localhost:5279", json={"method": "file_list", "params": {"claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45", "reverse": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": [
    {
      "blobs_completed": 1,
      "blobs_in_stream": 1,
      "blobs_remaining": 0,
      "channel_claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
      "channel_name": "@channel",
      "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
      "claim_name": "astream",
      "completed": true,
      "download_directory": "/tmp",
      "download_path": null,
      "file_name": "tmpgj4k6kov",
      "key": "22704f415def3f1a19bc06e98c7d956b",
      "metadata": {
        "source": {
          "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
          "media_type": "application/octet-stream",
          "name": "tmpgj4k6kov",
          "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
          "size": "11"
        }
      },
      "mime_type": "application/octet-stream",
      "nout": 0,
      "outpoint": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201:0",
      "points_paid": 0.0,
      "protobuf": "0163e5f11888e87965a10c5ec2082b2bd3808d19fb7ac4b03623e50c0b4f0f9722fda4bd5bc277abf48c10d2ff230a5585b0cb35ef537e13dc76030f1e3cc2aff62892ccbb0b54b24bd4dace2600841745c1626d3e0a7f0a7d0a20b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9120b746d70676a346b366b6f76180b22186170706c69636174696f6e2f6f637465742d73747265616d323018a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
      "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
      "status": "finished",
      "stopped": true,
      "stream_hash": "86db94d08df28799a62cafd24a6afa939fb98c0b5a78edfa14a026b616a99528493a85780a8b1f7eb7cb86c6d1b95707",
      "stream_name": "tmpgj4k6kov",
      "suggested_file_name": "tmpgj4k6kov",
      "total_bytes": 16,
      "total_bytes_lower_bound": 0,
      "tx": null,
      "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
      "written_bytes": null
    }
  ]
}

file_reflect

Reflect all the blobs in a file matching the filter criteria

Arguments

  • sd_hash
    optionalstr
    get file with matching sd hash
  • file_name
    optionalstr
    get file with matching file name in the downloads folder
  • stream_hash
    optionalstr
    get file with matching stream hash
  • rowid
    optionalint
    get file with matching row id
  • reflector
    optionalstr
    reflector server, ip address or url by default choose a server from the config

Returns

(list) list of blobs reflected
// example(s) to come later

file_set_status

Start or stop downloading a file

Arguments

  • status
    str
    one of "start" or "stop"
  • sd_hash
    optionalstr
    set status of file with matching sd hash
  • file_name
    optionalstr
    set status of file with matching file name in the downloads folder
  • stream_hash
    optionalstr
    set status of file with matching stream hash
  • rowid
    optionalint
    set status of file with matching row id

Returns

(str) Confirmation message
// example(s) to come later

peer_list

Get peers for blob hash

Arguments

  • blob_hash
    str
    find available peers for this blob hash
  • search_bottom_out_limit
    optionalint
    the number of search probes in a row that don't find any new peers before giving up and returning

Returns

(list) List of contact dictionaries {'address': , 'udp_port': , 'tcp_port': ,
'node_id': }
// example(s) to come later

peer_ping

Send a kademlia ping to the specified peer. If address and port are provided the peer is directly pinged, if not provided the peer is located first.

Arguments

Returns

(str) pong, or {'error': } if an error is encountered
// example(s) to come later

settings_get

Get daemon settings

Arguments

Returns

(dict) Dictionary of daemon settings
See ADJUSTABLE_SETTINGS in lbrynet/conf.py for full list of settings

Get settings


curl -d'{"method": "settings_get", "params": {}}' http://localhost:5279/
lbrynet settings get
requests.post("http://localhost:5279", json={"method": "settings_get", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "announce_head_and_sd_only": true,
    "api": "localhost:5279",
    "blob_download_timeout": 30.0,
    "blockchain_name": "lbrycrd_regtest",
    "cache_time": 150,
    "comment_server": "http://comments.lbry.com:2903/api",
    "components_to_skip": [
      "dht",
      "upnp",
      "hash_announcer",
      "peer_protocol_server"
    ],
    "concurrent_blob_announcers": 10,
    "concurrent_reflector_uploads": 10,
    "config": "/home/lex/.local/share/lbry/lbrynet/daemon_settings.yml",
    "data_dir": "/tmp/tmpi5ikthmq",
    "download_dir": "/tmp/tmpi5ikthmq",
    "download_timeout": 30.0,
    "fixed_peer_delay": 2.0,
    "known_dht_nodes": [],
    "lbryum_servers": [
      [
        "127.0.0.1",
        50001
      ]
    ],
    "max_connections_per_download": 8,
    "max_key_fee": {
      "amount": 50.0,
      "currency": "USD"
    },
    "network_interface": "0.0.0.0",
    "node_rpc_timeout": 5.0,
    "peer_connect_timeout": 2.0,
    "reflect_streams": true,
    "reflector_servers": [
      [
        "127.0.0.1",
        5566
      ]
    ],
    "s3_headers_depth": 960,
    "share_usage_data": false,
    "split_buckets_under_index": 1,
    "tcp_port": 3333,
    "udp_port": 4444,
    "use_upnp": false,
    "wallet_dir": "/tmp/tmpi5ikthmq"
  }
}

settings_set

Set daemon settings

Arguments

Returns

(dict) Updated dictionary of daemon settings
// example(s) to come later

stream_abandon

Abandon one of my stream claims.

Arguments

  • claim_id
    optionalstr
    claim_id of the claim to abandon
  • txid
    optionalstr
    txid of the claim to abandon
  • nout
    optionalint
    nout of the claim to abandon
  • account_id
    optionalstr
    id of the account to use
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until abandon is in mempool

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}

Abandon a stream claim


curl -d'{"method": "stream_abandon", "params": {"claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45", "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet stream abandon dfb3809e63cc75981fd7880faa5b7b7b50faeb45
requests.post("http://localhost:5279", json={"method": "stream_abandon", "params": {"claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45", "preview": false, "blocking": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "010000000101328a4b1787ef8668599bd9678e690f710280fd78b2b85370077dc8e6af823d000000006b483045022100c69449ab14d1b03c6a21c0692f7beab7ebac5c0b1f07364018050562da136b9c022076266e722c6a2d98cb7b2727cfd909b29f5713bd1afda892a2facd8641d6de5801210302d139172070e4e765e43a5f7a538c7e65c34778bbfa3f8074cc21373cc4c7cdffffffff0134b7f505000000001976a914f62e8a151936d3df2f1079bd96c7d36a7a9ec96a88ac00000000",
    "inputs": [
      {
        "address": "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
        "amount": "1.0",
        "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "claim_op": "update",
        "confirmations": 3,
        "height": 214,
        "is_change": false,
        "is_mine": true,
        "name": "astream",
        "nout": 0,
        "permanent_url": "astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "signing_channel": {
          "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
          "name": "@channel",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
            "title": "New Channel"
          }
        },
        "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
        "type": "claim",
        "value": {
          "source": {
            "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
            "media_type": "application/octet-stream",
            "name": "tmpgj4k6kov",
            "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
            "size": "11"
          }
        },
        "value_type": "stream"
      }
    ],
    "outputs": [
      {
        "address": "n3xeGrgdNkisfvqf7wxMJ1Y6Mj3BgJjXi8",
        "amount": "0.999893",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "txid": "bb3218aab9fb3b230780e17f9f4d642ae2ed2e873e2595f7a521b19f253575d0",
        "type": "payment"
      }
    ],
    "total_fee": "0.000107",
    "total_input": "1.0",
    "total_output": "0.999893",
    "txid": "bb3218aab9fb3b230780e17f9f4d642ae2ed2e873e2595f7a521b19f253575d0"
  }
}

stream_cost_estimate

Get estimated cost for a lbry stream

Arguments

  • uri
    str
    uri to use

Returns

(float) Estimated cost in lbry credits, returns None if uri is not
resolvable
// example(s) to come later

stream_create

Make a new stream claim and announce the associated file to lbrynet.

Arguments

  • name
    str
    name of the content (can only consist of a-z A-Z 0-9 and -(dash))
  • allow_duplicate_name
    optionalbool
    create new claim even if one already exists with given name. default: false.
  • bid
    decimal
    amount to back the claim
  • file_path
    str
    path to file to be associated with name.
  • fee_currency
    optionalstring
    specify fee currency
  • fee_amount
    optionaldecimal
    content download fee
  • fee_address
    optionalstr
    address where to send fee payments, will use value from --claim_address if not provided
  • title
    optionalstr
    title of the publication
  • description
    optionalstr
    description of the publication
  • author
    optionalstr
    author of the publication. The usage for this field is not the same as for channels. The author field is used to credit an author who is not the publisher and is not represented by the channel. For example, a pdf file of 'The Odyssey' has an author of 'Homer' but may by published to a channel such as '@classics', or to no channel at all
  • tags
    optionallist
    add content tags
  • languages
    optionallist
    languages used by the channel, using RFC 5646 format, eg: for English `--languages=en` for Spanish (Spain) `--languages=es-ES` for Spanish (Mexican) `--languages=es-MX` for Chinese (Simplified) `--languages=zh-Hans` for Chinese (Traditional) `--languages=zh-Hant`
  • locations
    optionallist
    locations relevant to the stream, consisting of 2 letter `country` code and a `state`, `city` and a postal `code` along with a `latitude` and `longitude`. for JSON RPC: pass a dictionary with aforementioned attributes as keys, eg: ... "locations": [{'country': 'US', 'state': 'NH'}] ... for command line: pass a colon delimited list with values in the following order: "COUNTRY:STATE:CITY:CODE:LATITUDE:LONGITUDE" making sure to include colon for blank values, for example to provide only the city: ... --locations="::Manchester" with all values set: ... --locations="US:NH:Manchester:03101:42.990605:-71.460989" optionally, you can just pass the "LATITUDE:LONGITUDE": ... --locations="42.990605:-71.460989" finally, you can also pass JSON string of dictionary on the command line as you would via JSON RPC ... --locations="{'country': 'US', 'state': 'NH'}"
  • license
    optionalstr
    publication license
  • license_url
    optionalstr
    publication license url
  • thumbnail_url
    optionalstr
    thumbnail url
  • release_time
    optionalint
    original public release of content, seconds since UNIX epoch
  • width
    optionalint
    image/video width, automatically calculated from media file
  • height
    optionalint
    image/video height, automatically calculated from media file
  • duration
    optionalint
    audio/video duration in seconds, automatically calculated
  • channel_id
    optionalstr
    claim id of the publisher channel
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.
  • account_id
    optionalstr
    account to use for funding the transaction
  • claim_address
    optionalstr
    address where the claim is sent to, if not specified it will be determined automatically from the account
  • preview
    optionalbool
    do not broadcast the transaction

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}

Create a stream claim without metadata


curl -d'{"method": "stream_create", "params": {"name": "astream", "bid": "1.0", "file_path": "/tmp/tmpgj4k6kov", "tags": [], "languages": [], "locations": [], "channel_account_id": [], "preview": false}}' http://localhost:5279/
lbrynet stream create astream 1.0 /tmp/tmpgj4k6kov
requests.post("http://localhost:5279", json={"method": "stream_create", "params": {"name": "astream", "bid": "1.0", "file_path": "/tmp/tmpgj4k6kov", "tags": [], "languages": [], "locations": [], "channel_account_id": [], "preview": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "01000000013e69f7264aabc413f0bd64767a2d466214f471c64a04a04c4ed9712326f9df62010000006b4830450221009947b78eeee56cc2869485f25eda0d0c1e1f8f08b01b45e2b3230bf1d19b88d502207e9d6410ee040163108facfbbff8f935774a1223ba87f727078360d994c2b1e0012103daf1282e1910599c8cf49b5287846dc9003da014039fbdb5f0f1cc1b9ee416aaffffffff0200e1f50500000000a8b5076173747265616d4c82000a7f0a7d0a20b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9120b746d70676a346b366b6f76180b22186170706c69636174696f6e2f6f637465742d73747265616d323018a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb526d7576a9141817356204800526abb02896e6d34aedf84bf70188ac38fb9423000000001976a91483ab53b75a13928c4874a2f6f9632043a2eefb4f88ac00000000",
    "inputs": [
      {
        "address": "mwqvj53DdW9NFvzNHSSiC5bXBMmrLgo2ab",
        "amount": "6.983769",
        "confirmations": 4,
        "height": 209,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "txid": "62dff9262371d94e4ca0044ac671f41462462d7a7664bdf013c4ab4a26f7693e",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
        "amount": "1.0",
        "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "name": "astream",
        "nout": 0,
        "permanent_url": "astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "txid": "1556b58c7f3aca9642221241692b4d02737634e4874f7522930eb8e760242571",
        "type": "claim",
        "value": {
          "source": {
            "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
            "media_type": "application/octet-stream",
            "name": "tmpgj4k6kov",
            "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
            "size": "11"
          }
        },
        "value_type": "stream"
      },
      {
        "address": "msXA4CBXmL8rN4stfzYGiCjxNvLj8vEKb9",
        "amount": "5.969662",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "txid": "1556b58c7f3aca9642221241692b4d02737634e4874f7522930eb8e760242571",
        "type": "payment"
      }
    ],
    "total_fee": "0.014107",
    "total_input": "6.983769",
    "total_output": "6.969662",
    "txid": "1556b58c7f3aca9642221241692b4d02737634e4874f7522930eb8e760242571"
  }
}

Create an image stream claim with all metadata and fee


curl -d'{"method": "stream_create", "params": {"name": "blank-image", "bid": "1.0", "file_path": "/tmp/tmp5yv80226.png", "tags": ["blank", "art"], "languages": ["en"], "locations": ["US:NH:Manchester"], "fee_currency": "LBC", "fee_amount": "0.3", "title": "Blank Image", "description": "A blank PNG that is 5x7.", "author": "Picaso", "license": "Public Domain", "license_url": "http://public-domain.org", "thumbnail_url": "http://smallmedia.com/thumbnail.jpg", "release_time": 1556077748, "channel_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563", "channel_account_id": [], "preview": false}}' http://localhost:5279/
lbrynet stream create blank-image 1.0 /tmp/tmp5yv80226.png --tags=blank --tags=art --languages=en --locations=US:NH:Manchester --fee_currency=LBC --fee_amount=0.3 --title="Blank Image" --description="A blank PNG that is 5x7." --author=Picaso --license="Public Domain" --license_url=http://public-domain.org --thumbnail_url="http://smallmedia.com/thumbnail.jpg" --release_time=1556077748 --channel_id="fb198d80d32b2b08c25e0ca16579e88818f1e563"
requests.post("http://localhost:5279", json={"method": "stream_create", "params": {"name": "blank-image", "bid": "1.0", "file_path": "/tmp/tmp5yv80226.png", "tags": ["blank", "art"], "languages": ["en"], "locations": ["US:NH:Manchester"], "fee_currency": "LBC", "fee_amount": "0.3", "title": "Blank Image", "description": "A blank PNG that is 5x7.", "author": "Picaso", "license": "Public Domain", "license_url": "http://public-domain.org", "thumbnail_url": "http://smallmedia.com/thumbnail.jpg", "release_time": 1556077748, "channel_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563", "channel_account_id": [], "preview": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "010000000171252460e7b80e9322754f87e4347673024d2b694112224296ca3a7f8cb55615010000006a47304402206f11a1308dae910bb4287c2859762497e9161c8dcb312bcb0252cac197a6cfc30220424e579e18fca567a9d6c2936308509cfc6916fc65c5e6317d1cb9e484c925ee012102524cad23857f174ad7e97e97fbc9f596ced488b77a29ae066dd2a3fc22ca1e8effffffff0200e1f50500000000fdcb01b50b626c616e6b2d696d6167654da0010163e5f11888e87965a10c5ec2082b2bd3808d19fbd7fda992806cb663c29d21fa3a89306fc9e617d19fb9abcfb3782e03ff5beac4b7d2bea1b0d24e194f67ee2f093b72fed1293c8a4797645fbb51aab6b72133cc0ad5010a720a2006003bbee8aece0543ed9d9cecc48be1d996cfeff9837a1aed1d961caeda82af120f746d7035797638303232362e706e6718632209696d6167652f706e67323035d91c4edf495755035bb2848534aa39c9ad6be074f80372349c6aed57e1edba29975b778d35f3e0fbd9882f3454305d120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728b4b9ffe5053222080112196fb4d5a2966ee28e029833ddb3d782b34ea785888723d7456d188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a914b4d5a2966ee28e029833ddb3d782b34ea785888788acac5e7d1d000000001976a9146e50b5b172504e208a2827917b8ad0325bc8dd6e88ac00000000",
    "inputs": [
      {
        "address": "msXA4CBXmL8rN4stfzYGiCjxNvLj8vEKb9",
        "amount": "5.969662",
        "confirmations": 2,
        "height": 213,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "txid": "1556b58c7f3aca9642221241692b4d02737634e4874f7522930eb8e760242571",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mx17rDC8WsYLF17x9MqDk79GFiUD3fbCeG",
        "amount": "1.0",
        "claim_id": "128e25d12ff779ff3098884a2a3eb2d4348069be",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "is_channel_signature_valid": true,
        "name": "blank-image",
        "nout": 0,
        "permanent_url": "blank-image#128e25d12ff779ff3098884a2a3eb2d4348069be",
        "signing_channel": {
          "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
          "name": "@channel",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
            "title": "New Channel"
          }
        },
        "txid": "d888fb7660b1dda1b2d112e52b45ffc8201fe2440e0952cd9b5cd95aa0223dc5",
        "type": "claim",
        "value": {
          "author": "Picaso",
          "description": "A blank PNG that is 5x7.",
          "fee": {
            "address": "mx17rDC8WsYLF17x9MqDk79GFiUD3fbCeG",
            "amount": 0.3,
            "currency": "LBC"
          },
          "image": {
            "height": 7,
            "width": 5
          },
          "languages": [
            "en"
          ],
          "license": "Public Domain",
          "license_url": "http://public-domain.org",
          "locations": [
            {
              "city": "Manchester",
              "country": "US",
              "state": "NH"
            }
          ],
          "release_time": "1556077748",
          "source": {
            "hash": "06003bbee8aece0543ed9d9cecc48be1d996cfeff9837a1aed1d961caeda82af",
            "media_type": "image/png",
            "name": "tmp5yv80226.png",
            "sd_hash": "35d91c4edf495755035bb2848534aa39c9ad6be074f80372349c6aed57e1edba29975b778d35f3e0fbd9882f3454305d",
            "size": "99"
          },
          "stream_type": "image",
          "tags": [
            "blank",
            "art"
          ],
          "thumbnail": {
            "url": "http://smallmedia.com/thumbnail.jpg"
          },
          "title": "Blank Image"
        },
        "value_type": "stream"
      },
      {
        "address": "mqaFJy11HUVjgpEe5ZxxCpB6jvN8RUWSGa",
        "amount": "4.947555",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "txid": "d888fb7660b1dda1b2d112e52b45ffc8201fe2440e0952cd9b5cd95aa0223dc5",
        "type": "payment"
      }
    ],
    "total_fee": "0.022107",
    "total_input": "5.969662",
    "total_output": "5.947555",
    "txid": "d888fb7660b1dda1b2d112e52b45ffc8201fe2440e0952cd9b5cd95aa0223dc5"
  }
}

stream_list

List my stream claims.

Arguments

  • account_id
    optionalstr
    id of the account to query
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

{
    "page": "Page number of the current items.",
    "page_size": "Number of items to show on a page.",
    "total_pages": "Total number of pages.",
    "items": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ]
}

List all your stream claims


curl -d'{"method": "stream_list", "params": {}}' http://localhost:5279/
lbrynet stream list
requests.post("http://localhost:5279", json={"method": "stream_list", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": [
    {
      "address": "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
      "amount": "1.0",
      "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
      "claim_op": "update",
      "confirmations": 1,
      "height": 214,
      "is_change": false,
      "is_channel_signature_valid": true,
      "is_mine": true,
      "name": "astream",
      "nout": 0,
      "permanent_url": "astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
      "signing_channel": {
        "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
        "name": "@channel",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
          "title": "New Channel"
        }
      },
      "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
      "type": "claim",
      "value": {
        "source": {
          "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
          "media_type": "application/octet-stream",
          "name": "tmpgj4k6kov",
          "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
          "size": "11"
        }
      },
      "value_type": "stream"
    }
  ]
}

Paginate your stream claims


curl -d'{"method": "stream_list", "params": {"page": 1, "page_size": 20}}' http://localhost:5279/
lbrynet stream list --page=1 --page_size=20
requests.post("http://localhost:5279", json={"method": "stream_list", "params": {"page": 1, "page_size": 20}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
        "amount": "1.0",
        "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_change": false,
        "is_channel_signature_valid": true,
        "is_mine": true,
        "name": "astream",
        "nout": 0,
        "permanent_url": "astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "signing_channel": {
          "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
          "name": "@channel",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
            "title": "New Channel"
          }
        },
        "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
        "type": "claim",
        "value": {
          "source": {
            "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
            "media_type": "application/octet-stream",
            "name": "tmpgj4k6kov",
            "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
            "size": "11"
          }
        },
        "value_type": "stream"
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_pages": 1
  }
}

stream_update

Update an existing stream claim and if a new file is provided announce it to lbrynet.

Arguments

  • claim_id
    str
    id of the stream claim to update
  • bid
    optionaldecimal
    amount to back the claim
  • file_path
    optionalstr
    path to file to be associated with name.
  • file_name
    optionalstr
    override file name, defaults to name from file_path.
  • file_size
    optionalstr
    override file size, otherwise automatically computed.
  • file_hash
    optionalstr
    override file hash, otherwise automatically computed.
  • fee_currency
    optionalstring
    specify fee currency
  • fee_amount
    optionaldecimal
    content download fee
  • fee_address
    optionalstr
    address where to send fee payments, will use value from --claim_address if not provided
  • title
    optionalstr
    title of the publication
  • description
    optionalstr
    description of the publication
  • author
    optionalstr
    author of the publication. The usage for this field is not the same as for channels. The author field is used to credit an author who is not the publisher and is not represented by the channel. For example, a pdf file of 'The Odyssey' has an author of 'Homer' but may by published to a channel such as '@classics', or to no channel at all
  • clear_tags
    optionalbool
    clear existing tags (prior to adding new ones)
  • tags
    optionallist
    add content tags
  • clear_languages
    optionalbool
    clear existing languages (prior to adding new ones)
  • languages
    optionallist
    languages used by the channel, using RFC 5646 format, eg: for English `--languages=en` for Spanish (Spain) `--languages=es-ES` for Spanish (Mexican) `--languages=es-MX` for Chinese (Simplified) `--languages=zh-Hans` for Chinese (Traditional) `--languages=zh-Hant`
  • clear_locations
    optionalbool
    clear existing locations (prior to adding new ones)
  • locations
    optionallist
    locations relevant to the stream, consisting of 2 letter `country` code and a `state`, `city` and a postal `code` along with a `latitude` and `longitude`. for JSON RPC: pass a dictionary with aforementioned attributes as keys, eg: ... "locations": [{'country': 'US', 'state': 'NH'}] ... for command line: pass a colon delimited list with values in the following order: "COUNTRY:STATE:CITY:CODE:LATITUDE:LONGITUDE" making sure to include colon for blank values, for example to provide only the city: ... --locations="::Manchester" with all values set: ... --locations="US:NH:Manchester:03101:42.990605:-71.460989" optionally, you can just pass the "LATITUDE:LONGITUDE": ... --locations="42.990605:-71.460989" finally, you can also pass JSON string of dictionary on the command line as you would via JSON RPC ... --locations="{'country': 'US', 'state': 'NH'}"
  • license
    optionalstr
    publication license
  • license_url
    optionalstr
    publication license url
  • thumbnail_url
    optionalstr
    thumbnail url
  • release_time
    optionalint
    original public release of content, seconds since UNIX epoch
  • width
    optionalint
    image/video width, automatically calculated from media file
  • height
    optionalint
    image/video height, automatically calculated from media file
  • duration
    optionalint
    audio/video duration in seconds, automatically calculated
  • channel_id
    optionalstr
    claim id of the publisher channel
  • clear_channel
    optionalbool
    remove channel signature
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.
  • account_id
    optionalstr
    account to use for funding the transaction
  • claim_address
    optionalstr
    address where the claim is sent to, if not specified it will be determined automatically from the account
  • preview
    optionalbool
    do not broadcast the transaction

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}

Update a stream claim to add channel


curl -d'{"method": "stream_update", "params": {"claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45", "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "channel_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563", "clear_channel": false, "channel_account_id": [], "preview": false}}' http://localhost:5279/
lbrynet stream update dfb3809e63cc75981fd7880faa5b7b7b50faeb45 --channel_id="fb198d80d32b2b08c25e0ca16579e88818f1e563"
requests.post("http://localhost:5279", json={"method": "stream_update", "params": {"claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45", "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "channel_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563", "clear_channel": false, "channel_account_id": [], "preview": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "010000000271252460e7b80e9322754f87e4347673024d2b694112224296ca3a7f8cb55615000000006b4830450221009e2c7b4c7acdd753cd4bb1c8894e2eb0e65d493e8abbccbe9f4552e4a292b1d10220721ea82b807c784c8ff7ea0850946e4f528197109a6c40fce83b1b30f7040d6101210302d139172070e4e765e43a5f7a538c7e65c34778bbfa3f8074cc21373cc4c7cdffffffffbf5dd4f0eac2aee7393d2567e2cdb9b29a8cf0d2d34c3dd432c70016c3f50bee010000006b483045022100ffb1b1be0ba60221e478d2d52567c0c5315de4232fafb88ba0643d25d80f38380220204ee4bccd8cb3a7dfd3d7a422bdbb83c760f4aa1cc25ede8a0c08eab14eef12012102b432f0cbf9f17e911390c6d3d4e4ff0b4f9d421019da92952dd8f6853af74cf7ffffffff0200e1f50500000000fd1101b7076173747265616d1445ebfa507b7b5baa0f88d71f9875cc639e80b3df4cd60163e5f11888e87965a10c5ec2082b2bd3808d19fb7ac4b03623e50c0b4f0f9722fda4bd5bc277abf48c10d2ff230a5585b0cb35ef537e13dc76030f1e3cc2aff62892ccbb0b54b24bd4dace2600841745c1626d3e0a7f0a7d0a20b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9120b746d70676a346b366b6f76180b22186170706c69636174696f6e2f6f637465742d73747265616d323018a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb526d6d76a9141817356204800526abb02896e6d34aedf84bf70188acb6a3d205000000001976a91479d0c638dde9823550909343a6ead98e5a7270f888ac00000000",
    "inputs": [
      {
        "address": "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
        "amount": "1.0",
        "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "claim_op": "create",
        "confirmations": 1,
        "height": 213,
        "is_change": false,
        "is_mine": true,
        "name": "astream",
        "nout": 0,
        "permanent_url": "astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "txid": "1556b58c7f3aca9642221241692b4d02737634e4874f7522930eb8e760242571",
        "type": "claim",
        "value": {
          "source": {
            "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
            "media_type": "application/octet-stream",
            "name": "tmpgj4k6kov",
            "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
            "size": "11"
          }
        },
        "value_type": "stream"
      },
      {
        "address": "mvWP7gJXqukpvDj797FrYYKBAA9jHDdxUC",
        "amount": "0.9772285",
        "confirmations": 3,
        "height": 211,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "txid": "ee0bf5c31600c732d43d4cd3d2f08c9ab2b9cde267253d39e7aec2eaf0d45dbf",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mhiLKDQQ6s4uMrSwZAt8gKzZ31cxuXgKG2",
        "amount": "1.0",
        "claim_id": "dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "claim_op": "update",
        "confirmations": -2,
        "height": -2,
        "is_channel_signature_valid": true,
        "name": "astream",
        "nout": 0,
        "permanent_url": "astream#dfb3809e63cc75981fd7880faa5b7b7b50faeb45",
        "signing_channel": {
          "claim_id": "fb198d80d32b2b08c25e0ca16579e88818f1e563",
          "name": "@channel",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ea064c953455ccef391a686d8bcb204b5cad8fa03e27349fdb827f5ab3df16b8b65b2bccac40c5d41e2e73bed7f19cddeb34f577fb23a0b3bbac910f5e5217bc",
            "title": "New Channel"
          }
        },
        "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
        "type": "claim",
        "value": {
          "source": {
            "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
            "media_type": "application/octet-stream",
            "name": "tmpgj4k6kov",
            "sd_hash": "18a1c8745b9f3b23059adbb3a128b633d4ee44da0cb6321c2e35882bcbf8b399c5ada2a7ed3def1e21419c7b9b06bb52",
            "size": "11"
          }
        },
        "value_type": "stream"
      },
      {
        "address": "mrd4AA9ZWcwgwDJtrUYtVjneQGTfdXZNpa",
        "amount": "0.9769055",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201",
        "type": "payment"
      }
    ],
    "total_fee": "0.000323",
    "total_input": "1.9772285",
    "total_output": "1.9769055",
    "txid": "3d82afe6c87d077053b8b278fd8002710f698e67d99b596886ef87174b8a3201"
  }
}

support_abandon

Abandon supports, including tips, of a specific claim, optionally keeping some amount as supports.

Arguments

  • claim_id
    optionalstr
    claim_id of the claim to abandon
  • txid
    optionalstr
    txid of the claim to abandon
  • nout
    optionalint
    nout of the claim to abandon
  • keep
    optionaldecimal
    amount of lbc to keep as support
  • account_id
    optionalstr
    id of the account to use
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until abandon is in mempool

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}
// example(s) to come later

support_create

Create a support or a tip for name claim.

Arguments

  • claim_id
    str
    claim_id of the claim to support
  • amount
    decimal
    amount of support
  • tip
    optionalbool
    send support to claim owner, default: false.
  • account_id
    optionalstr
    id of the account to use
  • preview
    optionalbool
    do not broadcast the transaction

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}
// example(s) to come later

support_list

List supports and tips in my control.

Arguments

  • account_id
    optionalstr
    id of the account to query
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

{
    "page": "Page number of the current items.",
    "page_size": "Number of items to show on a page.",
    "total_pages": "Total number of pages.",
    "items": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ]
}
// example(s) to come later

sync_apply

Apply incoming synchronization data, if provided, and then produce a sync hash and an encrypted wallet.

Arguments

  • password
    optionalstr
    password to decrypt incoming and encrypt outgoing data
  • data
    optionalstr
    incoming sync data, if any
  • encrypt-password
    optionalstr
    password to encrypt outgoing data if different from the decrypt password, used during password changes

Returns

(map) sync hash and data
// example(s) to come later

sync_hash

Deterministic hash of the wallet.

Arguments

Returns

(str) sha256 hash of wallet
// example(s) to come later

transaction_list

List transactions belonging to wallet

Arguments

  • account_id
    optionalstr
    id of the account to query
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

(list) List of transactions

{
    "claim_info": (list) claim info if in txn [{
                                            "address": (str) address of claim,
                                            "balance_delta": (float) bid amount,
                                            "amount": (float) claim amount,
                                            "claim_id": (str) claim id,
                                            "claim_name": (str) claim name,
                                            "nout": (int) nout
                                            }],
    "abandon_info": (list) abandon info if in txn [{
                                            "address": (str) address of abandoned claim,
                                            "balance_delta": (float) returned amount,
                                            "amount": (float) claim amount,
                                            "claim_id": (str) claim id,
                                            "claim_name": (str) claim name,
                                            "nout": (int) nout
                                            }],
    "confirmations": (int) number of confirmations for the txn,
    "date": (str) date and time of txn,
    "fee": (float) txn fee,
    "support_info": (list) support info if in txn [{
                                            "address": (str) address of support,
                                            "balance_delta": (float) support amount,
                                            "amount": (float) support amount,
                                            "claim_id": (str) claim id,
                                            "claim_name": (str) claim name,
                                            "is_tip": (bool),
                                            "nout": (int) nout
                                            }],
    "timestamp": (int) timestamp,
    "txid": (str) txn id,
    "update_info": (list) update info if in txn [{
                                            "address": (str) address of claim,
                                            "balance_delta": (float) credited/debited
                                            "amount": (float) absolute amount,
                                            "claim_id": (str) claim id,
                                            "claim_name": (str) claim name,
                                            "nout": (int) nout
                                            }],
    "value": (float) value of txn
}

List your transactions


curl -d'{"method": "transaction_list", "params": {}}' http://localhost:5279/
lbrynet transaction list
requests.post("http://localhost:5279", json={"method": "transaction_list", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": [
    {
      "abandon_info": [],
      "claim_info": [],
      "confirmations": 1,
      "date": "2019-04-23 23:49",
      "fee": "-0.000124",
      "support_info": [],
      "timestamp": 1556077772,
      "txid": "eb74d8df69334bb492848f9dedb7255e72b686ba91e60568f3a3db49522110ae",
      "update_info": [],
      "value": "-2.0"
    },
    {
      "abandon_info": [],
      "claim_info": [],
      "confirmations": 7,
      "date": "2019-04-23 23:49",
      "fee": "0.0",
      "support_info": [],
      "timestamp": 1556077771,
      "txid": "a100fca78e5224d2f74ef4cb29192cf7fb853a7839783b4a497bb5f38f000acf",
      "update_info": [],
      "value": "10.0"
    }
  ]
}

transaction_show

Get a decoded transaction from a txid

Arguments

  • txid
    str
    txid of the transaction

Returns

{
    "txid": "hash of transaction in hex",
    "height": "block where transaction was recorded",
    "inputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "outputs": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}
// example(s) to come later

utxo_list

List unspent transaction outputs

Arguments

  • account_id
    optionalstr
    id of the account to query
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

{
    "page": "Page number of the current items.",
    "page_size": "Number of items to show on a page.",
    "total_pages": "Total number of pages.",
    "items": [
        {
            "txid": "hash of transaction in hex",
            "nout": "position in the transaction",
            "height": "block where transaction was recorded",
            "amount": "value of the txo as a decimal",
            "address": "address of who can spend the txo",
            "confirmations": "number of confirmed blocks",
            "is_change": "payment to change address, only available when it can be determined",
            "is_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'payment'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim' or 'support', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid"
        }
    ]
}
// example(s) to come later

utxo_release

When spending a UTXO it is locally locked to prevent double spends; occasionally this can result in a UTXO being locked which ultimately did not get spent (failed to broadcast, spend transaction was not accepted by blockchain node, etc). This command releases the lock on all UTXOs in your account.

Arguments

  • account_id
    optionalstr
    id of the account to query

Returns

None
// example(s) to come later