Allow max_key_fee to be set (WIP) #278

Closed
6ea86b96 wants to merge 1 commit from max_key_fee into master
6ea86b96 commented 2017-06-23 09:58:14 +02:00 (Migrated from github.com)

@kauffj I think something is not right with this one. When I first checked my daemon settings the max_key_fee looked something like this:

{
  "address": "",
  "amount": 25,
  "currency": "USD"
}

The API documentation says that settings_set takes a max_key_fee arg of type Float. Now that I passed it one (26.5) the max_key_fee on my daemon is simply returning that number instead of an object with address and currency.

Also, it's not possible to pass a string or integer to this set method. This is a problem as javascript can't distinguish between 25 and 25.0, so it passes an integer and the daemon blows up with 808 ERROR lbrynet.lbrynet_daemon.auth.server:346: Failed to process settings_set: object of type 'int' has no len()

@kauffj I think something is not right with this one. When I first checked my daemon settings the max_key_fee looked something like this: ``` { "address": "", "amount": 25, "currency": "USD" } ``` The API documentation says that `settings_set` takes a `max_key_fee` arg of type `Float`. Now that I passed it one (`26.5`) the max_key_fee on my daemon is simply returning that number instead of an object with address and currency. Also, it's not possible to pass a string or integer to this set method. This is a problem as javascript can't distinguish between `25` and `25.0`, so it passes an integer and the daemon blows up with `808 ERROR lbrynet.lbrynet_daemon.auth.server:346: Failed to process settings_set: object of type 'int' has no len()`
6ea86b96 commented 2017-06-25 10:12:34 +02:00 (Migrated from github.com)

Actually, this change has now totally borked my wallet. I can't set the max_key_fee back to the proper format even via the CLI. When I try to purchase content I get the following error:

2017-06-25 15:00:37,562 INFO     lbrynet.lbrynet_daemon.Downloader:104: Download lbry://cinemasix status changed to initializing
2017-06-25 15:00:37,565 WARNING  lbrynet.lbrynet_daemon.Daemon:675: Failed to get cinemasix: 'float' object has no attribute '__getitem__'
2017-06-25 15:00:37,585 INFO     lbrynet.lbrynet_daemon.Daemon:2227: Got unused wallet address: baXBsbR9AibpnjxHGD38udRb2wwojy4pfn

Followed by a what seems to be an infinite loop, spewing this over and over every second:

2017-06-25 15:00:38,410 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:38,989 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:39,539 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:40,137 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:41,019 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:41,582 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:42,164 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:43,142 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:43,714 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:44,260 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:45,018 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:45,614 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:46,192 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:46,774 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:47,921 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
2017-06-25 15:00:48,502 WARNING  lbrynet.core.Wallet:667: Claim does not exist: None
Actually, this change has now totally borked my wallet. I can't set the `max_key_fee` back to the proper format even via the CLI. When I try to purchase content I get the following error: ``` 2017-06-25 15:00:37,562 INFO lbrynet.lbrynet_daemon.Downloader:104: Download lbry://cinemasix status changed to initializing 2017-06-25 15:00:37,565 WARNING lbrynet.lbrynet_daemon.Daemon:675: Failed to get cinemasix: 'float' object has no attribute '__getitem__' 2017-06-25 15:00:37,585 INFO lbrynet.lbrynet_daemon.Daemon:2227: Got unused wallet address: baXBsbR9AibpnjxHGD38udRb2wwojy4pfn ``` Followed by a what seems to be an infinite loop, spewing this over and over every second: ``` 2017-06-25 15:00:38,410 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:38,989 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:39,539 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:40,137 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:41,019 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:41,582 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:42,164 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:43,142 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:43,714 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:44,260 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:45,018 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:45,614 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:46,192 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:46,774 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:47,921 WARNING lbrynet.core.Wallet:667: Claim does not exist: None 2017-06-25 15:00:48,502 WARNING lbrynet.core.Wallet:667: Claim does not exist: None ```
6ea86b96 commented 2017-06-25 10:51:05 +02:00 (Migrated from github.com)

Fixed manually in my daemon_settings file

Fixed manually in my `daemon_settings` file
kauffj commented 2017-06-26 21:30:03 +02:00 (Migrated from github.com)

@6ea86b96 @jackrobison says if this is modified to submit { "amount": 25, "currency": "LBC" }, that it will work. There is a separate issue to fix this in the daemon.

@6ea86b96 @jackrobison says if this is modified to submit `{ "amount": 25, "currency": "LBC" }`, that it will work. There is a separate issue to fix this in the daemon.
6ea86b96 commented 2017-06-27 12:50:05 +02:00 (Migrated from github.com)

@jackrobison

curl 'http://localhost:5279/lbryapi' --data '{"method":"settings_set", "params":{"max_key_fee":{"amount":25.0,"currency":"LBC"}}}'
{
  "error": {
    "code": -32500,
    "data": {
      "traceback": [
        "Traceback (most recent call last):",
        "  File \"site-packages/lbrynet/lbrynet_daemon/auth/server.py\", line 253, in render",
        "    ",
        "  File \"site-packages/lbrynet/lbrynet_daemon/auth/server.py\", line 398, in _render",
        "    ",
        "  File \"site-packages/twisted/internet/defer.py\", line 150, in maybeDeferred",
        "    ",
        "  File \"site-packages/twisted/internet/defer.py\", line 1445, in unwindGenerator",
        "    ",
        "--- <exception caught here> ---",
        "  File \"site-packages/twisted/internet/defer.py\", line 1299, in _inlineCallbacks",
        "    ",
        "  File \"site-packages/lbrynet/lbrynet_daemon/Daemon.py\", line 1159, in jsonrpc_settings_set",
        "    ",
        "  File \"site-packages/lbrynet/lbrynet_daemon/Daemon.py\", line 456, in _update_settings",
        "    ",
        "  File \"site-packages/lbrynet/lbrynet_daemon/Daemon.py\", line 450, in can_update_key",
        "    ",
        "  File \"site-packages/lbryschema/fee.py\", line 38, in __init__",
        "    ",
        "  File \"site-packages/lbryschema/fee.py\", line 18, in migrate",
        "    ",
        "exceptions.Exception: Invalid fee",
        ""
      ]
    },
    "message": "Invalid fee"
  },
  "id": null,
  "jsonrpc": "2.0"
}
curl 'http://localhost:5279/lbryapi' --data '{"method":"version"}'
{
  "id": null,
  "jsonrpc": "2.0",
  "result": {
    "build": "release",
    "ip": "209.58.163.55",
    "lbrynet_version": "0.13.1",
    "lbryschema_version": "0.0.7",
    "lbryum_version": "2.8.4",
    "os_release": "16.6.0",
    "os_system": "Darwin",
    "platform": "Darwin-16.6.0-x86_64-i386-64bit",
    "processor": "i386",
    "python_version": "2.7.13"
  }
}
@jackrobison ``` curl 'http://localhost:5279/lbryapi' --data '{"method":"settings_set", "params":{"max_key_fee":{"amount":25.0,"currency":"LBC"}}}' { "error": { "code": -32500, "data": { "traceback": [ "Traceback (most recent call last):", " File \"site-packages/lbrynet/lbrynet_daemon/auth/server.py\", line 253, in render", " ", " File \"site-packages/lbrynet/lbrynet_daemon/auth/server.py\", line 398, in _render", " ", " File \"site-packages/twisted/internet/defer.py\", line 150, in maybeDeferred", " ", " File \"site-packages/twisted/internet/defer.py\", line 1445, in unwindGenerator", " ", "--- <exception caught here> ---", " File \"site-packages/twisted/internet/defer.py\", line 1299, in _inlineCallbacks", " ", " File \"site-packages/lbrynet/lbrynet_daemon/Daemon.py\", line 1159, in jsonrpc_settings_set", " ", " File \"site-packages/lbrynet/lbrynet_daemon/Daemon.py\", line 456, in _update_settings", " ", " File \"site-packages/lbrynet/lbrynet_daemon/Daemon.py\", line 450, in can_update_key", " ", " File \"site-packages/lbryschema/fee.py\", line 38, in __init__", " ", " File \"site-packages/lbryschema/fee.py\", line 18, in migrate", " ", "exceptions.Exception: Invalid fee", "" ] }, "message": "Invalid fee" }, "id": null, "jsonrpc": "2.0" } ``` ``` curl 'http://localhost:5279/lbryapi' --data '{"method":"version"}' { "id": null, "jsonrpc": "2.0", "result": { "build": "release", "ip": "209.58.163.55", "lbrynet_version": "0.13.1", "lbryschema_version": "0.0.7", "lbryum_version": "2.8.4", "os_release": "16.6.0", "os_system": "Darwin", "platform": "Darwin-16.6.0-x86_64-i386-64bit", "processor": "i386", "python_version": "2.7.13" } } ```
kauffj commented 2017-07-02 18:49:38 +02:00 (Migrated from github.com)

There's definitely still something wrong here, but #303 is closer and I'm going to keep that one.

There's definitely still something wrong here, but #303 is closer and I'm going to keep that one.
kaykurokawa commented 2017-07-04 22:52:34 +02:00 (Migrated from github.com)

@6ea86b96 I'm not able to reproduce the error you got in the CLI command:

curl 'http://localhost:5279/lbryapi' --data '{"method":"settings_set", "params":{"max_key_fee":{"amount":25.0,"currency":"LBC"}}}'

It works fine with me. Try the latest daemon release.

@6ea86b96 I'm not able to reproduce the error you got in the CLI command: curl 'http://localhost:5279/lbryapi' --data '{"method":"settings_set", "params":{"max_key_fee":{"amount":25.0,"currency":"LBC"}}}' It works fine with me. Try the latest daemon release.
tzarebczan commented 2017-07-04 23:19:10 +02:00 (Migrated from github.com)

Think this is the latest thread https://github.com/lbryio/lbry-app/pull/324

Think this is the latest thread https://github.com/lbryio/lbry-app/pull/324

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LBRYCommunity/lbry-desktop!278
No description provided.