Welcome to the Aeternity SDK for Python
For support visit the forum, for bug reports or feature requests visit open an issue.
Python SDK for the Æternity blockchain
Home Page: https://aepp-sdk-python.readthedocs.io/
License: ISC License
Name clain fails
Preclaim worked: th_2uf1posv6NshWtUC5Uva4QH7sMnAkUogQKfjQE5v5ZjZndJRq8
but then it crashed with
Traceback (most recent call last):
File "./aecli", line 3, in <module>
from aeternity import __main__
File "/opt/aepp-sdk-python/aeternity/__main__.py", line 856, in <module>
cli(obj={})
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/opt/aepp-sdk-python/aeternity/__main__.py", line 473, in name_register
tx, tx_signed, sig, tx_hash = name.claim(account, fee, ttl)
File "/opt/aepp-sdk-python/aeternity/aens.py", line 180, in claim
self.client.broadcast_transaction(tx_signed, tx_hash)
File "/opt/aepp-sdk-python/aeternity/epoch.py", line 143, in broadcast_transaction
reply = self.post_transaction(body={"tx": tx})
File "/opt/aepp-sdk-python/aeternity/openapi.py", line 207, in api_method
raise OpenAPIClientException(f"Error: {api_response.desc}", code=http_reply.status_code)
aeternity.openapi.OpenAPIClientException: Error: Invalid transaction
I tried running it again, and it said this:
Traceback (most recent call last):
File "/opt/aepp-sdk-python/aeternity/openapi.py", line 53, in init
self.api_def = requests.get(f"{url}/api").json()
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./aecli", line 3, in <module>
from aeternity import __main__
File "/opt/aepp-sdk-python/aeternity/__main__.py", line 856, in <module>
cli(obj={})
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/aepp-sdk-python/venv/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/opt/aepp-sdk-python/aeternity/__main__.py", line 458, in name_register
name = _epoch_cli(network_id=network_id).AEName(domain)
File "/opt/aepp-sdk-python/aeternity/__main__.py", line 54, in _epoch_cli
native=native)
File "/opt/aepp-sdk-python/aeternity/epoch.py", line 57, in __init__
force_compatibility=force_compatibility)
File "/opt/aepp-sdk-python/aeternity/openapi.py", line 65, in __init__
raise UnsupportedEpochVersion(f"Unable to connect to the node: {e}")
aeternity.exceptions.UnsupportedEpochVersion: Unable to connect to the node: Expecting value: line 1 column 1 (char 0)
payload
None
Using the 405d7dd commit
Using bip39 / 32 specifications
use the dry-run endpoint to run non-state-changing contract calls
Remove defaults settings, and add them to the NodeClient init function:
This happens for example in the cli account sign command
when setting the fee to a number it doesnt get applied correctly
When trying to call spend I get an error message and it fails
I was hopping the transaction went on without issues
it returns
Message ____________________________ Unknown error 500
None found so far
install aepp-sdk-python
install dependencies
call
/usr/local/bin/python3 /opt/aepp-sdk-python/aecli -u http://ae.criesca.net:3013 -d http://ae.criesca.net:3013 account spend wallet ak_8KhtR5q1XWBz6VSFK1HynbKBYxXxJyVmD5EzE8EAx3oeXBwKB 2000000000000000000 --password reallyweirdpasswordhex --network-id ae_mainnet
This issue affects the aeternity tipping bot directly because it can only retry for a few seconds before continuing or expecting an answer, also the error is not clear at all
"genesis_key_block_hash": "kh_pbtwgLrNu23k9PA6XCZnUbtsvEFeQGgavY4FS2do3QP8kcp2z",
"network_id": "ae_mainnet",
"node_revision": "368fba92972db352426c5b7ce49a682aacd3cab8",
"node_version": "2.0.0",
Python version 3.6.8
I pointed it to another node (namely the one used by the explorer ( roma-net.mdw.aepps.com ) and it failed in the same exact way. This error was not here before. I tried several versions of the aepp-sdk-python, starting with the roma supported one up to and including current develop branch
Using subprocess.run(stdin=....)
, the Python CLI never picks up the extra input, and thus fails the CLI interface tests, even though it behaves properly on an actual terminal.
State Channel Creation and Initialization
Ping websocket connection every 10 seconds so it stays alive.
State Channel - Leave, Shutdown and Disconnection
I tried the
aecli account spend mywallet ak_XXXXXXXXXXXXXXXXXXXXXXXX 5000
and I get an error saying:
"Error: Sender account not found"
And I don't understand what is going on.
Using tag 0.25.0.1b1
Currently the CLI can only use environment variables to be configured. Allow using flags for configuring those as well.
The process of verifying an arbitrary message is not straightforward.
The sdk should provide a helper function in the signing submodule for signature verification.
Implement WebSocket Management for State Channels
Since ae has released v1.0.0, I just wonder will this sdk support it? I tried ./aecli chain top
and got an error Unable to understand node reply, perhaps is not an epoch node or is too old?
I created my keys using this
epoch keys_gen PASSWORD
Is there any way to import it into this format that look slike a json? 😢
I mistakenly added spaces to my password and I find no way to replace my password.
Support requests with a tag that doesn't even exist?
That's just mean.
Send transaction to succeed as it says in the documentation
It returns a Error: Invalid transaction
ubuntu server 18.04.1
epoch v1.1.0 / docker aeternity/epoc:v1.1.0
aepps-sdk-python v1.1.2 / commit 302c8ec
Version 1.2.0 and above of the aeternity node provide the network_id
in the node status:
it can be used to select automatically the correct network id.
In case the network id is not present it should use the mainnet one or raise an error
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from aeternity import signing
account = signing.Account.generate()
account.save_to_folder("./test_keys", "aeternity")
account = signing.Account.read_from_dir("./test_keys", "aeternity")
print(account)
refer to aeternity/aepp-sdk-js#278
##Using version
commit 22e77952a1666d67b4dc2094b92fd33a3089f114
Merge: bce24f0 6f3ee1b
Author: Andrea Giacobino <[email protected]>
Date: Tue Nov 6 17:51:29 2018 +0100
Merge pull request #73 from aeternity/release/0.25.0.1b1
Release/0.25.0.1b1
##Executing
(venv)# aecli account balance wallet
Enter the account password []:
<none>
Balance ___________________________________________ 20000000000000000000
Id ________________________________________________ ak_e8YApvLq9JyEWVg5KuyBo2gChWVwzD3g4oMHoVCSqg7VpZsw7
Nonce _____________________________________________ 0
</none>
##This fails
(venv)# aecli name claim wallet kryztoval.test
Enter the account password []:
Traceback (most recent call last):
File "/usr/bin/aecli", line 3, in <module>
from aeternity import __main__
File "/opt/aepp-sdk-python/aeternity/__main__.py", line 702, in <module>
cli(obj={})
File "/opt/aepp-sdk-python/venv/lib64/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/opt/aepp-sdk-python/venv/lib64/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/opt/aepp-sdk-python/venv/lib64/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/aepp-sdk-python/venv/lib64/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/opt/aepp-sdk-python/venv/lib64/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/aepp-sdk-python/venv/lib64/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/opt/aepp-sdk-python/aeternity/__main__.py", line 343, in name_register
txs = name.full_claim_blocking(account, name_ttl=name_ttl, tx_ttl=ttl)
File "/opt/aepp-sdk-python/aeternity/aens.py", line 125, in full_claim_blocking
h = self.preclaim(account, fee=preclaim_fee, tx_ttl=tx_ttl)
File "/opt/aepp-sdk-python/aeternity/aens.py", line 151, in preclaim
tx, sg, tx_hash = txb.tx_name_preclaim(commitment_hash, fee, tx_ttl)
File "/opt/aepp-sdk-python/aeternity/transactions.py", line 266, in tx_name_preclaim
tx = self.epoch.post_name_preclaim(body=body)
File "/opt/aepp-sdk-python/aeternity/openapi.py", line 188, in api_method
raise OpenAPIClientException(f"Error: {api_response.desc}", code=http_reply.status_code)
aeternity.openapi.OpenAPIClientException: Error: Account not found
Beside building tx add the functionality to decode txs .
+Feature request
Would it make sense to use this to sweep and account?
Or to spend the total amount in the account without having to perform a balance and withdraway independantly?
It should ne possible to call a contract by name (aens)
Update cli with separation from offline and online sets of commands
To make it easier to generate changelogs
Hello,
Here is what I just did with 1.1.1 freshly installed:
aecli account create test
Enter the account password []:
<account>
Address ___________________________________________ ak_b'EnvNWbub5PJAF6M4UiY7HbZymtaWkr1dU5gfxLLCxNWFV54zz'
Path ______________________________________________ /data/cryptowallets/aeternity/wallet/test
</account>
Then I try to check my balance:
aecli account balance test
Enter the account password []:
Error: Invalid public key
Problem is the same is happening with a real account I have with token owned by the address, so I'm still wondering if the coin are lost or not......
That's a serious issue...
Currently balance returns a string that does not match the value returned by the node.
for example it returns 9109999999999999744 when the node shows 9110000000000000000
This is a rounding issue in python's long int implementation that the aepp-sdk-python is not prevending or working around
from the command line client
Implement support for hd wallet
When requesting the private key from a script, there are some prompts that make it unusable, it would be great if there was an option you can use to prevent the command from stopping to ask for validation.
payload is not an option you can use when calling account spend, it would be really nice if it could be supported.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.