lbry-sdk v0.38.1

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-sdk

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, overrides the stream file name
  • download_directory
    optionalstr
    full path to the directory to download into
  • timeout
    optionalint
    download timeout in number of seconds
  • save_file
    optionalbool
    save the file to the downloads directory

Returns

{
    "streaming_url": "(str) url to stream the file using range requests",
    "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#5d64500fb723eded83a41b0d5055f1783f019191"}}' http://localhost:5279/
lbrynet get astream#5d64500fb723eded83a41b0d5055f1783f019191
requests.post("http://localhost:5279", json={"method": "get", "params": {"uri": "astream#5d64500fb723eded83a41b0d5055f1783f019191"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "blobs_completed": 1,
    "blobs_in_stream": 1,
    "blobs_remaining": 0,
    "channel_claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
    "channel_name": "@channel",
    "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
    "claim_name": "astream",
    "completed": true,
    "confirmations": 3,
    "content_fee": null,
    "download_directory": "/tmp/tmpfjnst0c0",
    "download_path": "/tmp/tmpfjnst0c0/tmpzj1qbxfj",
    "file_name": "tmpzj1qbxfj",
    "height": 214,
    "key": "e8b365259d5b8644a6a1eb5d2f77459f",
    "metadata": {
      "source": {
        "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
        "media_type": "application/octet-stream",
        "name": "tmpzj1qbxfj",
        "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
        "size": "11"
      },
      "stream_type": "binary"
    },
    "mime_type": "application/octet-stream",
    "nout": 0,
    "outpoint": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e:0",
    "points_paid": 0.0,
    "protobuf": "015e32d5a47f2cd3e1242457498c97578d4594d77ee519fc56b21384e97c75d5c1b6450f2138e209f7bbd2adb588609ba36d1982a2187070c391a89793a0b569f09fef656fe041eab1809e3964f6346ae0fb3d20f30a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707a6a31716278666a180b22186170706c69636174696f6e2f6f637465742d73747265616d3230d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
    "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
    "status": "finished",
    "stopped": true,
    "stream_hash": "8b7dee36b0985027ad1476590ee5759359b57e4cb6507d5288ffe1508c32177f5a39ef20772cf90da72987f6f55ce1ba",
    "stream_name": "tmpzj1qbxfj",
    "streaming_url": "http://localhost:5280/stream/d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
    "suggested_file_name": "tmpzj1qbxfj",
    "timestamp": 1561485090,
    "total_bytes": 16,
    "total_bytes_lower_bound": 0,
    "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
    "written_bytes": 11
  }
}

publish

Create or replace 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
  • 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_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
  • blocking
    optionalbool
    wait until transaction 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"
}

Publish a file


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "01000000010f6edeb77e3d75b4cdfd5704e4d14ff2fa21948a5b26335aa3e69c8749d6a662010000006b483045022100d85e9ac9781bbaab17e5001055399ecd14b2a31077475734b6a6ccc7e668250e02200d6649e3deea9ca557aa897a32312aed841c56d94d095062c390b718f83e4ea0012102eea5cb67d3c756c1de57f503d4899d9560f1c689c38dfa9339d8020c04cf60e6ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706a3072646a716337180b22186170706c69636174696f6e2f6f637465742d73747265616d32303f3b7f11e1ab2ce9c763196d320ec2b73bb7a9acad3f98cea94a37ccce30caa28bba70bb3931d521865c614e9012d88e6d7576a914e88e2124fffc9da0cfd28a92a92670443b4376b188ace0b46217000000001976a9143347a928ed9f8ad71955c09ecfa305efe4590cbe88ac00000000",
    "inputs": [
      {
        "address": "mgTdmr4kSe4jjBaQZwE3ar4Kb7XcZBqmZT",
        "amount": "4.947555",
        "confirmations": 4,
        "height": 215,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1561485090,
        "txid": "62a6d649879ce6a35a33265b8a9421faf24fd1e40457fdcdb4753d7eb7de6e0f",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "n2ibKtRbM8hdvp5EafkSAHBxbpBJ2CWWEV",
        "amount": "1.0",
        "claim_id": "74c583fc2e08061d6c32152cbdb86b09c483d3fc",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "meta": {},
        "name": "a-new-stream",
        "normalized_name": "a-new-stream",
        "nout": 0,
        "permanent_url": "lbry://a-new-stream#74c583fc2e08061d6c32152cbdb86b09c483d3fc",
        "timestamp": null,
        "txid": "075ecb8118f2fe73a34683b574bb1be7a13d915ab14f3917a72c1d7e57abca1a",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmpj0rdjqc7",
            "sd_hash": "3f3b7f11e1ab2ce9c763196d320ec2b73bb7a9acad3f98cea94a37ccce30caa28bba70bb3931d521865c614e9012d88e",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      },
      {
        "address": "mkC6bv4hVXEKkjYzbHrZAJ6iZxHU7kyspa",
        "amount": "3.923448",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "075ecb8118f2fe73a34683b574bb1be7a13d915ab14f3917a72c1d7e57abca1a",
        "type": "payment"
      }
    ],
    "total_fee": "0.024107",
    "total_input": "4.947555",
    "total_output": "4.923448",
    "txid": "075ecb8118f2fe73a34683b574bb1be7a13d915ab14f3917a72c1d7e57abca1a"
  }
}

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,
            'confirmations': (int) claim depth,
            'timestamp': (int) timestamp of the block that included this claim tx,
            '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#5d64500fb723eded83a41b0d5055f1783f019191"]}}' http://localhost:5279/
lbrynet resolve astream#5d64500fb723eded83a41b0d5055f1783f019191
requests.post("http://localhost:5279", json={"method": "resolve", "params": {"urls": ["astream#5d64500fb723eded83a41b0d5055f1783f019191"]}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "astream#5d64500fb723eded83a41b0d5055f1783f019191": {
      "address": "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
      "amount": "1.0",
      "canonical_url": "lbry://@channel#7/astream#5",
      "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
      "claim_op": "update",
      "confirmations": 3,
      "height": 214,
      "is_channel_signature_valid": true,
      "meta": {
        "activation_height": 213,
        "creation_height": 213,
        "creation_timestamp": 1561485090,
        "effective_amount": "1.0",
        "expiration_height": 263187,
        "is_controlling": true,
        "support_amount": "0.0",
        "take_over_height": 213,
        "trending_global": 0.0,
        "trending_group": 0,
        "trending_local": 0.0,
        "trending_mixed": 0.0
      },
      "name": "astream",
      "normalized_name": "astream",
      "nout": 0,
      "permanent_url": "lbry://astream#5d64500fb723eded83a41b0d5055f1783f019191",
      "short_url": "lbry://astream#5",
      "signing_channel": {
        "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
        "amount": "1.0",
        "canonical_url": "lbry://@channel#7",
        "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
        "claim_op": "update",
        "confirmations": 7,
        "height": 210,
        "meta": {
          "activation_height": 209,
          "claims_in_channel": 1,
          "creation_height": 209,
          "creation_timestamp": 1561485089,
          "effective_amount": "1.0",
          "expiration_height": 263183,
          "is_controlling": true,
          "support_amount": "0.0",
          "take_over_height": 209,
          "trending_global": 0.0,
          "trending_group": 0,
          "trending_local": 0.0,
          "trending_mixed": 0.0
        },
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
        "short_url": "lbry://@channel#7",
        "timestamp": 1561485089,
        "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
          "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
          "title": "New Channel"
        },
        "value_type": "channel"
      },
      "timestamp": 1561485090,
      "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
      "type": "claim",
      "value": {
        "source": {
          "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
          "media_type": "application/octet-stream",
          "name": "tmpzj1qbxfj",
          "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
          "size": "11"
        },
        "stream_type": "binary"
      },
      "value_type": "stream"
    }
  }
}

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,
        'connections': {
            'incoming_bps': {
                : (int) bytes per second received,
            },
            'outgoing_bps': {
                : (int) bytes per second sent,
            },
            'total_outgoing_mps': (float) megabytes per second sent,
            'total_incoming_mps': (float) megabytes per second received,
            'time': (float) timestamp
        }
    },
    '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": {
      "connections": {
        "incoming_bps": {},
        "outgoing_bps": {},
        "time": 174753.638136067,
        "total_incoming_mbs": 0.0,
        "total_outgoing_mbs": 0.0
      },
      "finished_blobs": 0
    },
    "connection_status": {
      "code": "connected",
      "message": "No connection problems detected"
    },
    "installation_id": "8pS8Qp6ZV2azEgMT9MqurqFyEhGFgtR8L8UEbYbdGnCyvSrWEDU3ND4UZKG2iSzQ1f",
    "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": "c432cf5e38130f7a6611b18078d8a4160c20481122e34b53c6e26e4831bc06c2",
      "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
{
    'processor': (str) processor type,
    'python_version': (str) python version,
    'platform': (str) platform string,
    'os_release': (str) os release string,
    'os_system': (str) os name,
    'lbrynet_version': (str) lbrynet version,
    'torba_version': (str) torba version,
    'build': (str) "dev" | "qa" | "rc" | "release",
}

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.38.0rc10",
    "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.3",
    "torba_version": "0.5.7"
  }
}

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": "admit whisper prosper true example brown sea sketch clarify pudding hen faith", "single_key": false}}' http://localhost:5279/
lbrynet account add "new account" --seed="admit whisper prosper true example brown sea sketch clarify pudding hen faith"
requests.post("http://localhost:5279", json={"method": "account_add", "params": {"account_name": "new account", "seed": "admit whisper prosper true example brown sea sketch clarify pudding hen faith", "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": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1561485056.9625015,
    "name": "new account",
    "private_key": "tprv8ZgxMBicQKsPfK8PpjVn9CX9dQbHu5cRhD6AB8kLNqJf7gckQYNRvtC4xawA34xQ7yQnUHkd6jwHCkZHVuY3s897sKyBHGGGWg8tokKkASU",
    "public_key": "tpubD6NzVbkrYhZ4YnABiPANYcBGCS7E4QoLGWgwTendo773xAsX2wC27Now8iQZ2kKbSq6GUaSDTV714e3Qxfdwsqh1dnYwbzUboTCqBSZ53gg",
    "seed": "admit whisper prosper true example brown sea sketch clarify pudding hen faith"
  }
}

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": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk"}}' http://localhost:5279/
lbrynet account balance "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk"
requests.post("http://localhost:5279", json={"method": "account_balance", "params": {"account_id": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk"}}).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": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1561485056.7929218,
    "name": "generated account",
    "private_key": "tprv8ZgxMBicQKsPfK8PpjVn9CX9dQbHu5cRhD6AB8kLNqJf7gckQYNRvtC4xawA34xQ7yQnUHkd6jwHCkZHVuY3s897sKyBHGGGWg8tokKkASU",
    "public_key": "tpubD6NzVbkrYhZ4YnABiPANYcBGCS7E4QoLGWgwTendo773xAsX2wC27Now8iQZ2kKbSq6GUaSDTV714e3Qxfdwsqh1dnYwbzUboTCqBSZ53gg",
    "seed": "admit whisper prosper true example brown sea sketch clarify pudding hen faith"
  }
}

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": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk", "amount": "2.0", "everything": false, "broadcast": true}}' http://localhost:5279/
lbrynet account fund --to_account="mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk" --amount=2.0 --broadcast
requests.post("http://localhost:5279", json={"method": "account_fund", "params": {"to_account": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk", "amount": "2.0", "everything": false, "broadcast": true}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001c0fc2691a44442cb2c1b48a27518be2ec79230a771ef1a7d1c9ce9b4f293a08f010000006a47304402203f2685e9fa15bd431e61d659e3abbc2d900f2ef04c15c1864456b449c068f55902205505b654acada67b154179f6329516212f9cf3df7fb39636a286121e540f87a80121031370fc0bbc4f99acf402e5d687e846666cc0e5d7467c83104874e238c6ee6d2dffffffff0200c2eb0b000000001976a91469dd5873a711b516c47a0227efda9132a805bb0288ac90d7ae2f000000001976a914ea36761adfb298e01c377eeeb93e3a03874f6de588ac00000000",
    "inputs": [
      {
        "address": "mjnGbmHPAUrnF2VmUqeDAZsSMHWbdmpfJ5",
        "amount": "10.0",
        "confirmations": 6,
        "height": 201,
        "is_change": false,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1561485088,
        "txid": "8fa093f2b4e99c1c7d1aef71a73092c72ebe1875a2481b2ccb4244a49126fcc0",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mqAiQYyqiqVWXaEYapnu5P49cnLvQdh11s",
        "amount": "2.0",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "0e071fe12cfda37fb80dd634afb1a44bcb861e2de16009ad5628cc7f74776634",
        "type": "payment"
      },
      {
        "address": "n2sMeyyRYF5btHqQTa8Y5eitMZ6pGEKRoE",
        "amount": "7.999876",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "0e071fe12cfda37fb80dd634afb1a44bcb861e2de16009ad5628cc7f74776634",
        "type": "payment"
      }
    ],
    "total_fee": "0.000124",
    "total_input": "10.0",
    "total_output": "9.999876",
    "txid": "0e071fe12cfda37fb80dd634afb1a44bcb861e2de16009ad5628cc7f74776634"
  }
}

Spread LBC between multiple addresses


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001346677747fcc2856ad0960e12d1e86cb4ba4b1af34d60db87fa3fd2ce11f070e000000006b483045022100f03612c9d7c7e011b8f1cb72726cf1f4fb7b9841c0a353df3af355ce299b5ce2022049a9bd4e5c2708c8f13218610b30ad1948e742e6afb892c92ce6577aba44af6001210342bb0577c9c1f33257bcd8bfb791b3cf8f4dae24d37e0a2e17b8a8cc6d446a76ffffffff03c0687804000000001976a9148f7781bf51d1a0f5f75f498ebeb742c0b556cca388acc0687804000000001976a9148f7781bf51d1a0f5f75f498ebeb742c0b556cca388ac6cb9fa02000000001976a91426551ba83e54370b9bfe7e00f950d9b0e63bc40788ac00000000",
    "inputs": [
      {
        "address": "mqAiQYyqiqVWXaEYapnu5P49cnLvQdh11s",
        "amount": "2.0",
        "confirmations": 1,
        "height": 207,
        "is_change": true,
        "is_mine": true,
        "nout": 0,
        "timestamp": 1561485089,
        "txid": "0e071fe12cfda37fb80dd634afb1a44bcb861e2de16009ad5628cc7f74776634",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mtbY5xxTz94srMVzLYHZQZvfDGCub8xfTR",
        "amount": "0.75",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "f3ecdfab319d402d18e3b83ecff474c80b787ac10b79d8542c81ed10040e6202",
        "type": "payment"
      },
      {
        "address": "mtbY5xxTz94srMVzLYHZQZvfDGCub8xfTR",
        "amount": "0.75",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "f3ecdfab319d402d18e3b83ecff474c80b787ac10b79d8542c81ed10040e6202",
        "type": "payment"
      },
      {
        "address": "mj1dvkfJo289BLRNevo2j7kiFsJcYSdQtv",
        "amount": "0.499859",
        "confirmations": -2,
        "height": -2,
        "nout": 2,
        "timestamp": null,
        "txid": "f3ecdfab319d402d18e3b83ecff474c80b787ac10b79d8542c81ed10040e6202",
        "type": "payment"
      }
    ],
    "total_fee": "0.000141",
    "total_input": "2.0",
    "total_output": "1.999859",
    "txid": "f3ecdfab319d402d18e3b83ecff474c80b787ac10b79d8542c81ed10040e6202"
  }
}

Transfer all LBC to a specified account


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "010000000302620e0410ed812c54d8790bc17a780bc874f4cf3eb8e3182d409d31abdfecf3000000006a4730440220294fb6a9c2e72a48559546018a47b9809b6203d6557087fcb67836b8912c85dd0220186097a96551a014bfd997884dfaa15b6988adae64b723e5add723727ff1298801210337b6117f3a5fc40820b936e4b228d2576ce2f9a70a91228f71e6a967592572fcffffffff02620e0410ed812c54d8790bc17a780bc874f4cf3eb8e3182d409d31abdfecf3010000006a47304402203e6012c10ce76236b3685202ef4fe9ae6ce24ffd2b7f5648af5ba88d9f3ac56b022009ced72bc1ae82bf89acc2abe0b8e850467dd2814d680fd8a81dffce02a54f0901210337b6117f3a5fc40820b936e4b228d2576ce2f9a70a91228f71e6a967592572fcffffffff02620e0410ed812c54d8790bc17a780bc874f4cf3eb8e3182d409d31abdfecf3020000006b483045022100c75caa1826ede730b253d751ebd2164d40c74fb4724bc7d4d9a200325fefe7e70220262c74bcfacb214aa781d80775e39d35a396c1dda4453ddb470fc6cc0c3fb3c101210296295f9ab2bff497ac1e64d012d45d4d48a8f3bc8e926febacfe1d5e1a9cd01effffffff015027eb0b000000001976a914d15a521046fc425e25444798485573df4d2401ba88ac00000000",
    "inputs": [
      {
        "address": "mtbY5xxTz94srMVzLYHZQZvfDGCub8xfTR",
        "amount": "0.75",
        "confirmations": 1,
        "height": 208,
        "is_change": true,
        "is_mine": true,
        "nout": 0,
        "timestamp": 1561485089,
        "txid": "f3ecdfab319d402d18e3b83ecff474c80b787ac10b79d8542c81ed10040e6202",
        "type": "payment"
      },
      {
        "address": "mtbY5xxTz94srMVzLYHZQZvfDGCub8xfTR",
        "amount": "0.75",
        "confirmations": 1,
        "height": 208,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1561485089,
        "txid": "f3ecdfab319d402d18e3b83ecff474c80b787ac10b79d8542c81ed10040e6202",
        "type": "payment"
      },
      {
        "address": "mj1dvkfJo289BLRNevo2j7kiFsJcYSdQtv",
        "amount": "0.499859",
        "confirmations": 1,
        "height": 208,
        "is_change": true,
        "is_mine": true,
        "nout": 2,
        "timestamp": 1561485089,
        "txid": "f3ecdfab319d402d18e3b83ecff474c80b787ac10b79d8542c81ed10040e6202",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mzbuijFAnVGiEKWb9n24hcrUgdxauR3i83",
        "amount": "1.999604",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "c5e686d1617e9bc0ee1d4d14e1b7f211985db09c839e307a7876b1df1acfd15d",
        "type": "payment"
      }
    ],
    "total_fee": "0.000255",
    "total_input": "1.999859",
    "total_output": "1.999604",
    "txid": "c5e686d1617e9bc0ee1d4d14e1b7f211985db09c839e307a7876b1df1acfd15d"
  }
}

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": "mvuCTbTWTnF7u2vh3raaxSuR8Rd4hPGqs9",
        "is_default": true,
        "name": "Account #mvuCTbTWTnF7u2vh3raaxSuR8Rd4hPGqs9",
        "public_key": "tpubD6NzVbkrYhZ4XQhwsZYqxyH3vVf4MHQoiF2xXS2xcmGC2Ejbvq5X7S3onhZhMH7c4pgbJiFPX8C36HWwFgHUaZygQeXKJWsyaAWWzYqWSJm",
        "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": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk"}}' http://localhost:5279/
lbrynet account remove mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk
requests.post("http://localhost:5279", json={"method": "account_remove", "params": {"account_id": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk"}}).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": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1561485056.7929218,
    "name": "generated account",
    "private_key": "tprv8ZgxMBicQKsPfK8PpjVn9CX9dQbHu5cRhD6AB8kLNqJf7gckQYNRvtC4xawA34xQ7yQnUHkd6jwHCkZHVuY3s897sKyBHGGGWg8tokKkASU",
    "public_key": "tpubD6NzVbkrYhZ4YnABiPANYcBGCS7E4QoLGWgwTendo773xAsX2wC27Now8iQZ2kKbSq6GUaSDTV714e3Qxfdwsqh1dnYwbzUboTCqBSZ53gg",
    "seed": "admit whisper prosper true example brown sea sketch clarify pudding hen faith"
  }
}

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": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk", "default": false, "change_max_uses": 10}}' http://localhost:5279/
lbrynet account set mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk --change_max_uses=10
requests.post("http://localhost:5279", json={"method": "account_set", "params": {"account_id": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk", "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": "mjy1nohNLnCRF9mcGM13RHwm4fPwp6hZDk",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1561485057.0708687,
    "name": "new account",
    "private_key": "tprv8ZgxMBicQKsPfK8PpjVn9CX9dQbHu5cRhD6AB8kLNqJf7gckQYNRvtC4xawA34xQ7yQnUHkd6jwHCkZHVuY3s897sKyBHGGGWg8tokKkASU",
    "public_key": "tpubD6NzVbkrYhZ4YnABiPANYcBGCS7E4QoLGWgwTendo773xAsX2wC27Now8iQZ2kKbSq6GUaSDTV714e3Qxfdwsqh1dnYwbzUboTCqBSZ53gg",
    "seed": "admit whisper prosper true example brown sea sketch clarify pudding hen faith"
  }
}

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": "mzPzDUvLyZUKv2LmQdMZAmd4ZNm1Xxgf1z"}}' http://localhost:5279/
lbrynet address is_mine mzPzDUvLyZUKv2LmQdMZAmd4ZNm1Xxgf1z
requests.post("http://localhost:5279", json={"method": "address_is_mine", "params": {"address": "mzPzDUvLyZUKv2LmQdMZAmd4ZNm1Xxgf1z"}}).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.",
    "total_items": "Total number of items.",
    "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": [
    "mjnGbmHPAUrnF2VmUqeDAZsSMHWbdmpfJ5",
    "mfsQtTpZgv9D1KzkgS6sgevuRD3TDpx4b8",
    "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
    "msaGdm9gRuVwbRPW47pL41hjuiT7xo2vRd",
    "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
    "n2aKiEgh36nK3xLr4C5vZzvj7hEuMhJWdb",
    "mfq8BbdBew1SdWUsK49XT863YobqKVheDy",
    "mzPzDUvLyZUKv2LmQdMZAmd4ZNm1Xxgf1z",
    "miLhR5kJLGVqi5Ss2VKT2Nxt4fToriqtX2",
    "mvrHAPqKaFJUVYXSqQS9MLWN7EHdAWArGJ",
    "mzZTN3wcKyqfLHL1bFAgGTqryHrJJshHPV",
    "mjgAKEpQjZVjvYsdHoRiucG6HfgTZxbfnD",
    "mkMSb7uWUMdGAQ3pnXjDgofyiVibmy2zw2",
    "n2ibKtRbM8hdvp5EafkSAHBxbpBJ2CWWEV",
    "mkaiNK23LKyWQqUxCYvk8KT1Bf7F5kccBV",
    "mr8ttV21zxBiiYeyHtWNfVo3dkgqJ9XtgP",
    "mvxcVQv1fJQGkJgCHxpRr15BzqKmTn9Jp2",
    "mmDrz35MC54Gqs12sxC48LcSsZiD6GRjvJ",
    "mq8DfGaa1vkw89tVaEaEgsQoHnkQdfwXBr",
    "mi9uQeFBjKe4EFze4gHvLVm9REepjj2qEm",
    "moXzxEEXj4nhGhnozbGGFqGXdEzysbDMHJ",
    "mgTdmr4kSe4jjBaQZwE3ar4Kb7XcZBqmZT",
    "moLhFf1vkeMKeMG3DAP1RTvbHDqSXha11K",
    "n2sMeyyRYF5btHqQTa8Y5eitMZ6pGEKRoE",
    "n2FNDLjvbu4dnW6pCtGKJN87PttvCeBWsR",
    "mwhWukDANoke2ikBrkj8u3kFdRh5YM2Xv7",
    "mzEZcphSw5ZUrEN3MpYmqRCEPBRS8iN34w"
  ]
}

List addresses in specified account


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

Output


{
  "jsonrpc": "2.0",
  "result": [
    "mkZ7dj4b1JzgEk1AbdaEKXRZMc3t1Qzz5s",
    "miLfQZNWVqDEDYz5fz2iKU9WryD883bsu3",
    "mkTBCWDfCkmBWY3GCxfPzLzv1nPrj42g9i",
    "mhxiYAHjBy565rG4utN5N7sqyfNedA8gMj",
    "mqAiQYyqiqVWXaEYapnu5P49cnLvQdh11s",
    "mfXqWw7JwDTjYS2RFPHQRRidRKh8kBQuDA",
    "mveVkYXt4i79j8LyVNmSQJRPbiC3D7qfUn",
    "n2FP55ZGxWni8yXXRkayaGtKjjCPgjosUg",
    "mjUP3SWW5xSQePxyvBJEojThw53p3stPGz",
    "mw9wNMarhPNHJZ3WpVYmQBwwSt6RHkKBaE",
    "mh7e4ooAELtxhKjtDLkw2GZMdefM8DSgWT",
    "mvQ8JJQ892fZugZNpKcQaTRry75GceWo41",
    "mySo8Q8qF66jan5ma2jsvkjjf7BNWyPUo8",
    "mppmfdJ3EwHNXRdf4qcEN48TQ2ydE9jjSH",
    "mwrS4yFmX5Na1cPRoQUWVBNhEpLh63Bn5j",
    "mqY3oET1RoUVT7VQPYjBX2atwbUZ43XSoT",
    "moCXqVgoM5EGyoxC9nZL6dkabSjE1TcTNu",
    "mvPxFaNfj6Ynp5bmVMtZzPiN27q8AvmmVS",
    "mr43PzgGuS1FxCbSjfKNdXsqxZV6hjawt3",
    "myuyATCL66mckzXzpiFzcFGQbzdYiQjLdt",
    "mrzft5H9sA6crxC7kzEUNBJiWzzAS3wKKH",
    "mnUVBfAM4BwEQq8fwJ7xuZgARrqkJwJhLc",
    "myvpjybXe9sV9bdAZX5uun7mk9tt8HDFrJ",
    "mvWm7QzWcD33rn5VZaQNzvWh89VZGYVpbd",
    "mzer6QqsQnsUZKYoCrrqVbQumXajXxbpzJ",
    "mhCtYeSBpXoQuEUitEeZjUpjRjje6LZmSL"
  ]
}

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": "mzPzDUvLyZUKv2LmQdMZAmd4ZNm1Xxgf1z"
}

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": "d4595a73a829c2a567a25ee1fa7ced42ae4d2d5fccc19126f01b8518537a386b6d20d611b35278afe6a5e193a762cd8c"}}' http://localhost:5279/
lbrynet blob delete d4595a73a829c2a567a25ee1fa7ced42ae4d2d5fccc19126f01b8518537a386b6d20d611b35278afe6a5e193a762cd8c
requests.post("http://localhost:5279", json={"method": "blob_delete", "params": {"blob_hash": "d4595a73a829c2a567a25ee1fa7ced42ae4d2d5fccc19126f01b8518537a386b6d20d611b35278afe6a5e193a762cd8c"}}).json()

Output


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

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": [
    "d4595a73a829c2a567a25ee1fa7ced42ae4d2d5fccc19126f01b8518537a386b6d20d611b35278afe6a5e193a762cd8c",
    "609e824398f24b7420f1febfc04e1a237364e4ed00fe46a1e936c3ee4926717e4c86ba66708cb78cb1c0c9d68f488396",
    "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
    "29d60d4ba62d33a280f448584fd825539f794943625101bd633b63b8f83c2e378a62765ca2e1a05dd720e762881519c2"
  ]
}

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": "7ed794458d57978c49572424e1d32c7fa4d5325e", "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet channel abandon 7ed794458d57978c49572424e1d32c7fa4d5325e
requests.post("http://localhost:5279", json={"method": "channel_abandon", "params": {"claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e", "preview": false, "blocking": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001faa6baadb0eb6080167de2226bab20cffb1426ea2e47f2d696280b9d3256720f000000006a47304402205287bb4f85eeb0f38defe91a27b871ff1b7ac94cda6e9885109f9d5ed6e03939022055dcf9daad53f145f464b8e5f6def71d564f3ebc99f882e1a7b0cd5d022b3e4d0121020cd9a5a73e65c43d276d79901f21b22d09f3872e97a9311ea27908142217f6f7ffffffff0134b7f505000000001976a914d4c63445bfef987db896a7835c90728ab7eb598888ac00000000",
    "inputs": [
      {
        "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
        "amount": "1.0",
        "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
        "claim_op": "update",
        "confirmations": 8,
        "height": 210,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
        "timestamp": 1561485089,
        "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
          "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
          "title": "New Channel"
        },
        "value_type": "channel"
      }
    ],
    "outputs": [
      {
        "address": "mzuzzC1LcwKoRaWEZcR2vcDaSxcakKTMR3",
        "amount": "0.999893",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "1384a1d6010d90d6d463cb63f1fe9b7cc8de70f62f62bf453c5a53cc05d85c22",
        "type": "payment"
      }
    ],
    "total_fee": "0.000107",
    "total_input": "1.0",
    "total_output": "0.999893",
    "txid": "1384a1d6010d90d6d463cb63f1fe9b7cc8de70f62f62bf453c5a53cc05d85c22"
  }
}

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 '@'
  • bid
    decimal
    amount to back the claim
  • allow_duplicate_name
    optionalbool
    create new channel even if one already exists with given name. default: false.
  • title
    optionalstr
    title of the publication
  • description
    optionalstr
    description of the publication
  • email
    optionalstr
    email of channel owner
  • website_url
    optionalstr
    website url
  • 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'}"
  • 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
  • blocking
    optionalbool
    wait until transaction 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"
}

Create a channel claim without metadata


curl -d'{"method": "channel_create", "params": {"name": "@channel", "bid": "1.0", "featured": [], "tags": [], "languages": [], "locations": [], "preview": false, "blocking": 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, "blocking": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001346677747fcc2856ad0960e12d1e86cb4ba4b1af34d60db87fa3fd2ce11f070e010000006a4730440220183a3e4c2025f45b083bc970e3437fb3deb14891c2f877697c008d0f5ea8f482022049ac41eefb4c6700e39e78175c9c50f8133a2316663ec127cf4fb9d4aa8a30eb012102ca7e8b7efe7723f0a68d28f38c5b220af9e53f1bc2d344fb458ca527da67cf8affffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae26d7576a914f4f607e8d47646250a79cfc9e57059e6ca8bb56688acc462a029000000001976a91457f3a42422174d5eb185b5bf049869a01db287c988ac00000000",
    "inputs": [
      {
        "address": "n2sMeyyRYF5btHqQTa8Y5eitMZ6pGEKRoE",
        "amount": "7.999876",
        "confirmations": 2,
        "height": 207,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1561485089,
        "txid": "0e071fe12cfda37fb80dd634afb1a44bcb861e2de16009ad5628cc7f74776634",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
        "amount": "1.0",
        "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
        "timestamp": null,
        "txid": "50e9f458f59f7ddb51c13e956b178ac9457e00e36bddfe02f6f48079d3e3f896",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
          "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW"
        },
        "value_type": "channel"
      },
      {
        "address": "moXzxEEXj4nhGhnozbGGFqGXdEzysbDMHJ",
        "amount": "6.983769",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "50e9f458f59f7ddb51c13e956b178ac9457e00e36bddfe02f6f48079d3e3f896",
        "type": "payment"
      }
    ],
    "total_fee": "0.016107",
    "total_input": "7.999876",
    "total_output": "7.983769",
    "txid": "50e9f458f59f7ddb51c13e956b178ac9457e00e36bddfe02f6f48079d3e3f896"
  }
}

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", "website_url": "http://smallmedia.com", "featured": [], "tags": ["music", "art"], "languages": ["pt-BR", "uk"], "locations": ["BR", "UA::Kiyv"], "thumbnail_url": "http://smallmedia.com/logo.jpg", "cover_url": "http://smallmedia.com/logo.jpg", "preview": false, "blocking": 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", "website_url": "http://smallmedia.com", "featured": [], "tags": ["music", "art"], "languages": ["pt-BR", "uk"], "locations": ["BR", "UA::Kiyv"], "thumbnail_url": "http://smallmedia.com/logo.jpg", "cover_url": "http://smallmedia.com/logo.jpg", "preview": false, "blocking": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001faa6baadb0eb6080167de2226bab20cffb1426ea2e47f2d696280b9d3256720f010000006a473044022061957aa9e53c7588f10eaf460686fd02ac447f91a5f5fc69b010a509ba7d99d802207be2706dd40cf990811ea5e1484502e29510c8c0d0b2368a79b2c6186f3002c90121039e6825507996b2a26d8f13aa036b7beaf1688dfa8d1323224ce52154183d3164ffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a034200042b3464f5e174daad84a899552847c9af4a4577bfc9e867402aa30da9a966ab493f7c82c30642aaa5dcfbdeebe9f3ab021f09964ad93bfecb9b9e3cac7a35c9fe121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a914cf1914f5cdcaf0d0ca01b53b7688dabea5cd9eb388ace221d305000000001976a9147d8fe8303a8d1506e3823e471e55ea128bfe637d88ac00000000",
    "inputs": [
      {
        "address": "n2FNDLjvbu4dnW6pCtGKJN87PttvCeBWsR",
        "amount": "1.9993355",
        "confirmations": 1,
        "height": 210,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1561485089,
        "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mzPzDUvLyZUKv2LmQdMZAmd4ZNm1Xxgf1z",
        "amount": "1.0",
        "claim_id": "9d667ca2325a93dfbab993f4e22f63ce529eae92",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "meta": {},
        "name": "@bigchannel",
        "normalized_name": "@bigchannel",
        "nout": 0,
        "permanent_url": "lbry://@bigchannel#9d667ca2325a93dfbab993f4e22f63ce529eae92",
        "timestamp": null,
        "txid": "aa003b09c9a280b34d3d790f7bca3a12a7b8f0473f476cc7bc81b3853acb8ab4",
        "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": "3056301006072a8648ce3d020106052b8104000a034200042b3464f5e174daad84a899552847c9af4a4577bfc9e867402aa30da9a966ab493f7c82c30642aaa5dcfbdeebe9f3ab021f09964ad93bfecb9b9e3cac7a35c9fe",
          "public_key_id": "mxN41g7KAmKtMbA1b25XgVWASvYVvKEcVW",
          "tags": [
            "music",
            "art"
          ],
          "thumbnail": {
            "url": "http://smallmedia.com/logo.jpg"
          },
          "title": "Big Channel",
          "website_url": "http://smallmedia.com"
        },
        "value_type": "channel"
      },
      {
        "address": "mrxs9s9nJgdvS6qW2ca4yr5UY6RkWS5zk9",
        "amount": "0.9772285",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "aa003b09c9a280b34d3d790f7bca3a12a7b8f0473f476cc7bc81b3853acb8ab4",
        "type": "payment"
      }
    ],
    "total_fee": "0.022107",
    "total_input": "1.9993355",
    "total_output": "1.9772285",
    "txid": "aa003b09c9a280b34d3d790f7bca3a12a7b8f0473f476cc7bc81b3853acb8ab4"
  }
}

channel_export

Export channel private key.

Arguments

  • channel_id
    str
    claim id of channel to export
  • channel_name
    optionalstr
    name of channel to export
  • account_id
    optionalstr
    one or more account ids for accounts to look in for channels, defaults to all accounts.

Returns

(str) serialized channel private key
// example(s) to come later

channel_import

Import serialized channel private key (to allow signing new streams to the channel)

Arguments

  • channel_data
    str
    serialized channel, as exported by channel export

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.",
    "total_items": "Total number of items.",
    "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": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
      "amount": "1.0",
      "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
      "claim_op": "create",
      "confirmations": 1,
      "height": 209,
      "is_change": false,
      "is_mine": true,
      "meta": {},
      "name": "@channel",
      "normalized_name": "@channel",
      "nout": 0,
      "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
      "timestamp": 1561485089,
      "txid": "50e9f458f59f7ddb51c13e956b178ac9457e00e36bddfe02f6f48079d3e3f896",
      "type": "claim",
      "value": {
        "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
        "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW"
      },
      "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": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
        "amount": "1.0",
        "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
        "claim_op": "create",
        "confirmations": 1,
        "height": 209,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
        "timestamp": 1561485089,
        "txid": "50e9f458f59f7ddb51c13e956b178ac9457e00e36bddfe02f6f48079d3e3f896",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
          "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW"
        },
        "value_type": "channel"
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_items": 1,
    "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
  • email
    optionalstr
    email of channel owner
  • website_url
    optionalstr
    website url
  • featured
    optionallist
    claim_ids of featured content in channel
  • clear_featured
    optionalbool
    clear existing featured content (prior to adding new ones)
  • tags
    optionallist
    add content tags
  • clear_tags
    optionalbool
    clear existing tags (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_languages
    optionalbool
    clear existing languages (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'}"
  • clear_locations
    optionalbool
    clear existing locations (prior to adding new ones)
  • 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
  • blocking
    optionalbool
    wait until transaction is in mempool
  • replace
    optionalbool
    instead of modifying specific values on the channel, this will clear all existing values and only save passed in values, useful for form submissions where all values are always set

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": "7ed794458d57978c49572424e1d32c7fa4d5325e", "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, "blocking": false, "replace": false}}' http://localhost:5279/
lbrynet channel update 7ed794458d57978c49572424e1d32c7fa4d5325e --title="New Channel"
requests.post("http://localhost:5279", json={"method": "channel_update", "params": {"claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e", "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, "blocking": false, "replace": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "010000000296f8e3d37980f4f602fedd6be3007e45c98a176b953ec151db7d9ff558f4e950000000006a473044022061d6150bc3b011aaea76878575017c4e5eb21fac6b8a4cbbee9c085bd33587d50220488279fbf29cc4cbbedf4203082a16ae48b966181fea88d5d30e3627f28811730121020cd9a5a73e65c43d276d79901f21b22d09f3872e97a9311ea27908142217f6f7ffffffff5dd1cf1adfb176787a309e839cb05d9811f2b7e1144d1deec09b7e61d186e6c5000000006a47304402205b253336e35c39d7bee5e39508281043e4b463cf1ad1f76dc244ee869ef185b502205891abd1fa4c637b43ae19dde8857e9fb09627a173e84ba6bd96dfc1d154a087012103398d533373ab8881bb7a9e1060284ce9afd4e25fcca09d30fcf41da9b809ff11ffffffff0200e1f50500000000a6b708406368616e6e656c145e32d5a47f2cd3e1242457498c97578d4594d77e4c6a00125a0a583056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2420b4e6577204368616e6e656c6d6d76a914f4f607e8d47646250a79cfc9e57059e6ca8bb56688ac6ebeea0b000000001976a914e367f3d29e8b54f79c92ec2cf83a79ca5e04c60688ac00000000",
    "inputs": [
      {
        "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
        "amount": "1.0",
        "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
        "claim_op": "create",
        "confirmations": 1,
        "height": 209,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
        "timestamp": 1561485089,
        "txid": "50e9f458f59f7ddb51c13e956b178ac9457e00e36bddfe02f6f48079d3e3f896",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
          "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW"
        },
        "value_type": "channel"
      },
      {
        "address": "mzbuijFAnVGiEKWb9n24hcrUgdxauR3i83",
        "amount": "1.999604",
        "confirmations": 1,
        "height": 209,
        "is_change": true,
        "is_mine": true,
        "nout": 0,
        "timestamp": 1561485089,
        "txid": "c5e686d1617e9bc0ee1d4d14e1b7f211985db09c839e307a7876b1df1acfd15d",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
        "amount": "1.0",
        "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
        "claim_op": "update",
        "confirmations": -2,
        "height": -2,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
        "timestamp": null,
        "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
          "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
          "title": "New Channel"
        },
        "value_type": "channel"
      },
      {
        "address": "n2FNDLjvbu4dnW6pCtGKJN87PttvCeBWsR",
        "amount": "1.9993355",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
        "type": "payment"
      }
    ],
    "total_fee": "0.0002685",
    "total_input": "2.999604",
    "total_output": "2.9993355",
    "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa"
  }
}

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.",
    "total_items": "Total number of items.",
    "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": "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
      "amount": "1.0",
      "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
      "claim_op": "update",
      "confirmations": 1,
      "height": 214,
      "is_change": false,
      "is_channel_signature_valid": true,
      "is_mine": true,
      "meta": {},
      "name": "astream",
      "normalized_name": "astream",
      "nout": 0,
      "permanent_url": "lbry://astream#5d64500fb723eded83a41b0d5055f1783f019191",
      "signing_channel": {
        "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
        "amount": "1.0",
        "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
        "claim_op": "update",
        "confirmations": 5,
        "height": 210,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
        "timestamp": 1561485089,
        "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
          "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
          "title": "New Channel"
        },
        "value_type": "channel"
      },
      "timestamp": 1561485090,
      "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
      "type": "claim",
      "value": {
        "source": {
          "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
          "media_type": "application/octet-stream",
          "name": "tmpzj1qbxfj",
          "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
          "size": "11"
        },
        "stream_type": "binary"
      },
      "value_type": "stream"
    },
    {
      "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
      "amount": "1.0",
      "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
      "claim_op": "update",
      "confirmations": 5,
      "height": 210,
      "is_change": false,
      "is_mine": true,
      "meta": {},
      "name": "@channel",
      "normalized_name": "@channel",
      "nout": 0,
      "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
      "timestamp": 1561485089,
      "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
      "type": "claim",
      "value": {
        "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
        "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
        "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": "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
        "amount": "1.0",
        "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_change": false,
        "is_channel_signature_valid": true,
        "is_mine": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#5d64500fb723eded83a41b0d5055f1783f019191",
        "signing_channel": {
          "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
          "amount": "1.0",
          "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
          "claim_op": "update",
          "confirmations": 5,
          "height": 210,
          "is_change": false,
          "is_mine": true,
          "meta": {},
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
          "timestamp": 1561485089,
          "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
            "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": 1561485090,
        "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmpzj1qbxfj",
            "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      },
      {
        "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
        "amount": "1.0",
        "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
        "claim_op": "update",
        "confirmations": 5,
        "height": 210,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
        "timestamp": 1561485089,
        "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
          "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
          "title": "New Channel"
        },
        "value_type": "channel"
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_items": 2,
    "total_pages": 1
  }
}

Search for stream and channel claims on the blockchain. Arguments marked with "supports equality constraints" allow prepending the value with an equality constraint such as '>', '>=', '<' and '<=' eg. --height=">400000" would limit results to only claims above 400k block height.

Arguments

  • name
    optionalstr
    claim name (normalized)
  • claim_id
    optionalstr
    full or partial claim id
  • txid
    optionalstr
    transaction id
  • nout
    optionalstr
    position in the transaction
  • channel
    optionalstr
    claims signed by this channel (argument is a URL which automatically gets resolved), see --channel_ids if you need to filter by multiple channels at the same time, includes claims with invalid signatures, use in conjunction with --valid_channel_signature
  • channel_ids
    optionalstr
    claims signed by any of these channels (arguments must be claim ids of the channels), includes claims with invalid signatures, implies --has_channel_signature, use in conjunction with --valid_channel_signature
  • not_channel_ids
    optionalstr
    exclude claims signed by any of these channels (arguments must be claim ids of the channels)
  • has_channel_signature
    optionalbool
    claims with a channel signature (valid or invalid)
  • valid_channel_signature
    optionalbool
    claims with a valid channel signature or no signature, use in conjunction with --has_channel_signature to only get claims with valid signatures
  • invalid_channel_signature
    optionalbool
    claims with invalid channel signature or no signature, use in conjunction with --has_channel_signature to only get claims with invalid signatures
  • is_controlling
    optionalbool
    winning claims of their respective name
  • public_key_id
    optionalstr
    only return channels having this public key id, this is the same key as used in the wallet file to map channel certificate private keys: {'public_key_id': 'private key'}
  • height
    optionalint
    last updated block height (supports equality constraints)
  • timestamp
    optionalint
    last updated timestamp (supports equality constraints)
  • creation_height
    optionalint
    created at block height (supports equality constraints)
  • creation_timestamp
    optionalint
    created at timestamp (supports equality constraints)
  • activation_height
    optionalint
    height at which claim starts competing for name (supports equality constraints)
  • expiration_height
    optionalint
    height at which claim will expire (supports equality constraints)
  • release_time
    optionalint
    limit to claims self-described as having been released to the public on or after this UTC timestamp, when claim does not provide a release time the publish time is used instead (supports equality constraints)
  • amount
    optionalint
    limit by claim value (supports equality constraints)
  • support_amount
    optionalint
    limit by supports and tips recieved (supports equality constraints)
  • effective_amount
    optionalint
    limit by total value (initial claim value plus all tips and supports received), this amount is blank until claim has reached activation height (supports equality constraints)
  • trending_group
    optionalint
    group numbers 1 through 4 representing the trending groups of the content: 4 means content is trending globally and independently, 3 means content is not trending globally but is trending independently (locally), 2 means it is trending globally but not independently and 1 means it's not trending globally or locally (supports equality constraints)
  • trending_mixed
    optionalint
    trending amount taken from the global or local value depending on the trending group: 4 - global value, 3 - local value, 2 - global value, 1 - local value (supports equality constraints)
  • trending_local
    optionalint
    trending value calculated relative only to the individual contents past history (supports equality constraints)
  • trending_global
    optionalint
    trending value calculated relative to all trending content globally (supports equality constraints)
  • claim_type
    optionalstr
    filter by 'channel', 'stream' or 'unknown'
  • stream_types
    optionallist
    filter by 'video', 'image', 'document', etc
  • media_types
    optionallist
    filter by 'video/mp4', 'image/png', etc
  • fee_currency
    optionalstring
    specify fee currency: LBC, BTC, USD
  • fee_amount
    optionaldecimal
    content download fee (supports equality constraints)
  • any_tags
    optionallist
    find claims containing any of the tags
  • all_tags
    optionallist
    find claims containing every tag
  • not_tags
    optionallist
    find claims not containing any of these tags
  • any_languages
    optionallist
    find claims containing any of the languages
  • all_languages
    optionallist
    find claims containing every language
  • not_languages
    optionallist
    find claims not containing any of these languages
  • any_locations
    optionallist
    find claims containing any of the locations
  • all_locations
    optionallist
    find claims containing every location
  • not_locations
    optionallist
    find claims not containing any of these locations
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination
  • order_by
    optionalstr
    field to order by, default is descending order, to do an ascending order prepend ^ to the field name, eg. '^amount' available fields: 'name', 'height', 'release_time', 'publish_time', 'amount', 'effective_amount', 'support_amount', 'trending_group', 'trending_mixed', 'trending_local', 'trending_global', 'activation_height'

Returns

{
    "page": "Page number of the current items.",
    "page_size": "Number of items to show on a page.",
    "total_pages": "Total number of pages.",
    "total_items": "Total number of items.",
    "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": "@channel", "channel_ids": [], "not_channel_ids": [], "has_channel_signature": false, "valid_channel_signature": false, "invalid_channel_signature": false, "is_controlling": false, "stream_types": [], "media_types": [], "any_tags": [], "all_tags": [], "not_tags": [], "any_languages": [], "all_languages": [], "not_languages": [], "any_locations": [], "all_locations": [], "not_locations": [], "order_by": []}}' http://localhost:5279/
lbrynet claim search --channel=@channel
requests.post("http://localhost:5279", json={"method": "claim_search", "params": {"channel": "@channel", "channel_ids": [], "not_channel_ids": [], "has_channel_signature": false, "valid_channel_signature": false, "invalid_channel_signature": false, "is_controlling": false, "stream_types": [], "media_types": [], "any_tags": [], "all_tags": [], "not_tags": [], "any_languages": [], "all_languages": [], "not_languages": [], "any_locations": [], "all_locations": [], "not_locations": [], "order_by": []}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
        "amount": "1.0",
        "canonical_url": "lbry://@channel#7/astream#5",
        "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_channel_signature_valid": true,
        "meta": {
          "activation_height": 213,
          "creation_height": 213,
          "creation_timestamp": 1561485090,
          "effective_amount": "1.0",
          "expiration_height": 263187,
          "is_controlling": true,
          "support_amount": "0.0",
          "take_over_height": 213,
          "trending_global": 0.0,
          "trending_group": 0,
          "trending_local": 0.0,
          "trending_mixed": 0.0
        },
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#5d64500fb723eded83a41b0d5055f1783f019191",
        "short_url": "lbry://astream#5",
        "signing_channel": {
          "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
          "amount": "1.0",
          "canonical_url": "lbry://@channel#7",
          "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
          "claim_op": "update",
          "confirmations": 5,
          "height": 210,
          "meta": {
            "activation_height": 209,
            "claims_in_channel": 1,
            "creation_height": 209,
            "creation_timestamp": 1561485089,
            "effective_amount": "1.0",
            "expiration_height": 263183,
            "is_controlling": true,
            "support_amount": "0.0",
            "take_over_height": 209,
            "trending_global": 0.0,
            "trending_group": 0,
            "trending_local": 0.0,
            "trending_mixed": 0.0
          },
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
          "short_url": "lbry://@channel#7",
          "timestamp": 1561485089,
          "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
            "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": 1561485090,
        "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmpzj1qbxfj",
            "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      }
    ],
    "page": 1,
    "page_size": 10,
    "total_items": 1,
    "total_pages": 1
  }
}

Search for claims matching a name


curl -d'{"method": "claim_search", "params": {"name": "astream", "channel_ids": [], "not_channel_ids": [], "has_channel_signature": false, "valid_channel_signature": false, "invalid_channel_signature": false, "is_controlling": false, "stream_types": [], "media_types": [], "any_tags": [], "all_tags": [], "not_tags": [], "any_languages": [], "all_languages": [], "not_languages": [], "any_locations": [], "all_locations": [], "not_locations": [], "order_by": []}}' http://localhost:5279/
lbrynet claim search --name="astream"
requests.post("http://localhost:5279", json={"method": "claim_search", "params": {"name": "astream", "channel_ids": [], "not_channel_ids": [], "has_channel_signature": false, "valid_channel_signature": false, "invalid_channel_signature": false, "is_controlling": false, "stream_types": [], "media_types": [], "any_tags": [], "all_tags": [], "not_tags": [], "any_languages": [], "all_languages": [], "not_languages": [], "any_locations": [], "all_locations": [], "not_locations": [], "order_by": []}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
        "amount": "1.0",
        "canonical_url": "lbry://@channel#7/astream#5",
        "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_channel_signature_valid": true,
        "meta": {
          "activation_height": 213,
          "creation_height": 213,
          "creation_timestamp": 1561485090,
          "effective_amount": "1.0",
          "expiration_height": 263187,
          "is_controlling": true,
          "support_amount": "0.0",
          "take_over_height": 213,
          "trending_global": 0.0,
          "trending_group": 0,
          "trending_local": 0.0,
          "trending_mixed": 0.0
        },
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#5d64500fb723eded83a41b0d5055f1783f019191",
        "short_url": "lbry://astream#5",
        "signing_channel": {
          "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
          "amount": "1.0",
          "canonical_url": "lbry://@channel#7",
          "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
          "claim_op": "update",
          "confirmations": 5,
          "height": 210,
          "meta": {
            "activation_height": 209,
            "claims_in_channel": 1,
            "creation_height": 209,
            "creation_timestamp": 1561485089,
            "effective_amount": "1.0",
            "expiration_height": 263183,
            "is_controlling": true,
            "support_amount": "0.0",
            "take_over_height": 209,
            "trending_global": 0.0,
            "trending_group": 0,
            "trending_local": 0.0,
            "trending_mixed": 0.0
          },
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
          "short_url": "lbry://@channel#7",
          "timestamp": 1561485089,
          "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
            "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": 1561485090,
        "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmpzj1qbxfj",
            "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      }
    ],
    "page": 1,
    "page_size": 10,
    "total_items": 1,
    "total_pages": 1
  }
}

comment_create

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

Arguments

  • comment
    str
    Comment to be made, should be at most 2000 characters.
  • claim_id
    str
    The ID of the claim to comment on
  • parent_id
    optionalstr
    The ID of a comment to make a response to
  • channel_id
    optionalstr
    The ID of the channel you want to post under
  • channel_name
    optionalstr
    The channel you want to post as, prepend with a '@'
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.

Returns

(dict) Comment object if successfully made, (None) otherwise
{
    "comment":      (str) The actual string as inputted by the user,
    "comment_id":   (str) The Comment's unique identifier,
    "channel_name": (str) Name of the channel this was posted under, prepended with a '@',
    "channel_id":   (str) The Channel Claim ID that this comment was posted under,
    "signature":    (str) The signature of the comment,
    "channel_url":  (str) Channel's URI in the ClaimTrie,
    "parent_id":    (str) Comment this is replying to, (None) if this is the root,
    "timestamp":    (int) The time at which comment was entered into the server at, in nanoseconds.
}
// example(s) to come later

comment_list

List comments associated with a claim.

Arguments

  • claim_id
    str
    The claim on which the comment will be made on
  • parent_id
    optionalstr
    CommentId of a specific thread you'd like to see
  • page
    optionalint
    The page you'd like to see in the comment list.
  • page_size
    optionalint
    The amount of comments that you'd like to retrieve
  • include_replies
    optionalbool
    Whether or not you want to include replies in list
  • is_channel_signature_valid
    optionalbool
    Only include comments with valid signatures. [Warning: Paginated total size will not change, even if list reduces]

Returns

(dict)  Containing the list, and information about the paginated content:
{
    "page": "Page number of the current items.",
    "page_size": "Number of items to show on a page.",
    "total_pages": "Total number of pages.",
    "total_items": "Total number of items.",
    "items": "A List of dict objects representing comments."
    [
        {
            "comment":      (str) The actual string as inputted by the user,
            "comment_id":   (str) The Comment's unique identifier,
            "channel_name": (str) Name of the channel this was posted under, prepended with a '@',
            "channel_id":   (str) The Channel Claim ID that this comment was posted under,
            "signature":    (str) The signature of the comment,
            "channel_url":  (str) Channel's URI in the ClaimTrie,
            "parent_id":    (str) Comment this is replying to, (None) if this is the root,
            "timestamp":    (int) The time at which comment was entered into the server at, in nanoseconds.
        },
        ...
    ]
}
// 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": "5d64500fb723eded83a41b0d5055f1783f019191"}}' http://localhost:5279/
lbrynet file delete --claim_id="5d64500fb723eded83a41b0d5055f1783f019191"
requests.post("http://localhost:5279", json={"method": "file_delete", "params": {"delete_from_download_dir": false, "delete_all": false, "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191"}}).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

[
    {
        "streaming_url": "(str) url to stream the file using range requests",
        "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": "7ed794458d57978c49572424e1d32c7fa4d5325e",
      "channel_name": "@channel",
      "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
      "claim_name": "astream",
      "completed": true,
      "confirmations": -1,
      "content_fee": null,
      "download_directory": null,
      "download_path": null,
      "file_name": null,
      "height": -1,
      "key": "e8b365259d5b8644a6a1eb5d2f77459f",
      "metadata": {
        "source": {
          "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
          "media_type": "application/octet-stream",
          "name": "tmpzj1qbxfj",
          "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
          "size": "11"
        },
        "stream_type": "binary"
      },
      "mime_type": "application/octet-stream",
      "nout": 0,
      "outpoint": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e:0",
      "points_paid": 0.0,
      "protobuf": "015e32d5a47f2cd3e1242457498c97578d4594d77ee519fc56b21384e97c75d5c1b6450f2138e209f7bbd2adb588609ba36d1982a2187070c391a89793a0b569f09fef656fe041eab1809e3964f6346ae0fb3d20f30a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707a6a31716278666a180b22186170706c69636174696f6e2f6f637465742d73747265616d3230d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
      "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
      "status": "finished",
      "stopped": true,
      "stream_hash": "8b7dee36b0985027ad1476590ee5759359b57e4cb6507d5288ffe1508c32177f5a39ef20772cf90da72987f6f55ce1ba",
      "stream_name": "tmpzj1qbxfj",
      "streaming_url": "http://localhost:5280/stream/d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
      "suggested_file_name": "tmpzj1qbxfj",
      "timestamp": null,
      "total_bytes": 16,
      "total_bytes_lower_bound": 0,
      "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
      "written_bytes": null
    },
    {
      "blobs_completed": 1,
      "blobs_in_stream": 1,
      "blobs_remaining": 0,
      "channel_claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
      "channel_name": "@channel",
      "claim_id": "8cef1fdff80ef393ddb24a73ba60196610bedbc9",
      "claim_name": "blank-image",
      "completed": true,
      "confirmations": -1,
      "content_fee": null,
      "download_directory": null,
      "download_path": null,
      "file_name": null,
      "height": -1,
      "key": "e7256de8c71f32d15b11d820dded4ae8",
      "metadata": {
        "author": "Picaso",
        "description": "A blank PNG that is 5x7.",
        "fee": {
          "address": "miLhR5kJLGVqi5Ss2VKT2Nxt4fToriqtX2",
          "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": "1561485066",
        "source": {
          "hash": "6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545",
          "media_type": "image/png",
          "name": "tmp_zkvgv47.png",
          "sd_hash": "d4595a73a829c2a567a25ee1fa7ced42ae4d2d5fccc19126f01b8518537a386b6d20d611b35278afe6a5e193a762cd8c",
          "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": "62a6d649879ce6a35a33265b8a9421faf24fd1e40457fdcdb4753d7eb7de6e0f:0",
      "points_paid": 0.0,
      "protobuf": "015e32d5a47f2cd3e1242457498c97578d4594d77ef0d8c8998fb8a90c600f66f6bce1b38b4f8ccca60f1896a1d0b85e3735c50d5b4841a37bb45dfdbef1ca2712189280efd4382ac843e11e6272e0389c1b99b6630ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d705f7a6b76677634372e706e6718632209696d6167652f706e673230d4595a73a829c2a567a25ee1fa7ced42ae4d2d5fccc19126f01b8518537a386b6d20d611b35278afe6a5e193a762cd8c120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f7267288abec9e8053222080112196f1ef7cc2a7373816b32207342ec23f8c38dccf01292bec029188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e63686573746572",
      "sd_hash": "d4595a73a829c2a567a25ee1fa7ced42ae4d2d5fccc19126f01b8518537a386b6d20d611b35278afe6a5e193a762cd8c",
      "status": "finished",
      "stopped": true,
      "stream_hash": "76c45fb32bda0108607aecd6729fd6e65e879625d9f735ce7b9f09865d965837a91086fdfd8b1976ffb0193c3ed8a6a4",
      "stream_name": "tmp_zkvgv47.png",
      "streaming_url": "http://localhost:5280/stream/d4595a73a829c2a567a25ee1fa7ced42ae4d2d5fccc19126f01b8518537a386b6d20d611b35278afe6a5e193a762cd8c",
      "suggested_file_name": "tmp_zkvgv47.png",
      "timestamp": null,
      "total_bytes": 112,
      "total_bytes_lower_bound": 96,
      "txid": "62a6d649879ce6a35a33265b8a9421faf24fd1e40457fdcdb4753d7eb7de6e0f",
      "written_bytes": null
    }
  ]
}

List files matching a parameter


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

Output


{
  "jsonrpc": "2.0",
  "result": [
    {
      "blobs_completed": 1,
      "blobs_in_stream": 1,
      "blobs_remaining": 0,
      "channel_claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
      "channel_name": "@channel",
      "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
      "claim_name": "astream",
      "completed": true,
      "confirmations": 3,
      "content_fee": null,
      "download_directory": null,
      "download_path": null,
      "file_name": null,
      "height": 214,
      "key": "e8b365259d5b8644a6a1eb5d2f77459f",
      "metadata": {
        "source": {
          "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
          "media_type": "application/octet-stream",
          "name": "tmpzj1qbxfj",
          "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
          "size": "11"
        },
        "stream_type": "binary"
      },
      "mime_type": "application/octet-stream",
      "nout": 0,
      "outpoint": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e:0",
      "points_paid": 0.0,
      "protobuf": "015e32d5a47f2cd3e1242457498c97578d4594d77ee519fc56b21384e97c75d5c1b6450f2138e209f7bbd2adb588609ba36d1982a2187070c391a89793a0b569f09fef656fe041eab1809e3964f6346ae0fb3d20f30a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707a6a31716278666a180b22186170706c69636174696f6e2f6f637465742d73747265616d3230d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
      "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
      "status": "finished",
      "stopped": true,
      "stream_hash": "8b7dee36b0985027ad1476590ee5759359b57e4cb6507d5288ffe1508c32177f5a39ef20772cf90da72987f6f55ce1ba",
      "stream_name": "tmpzj1qbxfj",
      "streaming_url": "http://localhost:5280/stream/d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
      "suggested_file_name": "tmpzj1qbxfj",
      "timestamp": 1561485090,
      "total_bytes": 16,
      "total_bytes_lower_bound": 0,
      "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
      "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_save

Start saving a file to disk.

Arguments

  • file_name
    optionalstr
    file name to save to
  • download_directory
    optionalstr
    directory to save into
  • sd_hash
    optionalstr
    save file with matching sd hash
  • stream_hash
    optionalstr
    save file with matching stream hash
  • rowid
    optionalint
    save file with matching row id
  • claim_id
    optionalstr
    save file with matching claim id
  • txid
    optionalstr
    save file with matching claim txid
  • nout
    optionalint
    save file with matching claim nout
  • claim_name
    optionalstr
    save file with matching claim name
  • channel_claim_id
    optionalstr
    save file with matching channel claim id
  • channel_name
    optionalstr
    save file with matching channel claim name

Returns

{
    "streaming_url": "(str) url to stream the file using range requests",
    "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"
}

Save a file to the downloads directory


curl -d'{"method": "file_save", "params": {"sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3"}}' http://localhost:5279/
lbrynet file save --sd_hash="d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3"
requests.post("http://localhost:5279", json={"method": "file_save", "params": {"sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "blobs_completed": 1,
    "blobs_in_stream": 1,
    "blobs_remaining": 0,
    "channel_claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
    "channel_name": "@channel",
    "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
    "claim_name": "astream",
    "completed": true,
    "confirmations": 3,
    "content_fee": null,
    "download_directory": null,
    "download_path": null,
    "file_name": null,
    "height": 214,
    "key": "e8b365259d5b8644a6a1eb5d2f77459f",
    "metadata": {
      "source": {
        "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
        "media_type": "application/octet-stream",
        "name": "tmpzj1qbxfj",
        "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
        "size": "11"
      },
      "stream_type": "binary"
    },
    "mime_type": "application/octet-stream",
    "nout": 0,
    "outpoint": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e:0",
    "points_paid": 0.0,
    "protobuf": "015e32d5a47f2cd3e1242457498c97578d4594d77ee519fc56b21384e97c75d5c1b6450f2138e209f7bbd2adb588609ba36d1982a2187070c391a89793a0b569f09fef656fe041eab1809e3964f6346ae0fb3d20f30a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707a6a31716278666a180b22186170706c69636174696f6e2f6f637465742d73747265616d3230d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
    "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
    "status": "running",
    "stopped": false,
    "stream_hash": "8b7dee36b0985027ad1476590ee5759359b57e4cb6507d5288ffe1508c32177f5a39ef20772cf90da72987f6f55ce1ba",
    "stream_name": "tmpzj1qbxfj",
    "streaming_url": "http://localhost:5280/stream/d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
    "suggested_file_name": "tmpzj1qbxfj",
    "timestamp": 1561485090,
    "total_bytes": 16,
    "total_bytes_lower_bound": 0,
    "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
    "written_bytes": null
  }
}

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 lbry/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,
    "blob_lru_cache_size": 0,
    "blockchain_name": "lbrycrd_regtest",
    "cache_time": 150,
    "coin_selection_strategy": "standard",
    "comment_server": "https://comments.lbry.com/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/tmpfjnst0c0",
    "download_dir": "/tmp/tmpfjnst0c0",
    "download_timeout": 30.0,
    "fixed_peer_delay": 2.0,
    "known_dht_nodes": [],
    "lbryum_servers": [
      [
        "127.0.0.1",
        50001
      ]
    ],
    "max_connections_per_download": 4,
    "max_key_fee": {
      "amount": 50.0,
      "currency": "USD"
    },
    "network_interface": "0.0.0.0",
    "node_rpc_timeout": 5.0,
    "peer_connect_timeout": 3.0,
    "reflect_streams": true,
    "reflector_servers": [
      [
        "127.0.0.1",
        5566
      ]
    ],
    "s3_headers_depth": 960,
    "save_blobs": true,
    "save_files": true,
    "share_usage_data": false,
    "split_buckets_under_index": 1,
    "streaming_get": true,
    "streaming_server": "localhost:5280",
    "tcp_port": 3333,
    "udp_port": 4444,
    "use_upnp": false,
    "wallet_dir": "/tmp/tmpfjnst0c0"
  }
}

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": "5d64500fb723eded83a41b0d5055f1783f019191", "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet stream abandon 5d64500fb723eded83a41b0d5055f1783f019191
requests.post("http://localhost:5279", json={"method": "stream_abandon", "params": {"claim_id": "5d64500fb723eded83a41b0d5055f1783f019191", "preview": false, "blocking": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "01000000017e19c275684db4fd0f44b44777ba62ebe6e45eb3737637cbd8eb5dafadf1c2da000000006b483045022100c624c1ad3ba9ef23da28e8a21bda59d223bca0cc7011e952d14ab9fc065058aa022046708292d323bf9053ded6de63ae948058fa5650c8a2a3286ca700bb797be32e0121039efda2d8dd29b422fb044b6ccf6791ec3b0489713619b3f9dd9e8c89a4e54779ffffffff0134b7f505000000001976a9145b91c67ced35c7e2197da2da28fde8c113ef8a4588ac00000000",
    "inputs": [
      {
        "address": "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
        "amount": "1.0",
        "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
        "claim_op": "update",
        "confirmations": 3,
        "height": 214,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#5d64500fb723eded83a41b0d5055f1783f019191",
        "timestamp": 1561485090,
        "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmpzj1qbxfj",
            "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      }
    ],
    "outputs": [
      {
        "address": "mos8RABG1AF9QQ4HPVABG9p9ERCQ4DGG2Z",
        "amount": "0.999893",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "43b91f8ca1e4b543ddaa540e1b9026084f137cea5e9a9d7381321508086f3ce5",
        "type": "payment"
      }
    ],
    "total_fee": "0.000107",
    "total_input": "1.0",
    "total_output": "0.999893",
    "txid": "43b91f8ca1e4b543ddaa540e1b9026084f137cea5e9a9d7381321508086f3ce5"
  }
}

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))
  • bid
    decimal
    amount to back the claim
  • file_path
    str
    path to file to be associated with name.
  • allow_duplicate_name
    optionalbool
    create new claim even if one already exists with given name. default: false.
  • 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_name
    optionalstr
    name 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
  • blocking
    optionalbool
    wait until transaction 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"
}

Create a stream claim without metadata


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "010000000196f8e3d37980f4f602fedd6be3007e45c98a176b953ec151db7d9ff558f4e950010000006b483045022100c86c0b5aa41515436e96d86767e75566cb5addd6c41fc03b182fd41cb50e6750022044937d16a79ed035ee77af8c4e05282b66417349a5d9bc4f340d7d5a3569f048012103fe478df2bbf4c46284220d4d439f5ced6d923cc18915e25b0fa1f14a039a758effffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707a6a31716278666a180b22186170706c69636174696f6e2f6f637465742d73747265616d3230d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d36d7576a9145f714bd8d8f78a7a6836eba4625ab0d05cbf9bf188ac38fb9423000000001976a914b18165ea11e7fc078a724665b8d5f4ed879418af88ac00000000",
    "inputs": [
      {
        "address": "moXzxEEXj4nhGhnozbGGFqGXdEzysbDMHJ",
        "amount": "6.983769",
        "confirmations": 4,
        "height": 209,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1561485089,
        "txid": "50e9f458f59f7ddb51c13e956b178ac9457e00e36bddfe02f6f48079d3e3f896",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
        "amount": "1.0",
        "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#5d64500fb723eded83a41b0d5055f1783f019191",
        "timestamp": null,
        "txid": "c983a65d949c9badee6fdd78ec68dc214c44816576e90998a86c062790e8fffe",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmpzj1qbxfj",
            "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      },
      {
        "address": "mwhWukDANoke2ikBrkj8u3kFdRh5YM2Xv7",
        "amount": "5.969662",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "c983a65d949c9badee6fdd78ec68dc214c44816576e90998a86c062790e8fffe",
        "type": "payment"
      }
    ],
    "total_fee": "0.014107",
    "total_input": "6.983769",
    "total_output": "6.969662",
    "txid": "c983a65d949c9badee6fdd78ec68dc214c44816576e90998a86c062790e8fffe"
  }
}

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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001feffe89027066ca89809e9766581444c21dc68ec78dd6feead9b9c945da683c9010000006b483045022100b3f2904121f6c6b5a41f31aae658e82db8b9b03385c5a68b4837603476905e3102206361878bb10bdf9ec3aa09e57777d67e97d93ecd6759784b937dc27441d4cb130121033c5a8006c1b3c7e3fce456220accfdf3a7b1f7f9c7a312789637d857dc8d68cbffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db101015e32d5a47f2cd3e1242457498c97578d4594d77ef0d8c8998fb8a90c600f66f6bce1b38b4f8ccca60f1896a1d0b85e3735c50d5b4841a37bb45dfdbef1ca2712189280efd4382ac843e11e6272e0389c1b99b6630ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d705f7a6b76677634372e706e6718632209696d6167652f706e673230d4595a73a829c2a567a25ee1fa7ced42ae4d2d5fccc19126f01b8518537a386b6d20d611b35278afe6a5e193a762cd8c120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f7267288abec9e8053222080112196f1ef7cc2a7373816b32207342ec23f8c38dccf01292bec029188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a9141ef7cc2a7373816b32207342ec23f8c38dccf01288acac5e7d1d000000001976a9140a576ae154110bade7e05856edb02f02c4192c2c88ac00000000",
    "inputs": [
      {
        "address": "mwhWukDANoke2ikBrkj8u3kFdRh5YM2Xv7",
        "amount": "5.969662",
        "confirmations": 2,
        "height": 213,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1561485090,
        "txid": "c983a65d949c9badee6fdd78ec68dc214c44816576e90998a86c062790e8fffe",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "miLhR5kJLGVqi5Ss2VKT2Nxt4fToriqtX2",
        "amount": "1.0",
        "claim_id": "8cef1fdff80ef393ddb24a73ba60196610bedbc9",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "is_channel_signature_valid": true,
        "meta": {},
        "name": "blank-image",
        "normalized_name": "blank-image",
        "nout": 0,
        "permanent_url": "lbry://blank-image#8cef1fdff80ef393ddb24a73ba60196610bedbc9",
        "signing_channel": {
          "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
          "amount": "1.0",
          "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
          "claim_op": "update",
          "confirmations": 5,
          "height": 210,
          "is_change": false,
          "is_mine": true,
          "meta": {},
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
          "timestamp": 1561485089,
          "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
            "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": null,
        "txid": "62a6d649879ce6a35a33265b8a9421faf24fd1e40457fdcdb4753d7eb7de6e0f",
        "type": "claim",
        "value": {
          "author": "Picaso",
          "description": "A blank PNG that is 5x7.",
          "fee": {
            "address": "miLhR5kJLGVqi5Ss2VKT2Nxt4fToriqtX2",
            "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": "1561485066",
          "source": {
            "hash": "6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545",
            "media_type": "image/png",
            "name": "tmp_zkvgv47.png",
            "sd_hash": "d4595a73a829c2a567a25ee1fa7ced42ae4d2d5fccc19126f01b8518537a386b6d20d611b35278afe6a5e193a762cd8c",
            "size": "99"
          },
          "stream_type": "image",
          "tags": [
            "blank",
            "art"
          ],
          "thumbnail": {
            "url": "http://smallmedia.com/thumbnail.jpg"
          },
          "title": "Blank Image"
        },
        "value_type": "stream"
      },
      {
        "address": "mgTdmr4kSe4jjBaQZwE3ar4Kb7XcZBqmZT",
        "amount": "4.947555",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "62a6d649879ce6a35a33265b8a9421faf24fd1e40457fdcdb4753d7eb7de6e0f",
        "type": "payment"
      }
    ],
    "total_fee": "0.022107",
    "total_input": "5.969662",
    "total_output": "5.947555",
    "txid": "62a6d649879ce6a35a33265b8a9421faf24fd1e40457fdcdb4753d7eb7de6e0f"
  }
}

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.",
    "total_items": "Total number of items.",
    "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": "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
      "amount": "1.0",
      "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
      "claim_op": "update",
      "confirmations": 1,
      "height": 214,
      "is_change": false,
      "is_channel_signature_valid": true,
      "is_mine": true,
      "meta": {},
      "name": "astream",
      "normalized_name": "astream",
      "nout": 0,
      "permanent_url": "lbry://astream#5d64500fb723eded83a41b0d5055f1783f019191",
      "signing_channel": {
        "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
        "amount": "1.0",
        "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
        "claim_op": "update",
        "confirmations": 5,
        "height": 210,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
        "timestamp": 1561485089,
        "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
          "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
          "title": "New Channel"
        },
        "value_type": "channel"
      },
      "timestamp": 1561485090,
      "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
      "type": "claim",
      "value": {
        "source": {
          "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
          "media_type": "application/octet-stream",
          "name": "tmpzj1qbxfj",
          "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
          "size": "11"
        },
        "stream_type": "binary"
      },
      "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": "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
        "amount": "1.0",
        "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_change": false,
        "is_channel_signature_valid": true,
        "is_mine": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#5d64500fb723eded83a41b0d5055f1783f019191",
        "signing_channel": {
          "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
          "amount": "1.0",
          "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
          "claim_op": "update",
          "confirmations": 5,
          "height": 210,
          "is_change": false,
          "is_mine": true,
          "meta": {},
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
          "timestamp": 1561485089,
          "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
            "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": 1561485090,
        "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmpzj1qbxfj",
            "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_items": 1,
    "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
  • clear_fee
    optionalbool
    clear previously set fee
  • 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
  • clear_tags
    optionalbool
    clear existing tags (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_languages
    optionalbool
    clear existing languages (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'}"
  • clear_locations
    optionalbool
    clear existing locations (prior to adding new ones)
  • 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 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
  • blocking
    optionalbool
    wait until transaction is in mempool
  • replace
    optionalbool
    instead of modifying specific values on the stream, this will clear all existing values and only save passed in values, useful for form submissions where all values are always set

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": "5d64500fb723eded83a41b0d5055f1783f019191", "clear_fee": false, "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "channel_id": "7ed794458d57978c49572424e1d32c7fa4d5325e", "clear_channel": false, "channel_account_id": [], "preview": false, "blocking": false, "replace": false}}' http://localhost:5279/
lbrynet stream update 5d64500fb723eded83a41b0d5055f1783f019191 --channel_id="7ed794458d57978c49572424e1d32c7fa4d5325e"
requests.post("http://localhost:5279", json={"method": "stream_update", "params": {"claim_id": "5d64500fb723eded83a41b0d5055f1783f019191", "clear_fee": false, "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "channel_id": "7ed794458d57978c49572424e1d32c7fa4d5325e", "clear_channel": false, "channel_account_id": [], "preview": false, "blocking": false, "replace": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000002feffe89027066ca89809e9766581444c21dc68ec78dd6feead9b9c945da683c9000000006b483045022100d50e402d04306f995730a8cce777723723fff2846104882c27008649b9aae9bf022050a7b0432dd4a4bfd050e53cb072769cbd812f80e497c5c4c4c3e41bdae2e2800121039efda2d8dd29b422fb044b6ccf6791ec3b0489713619b3f9dd9e8c89a4e54779ffffffffb48acb3a85b381bcc76c473f47f0b8a7123aca7b0f793d4db380a2c9093b00aa010000006b483045022100a6948b248bedc73306df727c5068a0c34be18d9dde725e20c841719c0efcaea902203a842193eb567f4abee70e7560732cad4e216863d4c4d1c892359cff4678c18e012103931d91a3c5ade5cdc8a50814a522fcd34a309a6704ff608db69a878d214f6db0ffffffff0200e1f50500000000fd2301b7076173747265616d149191013f78f155500d1ba483eded23b70f50645d4ce8015e32d5a47f2cd3e1242457498c97578d4594d77ee519fc56b21384e97c75d5c1b6450f2138e209f7bbd2adb588609ba36d1982a2187070c391a89793a0b569f09fef656fe041eab1809e3964f6346ae0fb3d20f30a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707a6a31716278666a180b22186170706c69636174696f6e2f6f637465742d73747265616d3230d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d36d6d76a9145f714bd8d8f78a7a6836eba4625ab0d05cbf9bf188ac32a0d205000000001976a9143b92d98084d9425628023c45e47f808c4abeacc588ac00000000",
    "inputs": [
      {
        "address": "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
        "amount": "1.0",
        "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
        "claim_op": "create",
        "confirmations": 1,
        "height": 213,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#5d64500fb723eded83a41b0d5055f1783f019191",
        "timestamp": 1561485090,
        "txid": "c983a65d949c9badee6fdd78ec68dc214c44816576e90998a86c062790e8fffe",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmpzj1qbxfj",
            "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      },
      {
        "address": "mrxs9s9nJgdvS6qW2ca4yr5UY6RkWS5zk9",
        "amount": "0.9772285",
        "confirmations": 3,
        "height": 211,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1561485089,
        "txid": "aa003b09c9a280b34d3d790f7bca3a12a7b8f0473f476cc7bc81b3853acb8ab4",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mpDcDEwvfvETWqTDhddKLTzZZS2GBQWBqC",
        "amount": "1.0",
        "claim_id": "5d64500fb723eded83a41b0d5055f1783f019191",
        "claim_op": "update",
        "confirmations": -2,
        "height": -2,
        "is_channel_signature_valid": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#5d64500fb723eded83a41b0d5055f1783f019191",
        "signing_channel": {
          "address": "n3rBuPQB9qzAha4xU1uHyP5nmvR3WGq3r6",
          "amount": "1.0",
          "claim_id": "7ed794458d57978c49572424e1d32c7fa4d5325e",
          "claim_op": "update",
          "confirmations": 4,
          "height": 210,
          "is_change": false,
          "is_mine": true,
          "meta": {},
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#7ed794458d57978c49572424e1d32c7fa4d5325e",
          "timestamp": 1561485089,
          "txid": "0f7256329d0b2896d6f2472eea2614fbcf20ab6b22e27d168060ebb0adbaa6fa",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a0342000465bebc31803d2a7f0f037f696665d4d610abea2e518f906410163dec7513fc2b9a82ae0c4a15602f467d4c03823d72cf95c36fc6a87e963356e44db502027ae2",
            "public_key_id": "mrqYtVaoPEPqgyRPExUPi7PrYJ9nDc59yW",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": null,
        "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmpzj1qbxfj",
            "sd_hash": "d85e47456630442a413f6cbedbdc4b0a5177770155d8a4523bbf2f301ebae95e0785cb475ca8d1a9d3cab54a05de64d3",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      },
      {
        "address": "mkwx5fNEYC8DK3G3fXaPe5468rUYQUWitn",
        "amount": "0.9768965",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e",
        "type": "payment"
      }
    ],
    "total_fee": "0.000332",
    "total_input": "1.9772285",
    "total_output": "1.9768965",
    "txid": "dac2f1adaf5debd8cb377673b35ee4e6eb62ba7747b4440ffdb44d6875c2197e"
  }
}

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
  • blocking
    optionalbool
    wait until transaction 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_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.",
    "total_items": "Total number of items.",
    "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-06-25 13:51",
      "fee": "-0.000124",
      "support_info": [],
      "timestamp": 1561485089,
      "txid": "0e071fe12cfda37fb80dd634afb1a44bcb861e2de16009ad5628cc7f74776634",
      "update_info": [],
      "value": "-2.0"
    },
    {
      "abandon_info": [],
      "claim_info": [],
      "confirmations": 7,
      "date": "2019-06-25 13:51",
      "fee": "0.0",
      "support_info": [],
      "timestamp": 1561485088,
      "txid": "8fa093f2b4e99c1c7d1aef71a73092c72ebe1875a2481b2ccb4244a49126fcc0",
      "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.",
    "total_items": "Total number of items.",
    "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