-
Notifications
You must be signed in to change notification settings - Fork 986
Closed
Description
I am not able to get a keybase tx to finalize using the API. This is the best error message I can find:
20181231 13:26:33.790 ERROR grin_wallet::controller - finalize_tx: failed with error: LibTx Error
20181231 13:26:33.790 ERROR grin_wallet::controller - Request Error: Error { inner:
LibTx Error }
Please use the following steps to reproduce:
run a grin server on address 0.0.0.0:13413
grin --floonet server run
set the owner_api key to "key"
Run a owner_api listener:
grin --floonet wallet -p dummy owner_api
Have a local wallet with some grin in it
have keybase server running and a user logged in
Run the test script:
./keybase_send_tx.py
where ./keybase_send_tx.py contains:
#!/usr/bin/env python3
import requests
import json
import sys
keybase_user = "qsaszs"
grin_owner_api_url = "http://localhost:13420"
wallet_auth = ("grin", "key")
def main():
tx_send_url = grin_owner_api_url + "/v1/wallet/owner/issue_send_tx"
data = {
'method': 'keybase',
'amount': 1230000000,
'minimum_confirmations': 10,
'dest': keybase_user,
'max_outputs': 10,
'num_change_outputs': 1,
'selection_strategy_is_use_all': False,
'fluff': False,
}
print("Command: {} {}".format(tx_send_url, data))
r = requests.post(
url=tx_send_url,
data=json.dumps(data),
auth=wallet_auth,
)
if not (r.status_code >= 200 and r.status_code < 300):
print("Send failed with error {} : {}".format(r.status_code, r.reason))
sys.exit(1)
print("Sent OK: {} : {}".format(r.status_code, r.json()))
# WARNING: keybase send does not FINALIZE or POST the tx after, we need to do that manually
tx_finalize_url = grin_owner_api_url + "/v1/wallet/owner/finalize_tx"
print("Command: {}".format(tx_finalize_url))
r = requests.post(
url=tx_finalize_url,
data=r.text,
auth=wallet_auth,
)
if not (r.status_code >= 200 and r.status_code < 300):
print("Finalize failed with error {} : {}".format(r.status_code, r.reason))
sys.exit(1)
print("Finalized OK: {} : {}".format(r.status_code, r.json()))
tx_post_url = grin_owner_api_url + "/v1/wallet/owner/post_tx"
print("Command: {}".format(tx_post_url))
r = requests.post(
url=tx_post_url,
data=r.text,
auth=wallet_auth
)
if not (r.status_code >= 200 and r.status_code < 300):
print("Post failed with error {} : {}".format(r.status_code, r.reason))
sys.exit(1)
print("Posted OK: {} : {}".format(r.status_code, r.json()))
main()
Metadata
Metadata
Assignees
Labels
No labels