cityofzion / neo-python Goto Github PK
View Code? Open in Web Editor NEWPython Node and SDK for the NEO 2.x blockchain. For NEO 3.x go to our successor project neo-mamba
Home Page: https://neo-python.readthedocs.io/en/latest/
License: MIT License
Python Node and SDK for the NEO 2.x blockchain. For NEO 3.x go to our successor project neo-mamba
Home Page: https://neo-python.readthedocs.io/en/latest/
License: MIT License
The latest plyvel release (v1.0.2) has some breaking changes it seems: https://travis-ci.org/CityOfZion/neo-python/builds/329522567
Traceback (most recent call last):
File "/home/travis/build/CityOfZion/neo-python/neo/Utils/WalletFixtureTestCase.py", line 59, in setUpClass
super(WalletFixtureTestCase, cls).setUpClass()
File "/home/travis/build/CityOfZion/neo-python/neo/Utils/BlockchainFixtureTestCase.py", line 51, in setUpClass
cls._blockchain = TestLevelDBBlockchain(path=cls.leveldb_testpath())
File "/home/travis/build/CityOfZion/neo-python/neo/Implementations/Blockchains/LevelDB/LevelDBBlockchain.py", line 154, in __init__
for key, value in self._db.iterator(prefix=DBPrefix.DATA_Block):
File "plyvel/_plyvel.pyx", line 829, in plyvel._plyvel.Iterator.__next__
File "plyvel/_plyvel.pyx", line 874, in plyvel._plyvel.Iterator.real_next
File "plyvel/_plyvel.pyx", line 91, in plyvel._plyvel.raise_for_status
plyvel._plyvel.CorruptionError: b'Corruption: corrupted compressed block contents'
See also wbolster/plyvel#68
I've been thinking of interesting events that neo-python could broadcast via the EventHub. Interesting for instance for third party developers, or the prompt.py ui.
For instance:
Also possible:
Issue for brainstorming, please leave comments with further thoughts and ideas.
It would be great if we would improve the error handling at some point. I'd like to remove the logzero dependency from neocore
and throw exceptions instead of logging errors and returning default values. This will need some refactoring on the implementation points in neo-python.
Not a hurry, but I think would improve the overall robustness and usability of neocore.
running node.py in OSX shows following exceptions
python node.py
Traceback (most recent call last):
File "node.py", line 36, in
d = connectProtocol(point, NeoNode(NeoFactory))
TypeError: init() missing 1 required positional argument: 'leader'
Recent changes in NEO core added a new Transaction type along with a number of other large changes around voting and consensus. These changes should be implemented in neo-python
.
New changes in NEO:
neo-project/neo#130
Could not check message data maximum recursion depth exceeded while calling a Python object
Seems like a race condition that happens when a node has been running for some time.
This bug has a 10 NEO bounty to anyone who resolves it!
PR #151 added RocksDB support.
The implementation is using this rocksdb Python package: https://github.com/twmht/python-rocksdb (python-rocksdb on PyPI). The PR was merged into the feature-rocksdb branch.
Next steps:
pip install python-rocksdb
) on all platforms (Linux, macOS, Windows). See also https://github.com/facebook/rocksdb/blob/master/INSTALL.md. If you get it to compile, please add the required steps to this issue. (help wanted)PR #49 is nice but not backward compatible. It requires ApplicationConfiguration.themes
in the configuration json file. If it is not existing it fails with:
Traceback (most recent call last):
File "prompt.py", line 823, in <module>
settings.setup(args.config)
File "/Users/chris/Projects/chris/neo/neo-python/neo/Settings.py", line 79, in setup
self.token_style = config['themes'][config['theme']]
KeyError: 'themes'
I would suggest to check if this key exists and if not use the old default.
pyup.io is a service that helps you to keep your requirements files up to date. It sends you automated pull requests whenever there’s a new release for one of your dependencies.
Add RPC client for interacting with other nodes via an RPC interface rather than the normal network protocol
Add Tests for the RPC client
Storage.Put() currently overcharges by setting a minimum GAS fee of 1 regardless of the data size.
I've made a PR for a proposed updated but it probably needs to be discussed: #111
Was watching TestNet and keep seeing this exception over and over:
Traceback (most recent call last):
File "/opt/neo/neo-python/neo/VM/ExecutionEngine.py", line 789, in StepInto
self.ExecuteOp(op, self.CurrentContext)
File "/opt/neo/neo-python/neo/VM/ExecutionEngine.py", line 432, in ExecuteOp
x2 = estack.Pop().GetBigInteger()
AttributeError: 'NoneType' object has no attribute 'GetBigInteger'
Here with more context:
[Neo.Storage.Get] [Script:50cff8131c66e0ecfb92153b78a9faf512906fe7] [b'mult'] -> bytearray(b'01101201E01201311202F01401511412611502712612912811312802A12901C12B01012B01C01D01H01D01H01E02G02F01H02G')
ERROR - neo.VM.ExecutionEngine.ExecutionEngine(L:792) - Exception
Traceback (most recent call last):
File "/opt/neo/neo-python/neo/VM/ExecutionEngine.py", line 789, in StepInto
self.ExecuteOp(op, self.CurrentContext)
File "/opt/neo/neo-python/neo/VM/ExecutionEngine.py", line 432, in ExecuteOp
x2 = estack.Pop().GetBigInteger()
AttributeError: 'NoneType' object has no attribute 'GetBigInteger'
[neo.Implementations.Blockchains.LevelDBBlockchain.PersistBlock: engine execute result] Could not execute smart contract. See logs for more details. 'NoneType' object has no attribute 'GetBigInteger'
[neo.Implementations.Blockchains.LevelDBBlockchain.PersistBlock: Invoke tx] -> index, tx hash 735542 b'8b30bdab9c25b0f0e3ef91639a34e1e58b0df3b3f74ef0359dc253ec59bec16e'
[Neo.Storage.Get] [Script:50cff8131c66e0ecfb92153b78a9faf512906fe7] [b'mult'] -> bytearray(b'01101201E01201311202F01401511412611502712612912811312802A12901C12B01012B01C01D01H01D01H01E02G02F01H02G')
ERROR - neo.VM.ExecutionEngine.ExecutionEngine(L:792) - Exception
Traceback (most recent call last):
File "/opt/neo/neo-python/neo/VM/ExecutionEngine.py", line 789, in StepInto
self.ExecuteOp(op, self.CurrentContext)
File "/opt/neo/neo-python/neo/VM/ExecutionEngine.py", line 432, in ExecuteOp
x2 = estack.Pop().GetBigInteger()
AttributeError: 'NoneType' object has no attribute 'GetBigInteger'
[neo.Implementations.Blockchains.LevelDBBlockchain.PersistBlock: engine execute result] Could not execute smart contract. See logs for more details. 'NoneType' object has no attribute 'GetBigInteger'
[neo.Implementations.Blockchains.LevelDBBlockchain.PersistBlock: Invoke tx] -> index, tx hash 735543 b'162c9fb702d7d6dcb5fe01578a765e27c5a8db4a0f48b83b58d75d7eb3b865ea'
[neo.Implementations.Blockchains.LevelDBBlockchain.PersistBlock: engine execute] -> Success
[neo.Implementations.Blockchains.LevelDBBlockchain.PersistBlock: engine execute result] -> IOp Interface: <neo.Core.State.ContractState.ContractState object at 0x7f9fa6a9e5c0>
[neo.Implementations.Blockchains.LevelDBBlockchain.PersistBlock: Invoke tx] -> index, tx hash 735549 b'65d6e4360465d62f36e953afb0a839aa5f31c4e99e5b1f7d2c73ee186869822a'
[Neo.Storage.Get] [Script:50cff8131c66e0ecfb92153b78a9faf512906fe7] [b'm'] -> 0
[Neo.Storage.Put] [Script: 50cff8131c66e0ecfb92153b78a9faf512906fe7] [b'm'] -> bytearray(b'01101201E01201311202F01401511412611502712612912811312802A12901C12B01012B01C01D01H01D01H01E02G02F01H02G')
[neo.SmartContract.StateReader] -> RUNTIME.Log: b'D-'
[neo.Implementations.Blockchains.LevelDBBlockchain.PersistBlock: engine execute] -> Success
[neo.Implementations.Blockchains.LevelDBBlockchain.PersistBlock: engine execute result] -> Array: []
[neo.Implementations.Blockchains.LevelDBBlockchain.PersistBlock: engine execute result] -> ByteArray: bytearray(b'\x00')
[neo.Implementations.Blockchains.LevelDBBlockchain.PersistBlock: Invoke tx] -> index, tx hash 735553 b'c7ee7dafd07b13879cd264c408207427708a0ec01897be596caf614151c594da'
[Neo.Storage.Get] [Script:50cff8131c66e0ecfb92153b78a9faf512906fe7] [b'm'] -> bytearray(b'01101201E01201311202F01401511412611502712612912811312802A12901C12B01012B01C01D01H01D01H01E02G02F01H02G')
ERROR - neo.VM.ExecutionEngine.ExecutionEngine(L:792) - Exception
Traceback (most recent call last):
File "/opt/neo/neo-python/neo/VM/ExecutionEngine.py", line 789, in StepInto
self.ExecuteOp(op, self.CurrentContext)
File "/opt/neo/neo-python/neo/VM/ExecutionEngine.py", line 432, in ExecuteOp
x2 = estack.Pop().GetBigInteger()
AttributeError: 'NoneType' object has no attribute 'GetBigInteger'
Removing the unused parameter. I encountered this while writing docstrings but there is too much to refactor to keep that in the PR with docstrings. Consider this a note for myself such that I don't forget to do this.
When i run python bootstrap.py it give this error No module named 'logzero'.
Traceback (most recent call last):
File "bootstrap.py", line 1, in
from neo.Settings import settings
File "D:\python\neo-python-master\neo\Settings.py", line 14, in
import logzero
ImportError: No module named 'logzero'
Add actual documentation to the project.
pip install -r requirements.txt
installs neo-python-rpc in 2 versions:
neo-python-rpc
. This is okay.neo
. This is bad and fucks things up. You can find the wrong neo
package in venv/lib/python3.5/site-packages/neo
. You can also see it in the neo-python-rpc/0.1.5 package download: https://pypi.python.org/pypi/neo-python-rpc/0.1.5I'm not sure where this is coming from -- what is requiring [email protected]
?
One of the goals of this project is to allow users to choose their backend implementation. I think the first step in that direction would be to add an alternative implementation to LevelDB which might be a bit more user friendly for people to work with. My preference would be postgres.
While observing testnet syncing. Probably could use a more graceful handling.
[I 171120 13:43:59 EventHub:99] [SmartContract.Execution.Success][718081] [17f7abfbd4ab65a9aef430e30e05c109c373b3fe] [tx d8968bd24b817e28a080a3c94e757a3309497ae95a2017b30fd9ea130ee59a84] [<neo.Core.State.ContractState.ContractState object at 0x12255d748>]
[E 171120 13:43:59 ExecutionEngine:800] COULD NOT EXECUTE OP: 'BigInteger' object has no attribute 'Sign' b'\x8d' SIGN
[E 171120 13:43:59 ExecutionEngine:801] 'BigInteger' object has no attribute 'Sign'
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-python/neo/VM/ExecutionEngine.py", line 798, in StepInto
self.ExecuteOp(op, self.CurrentContext)
File "/Users/erik/Documents/code/neo-python/neo/VM/ExecutionEngine.py", line 414, in ExecuteOp
estack.PushT(x.Sign)
AttributeError: 'BigInteger' object has no attribute 'Sign'
Feature: Functionality for contrib.smartcontract
to invoke SC methods.
I'm currently working on this. Using this issue for discussion, brainstorming and feedback.
As a reference: This was done for another project (imusify) like this: https://github.com/imusify/blockchain-middleware/blob/imusify2/imusify/imusmartcontract.py#L105
Thinking about a better way to integrate this -- in the above example it was a bit cumbersome with the wallet handling, waiting for the transactions to show up, and sometimes the wallet not showing correctly synced balances (this has been solved by the new neo-python updates).
Work in progress, now already in dev. See also #273 for tracking issues.
Links:
Initial calls:
Additional calls
See also:
transfer
event, so that transaction histories can be generated for NEP5 tokenstransfer
events. Other option is to have this be a separate projectCurrent work is at https://github.com/CityOfZion/neo-python/tree/feature-persist-notifications
Is there a way to generate the Send Transaction without syncing the balance?
When create a UserWallet using UserWallet.Open(), it won't send any transactions due to "insufficient balance"
When compiling and importing a contract resembling a NEP5 token scenario, I try to create a list with a length assigned to the amount of gas attached
from boa.blockchain.vm.Neo.Storage import Get, Put, Delete, GetContext
from boa.blockchain.vm.Neo.Runtime import Notify
from boa.blockchain.vm.System.ExecutionEngine import GetScriptContainer, GetExecutingScriptHash
from boa.blockchain.vm.Neo.Blockchain import GetHeight, GetHeader
from boa.blockchain.vm.Neo.Runtime import GetTrigger, CheckWitness
from boa.blockchain.vm.Neo.Output import GetScriptHash, GetValue, GetAssetId
from boa.code.builtins import concat, list, range, take, substr
SERIALIZED_NAME = 'AWESOME'
GAS_ASSET_ID = b'\xe7-(iy\xeel\xb1\xb7\xe6]\xfd\xdf\xb2\xe3\x84\x10\x0b\x8d\x14\x8ewX\xdeB\xe4\x16\x8bqy,`'
OWNER = b'\xda\x06\xe3G\xda\x9c(\x9eWv-6\x0c\xac9~\x90\x92\x88\xf7'
TWOWEEKS = 1209600000
def Main(operation):
tx = GetScriptContainer()
context = GetContext()
references = tx.References
print("adding entry")
if len(references) < 1:
print("no gas attached")
return False
print("reading reference")
reference = references[0]
print("reference read")
sender = GetScriptHash(reference)
print("sender hash is")
print(sender)
print("reading script hash")
print("getting asset ID. ID is here:")
output_asset_id = GetAssetId(reference)
print(output_asset_id)
print('asset id printed above')
if output_asset_id == GAS_ASSET_ID:
print("executing script hash")
receiver = GetExecutingScriptHash()
for output in tx.Outputs:
shash = GetScriptHash(output)
print("getting shash..")
if shash == receiver:
print("adding value?")
value = GetValue(output)
print("value storing in entries")
Notify(value)
print('string we will save to the entries array')
entries = Get(context, 'entries')
print('current entries')
print(entries)
new_entries = list(length=value)
Notify(new_entries)
return entries
The compilation fails. When I assign a static number of 10 to new_entries = list(length=value)
to the list and Notify the value of GetValue(output) I get the following:
I'm not sure how to resolve this compiler issue. You can see that even though I attached 3 gas the Notify call says that I attached 300000000.
wallet tkn_send RPX <wallet address> <destination address> 1
I get a prompt asking to confirm + password. Then I see
Verifying transaction: <txid>
Relayed TX: <txid>
But when then trying to run:
tx <txid>
I get the response
Could not find transaction for hash <txid>
even after 30+ blocks have been processed.
Alternatively, doing the following as suggested by @localhuman
testinvoke {hash} 0710 05 True transfer ['from_addr', 'to_addr', 1]
where
hash
is the token script_hash
(under the Token[idx].script_hash key of the Wallet)
from_addr
is public_keys[idx].Address key of the wallet holding the tokens
to_addr
is the destination address (LEN:34)
This does instantly create a valid txid
that can be queried using tx <txid>
. However the funds are never deducted.
Development branch: db617bf
MainNet
I observed this while watching testnet sync on latest dev (2018-10)(92d5171)
Could use some love to handle it more gracefully
[E 180110 13:38:04 ExecutionEngine:835] COULD NOT EXECUTE OP: 'NoneType' object has no attribute 'GetBigInteger' b'\x9f' LT
[E 180110 13:38:04 ExecutionEngine:836] 'NoneType' object has no attribute 'GetBigInteger'
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-python/neo/VM/ExecutionEngine.py", line 833, in StepInto
self.ExecuteOp(op, self.CurrentContext)
File "/Users/erik/Documents/code/neo-python/neo/VM/ExecutionEngine.py", line 524, in ExecuteOp
x2 = estack.Pop().GetBigInteger()
AttributeError: 'NoneType' object has no attribute 'GetBigInteger'
I'm running a Python node on my workstation on NEO TestNet for almost three weeks now. Suddenly my workstation starts running slow. The Python process was using a lot of resources (over 12 GB memory and about 50% CPU) and the usage was climbing quite quickly. I had to shutdown the node.
Command:
python prompt.py -t
Last state of the node:
[TestNet] Progress: 884333/884402
Environment:
Ubuntu 16.04 LTS
Python 3.5.2
Version:
Commit: fe5f65f
I'm having no further issues with my workstation.
Opening this for discussion.
I understand the prompt needs to read generic input strings. I think it would be beneficial to add function signatures as soon as possible, and restrict this dynamic args
list to prompt.py
as much as possible.
For instance neo.Prompt.Commands.LoadSmartContract.LoadContract
: Instead of def LoadContract(args):
it could/should be def LoadContract(path, params, return_type, needs_storage):
This would make the code a lot easier to understand, and also more resilient to errors and bugs.
Implement NEP2 standard for passphrase protection outlined here:
https://github.com/neo-project/proposals/blob/master/nep-2.mediawiki
For feature parity with NEO VM from commit neo-project/neo-vm@2ab361a
I would love to be able to bundle several smart contract invocations into a single transaction.
If anyone wants to take a stab at this, that would be great! If not, perhaps at some later date I'll find enough time to try taking a look. I think this feature will become an increasingly important thing to do for more complex SC interactions.
Adding this ticket mainly to keep track of any development and references.
Add RPC server to allow other clients to interface with neo-python
Add tests for RPC server interface
help
shows that invoke
and cancel
are valid commands
trying to use it gives
command invoke not found
and
command cancel not found
Devbranch commit: db617bf
Hi all,
First of all, great work that you are doing for NEO. I noticed this library and wanted to use it myself to test NEO smart contract development in Python. I created a Dockerfile with the following lines:
FROM ubuntu:16.04
RUN apt-get update && apt-get -y install git python-dev python-pip libleveldb-dev
RUN git clone https://github.com/CityOfZion/neo-python.git
WORKDIR neo-python
RUN pip install -r requirements.txt
CMD python prompt.py
However, when running a container build from this Dockerfile, it results in the following error.
Traceback (most recent call last):
File "prompt.py", line 15, in
from neo.Network.NodeLeader import NodeLeader
File "/neo-python/neo/Network/NodeLeader.py", line 2, in
from neo.Core.Block import Block
File "/neo-python/neo/Core/Block.py", line 6, in
from neo.Core.TX.Transaction import Transaction,TransactionType
File "/neo-python/neo/Core/TX/Transaction.py", line 10, in
from neo.Core.TX.TransactionAttribute import *
File "/neo-python/neo/Core/TX/TransactionAttribute.py", line 16, in
class TransactionAttributeUsage(object):
File "/neo-python/neo/Core/TX/TransactionAttribute.py", line 17, in TransactionAttributeUsage
ContractHash = int.from_bytes(b'\x00','little')
AttributeError: type object 'int' has no attribute 'from_bytes'
Did I miss something or maybe need to use a Python version other than 2.7? Or am I being too curious and is it not ready yet?
Thanks again and if you need any help with development please let me know.
Example:
b'#\xba\'\x03\xc52c\xe8\xd6\xe5"\xdc2 39\xdc\xd8\xee\xe9'
"UInt160
, its just scripthash.Data
When i use final command : i.e. pip install -e D:/pyt
Then i am facing the problem. Please let me know where i am doing wrong.
c:\users\xyz\appdata\local\programs\python\python35\include\pyconfig.h(243): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2
Can somebody tell me what can be the problem?
`neo> import contract /home/myaps/Documents/neo_systems/neosense/contract/neosense.avm test 0710 05 True False contract properties: 3 Please fill out the following contract details: [Contract Name] > asdasdasd [Contract Version] > 1 [Contract Author] > Es [Contract Email] > [email protected] [Contract Description] > asdasdasd Creating smart contract.... Name: asdasdasd Version: 1 Author: Es Email: [email protected] Description: asdasdasd Needs Storage: True Needs Dynamic Invoke: True { "script": "0138c56b6c766b00527ac46c766b51527ac46c766b51c300c36c766b52527ac46c766b52c36168184e656f2e52756e74696d652e436865636b5769746e657373616c766b53527ac46c766b53c3632d000e4e6f7420417574686f72697a656461680f4e656f2e52756e74696d652e4c6f676162030000616c75660a417574686f72697a656461680f4e656f2e52756e74696d652e4c6f67616c766b51c351c36c766b54527ac46c766b52c36c766b54c3617e6c766b55527ac46c766b51c361c0539c6455001a4c6963656e736520666f7220646966666572656e74207573657261680f4e656f2e52756e74696d652e4c6f67616c766b51c352c36c766b56527ac46c766b56c36c766b54c3617e6c766b57527ac4623d000e4c6963656e736520666f72206d6561680f4e656f2e52756e74696d652e4c6f67616c766b52c36c766b56527ac46c766b55c36c766b57527ac46c766b00c3009e6400006c766b00c30f526567697374657250726f647563749c64cf000f526567697374657250726f6475637461680f4e656f2e52756e74696d652e4c6f67616168164e656f2e53746f726167652e476574436f6e74657874616c766b54c37c61680f4e656f2e53746f726167652e476574616c766b58527ac46c766b58c3636a006168164e656f2e53746f726167652e476574436f6e74657874616c766b54c36c766b52c3527261680f4e656f2e53746f726167652e507574611250726f64756374205265676973746572656461680f4e656f2e52756e74696d652e4c6f676162030051616c75666c766b00c30e4c6963656e736550726f647563749c6496000e4c6963656e736550726f6475637461680f4e656f2e52756e74696d652e4c6f67616c766b54c361650b036468006168164e656f2e53746f726167652e476574436f6e74657874616c766b57c36c766b56c3527261680f4e656f2e53746f726167652e507574611050726f64756374204c6963656e73656461680f4e656f2e52756e74696d652e4c6f676162030051616c75666c766b00c30f5472616e736665724c6963656e73659c647e016168164e656f2e53746f726167652e476574436f6e74657874616c766b55c37c61680f4e656f2e53746f726167652e476574616c766b59527ac46c766b59c3643c010e4c6963656e73652065786973747361680f4e656f2e52756e74696d652e4c6f67616c766b59c36168184e656f2e52756e74696d652e436865636b5769746e657373616c766b5a527ac46c766b5ac364ea001555736572206973204c6963656e7365204f776e657261680f4e656f2e52756e74696d652e4c6f67616c766b51c352c36c766b5b527ac46c766b5bc36c766b54c3617e6c766b5c527ac46168164e656f2e53746f726167652e476574436f6e74657874616c766b55c37c6168124e656f2e53746f726167652e44656c657465616168164e656f2e53746f726167652e476574436f6e74657874616c766b5cc36c766b5bc3527261680f4e656f2e53746f726167652e50757461124c6963656e7365205472616e73666572656461680f4e656f2e52756e74696d652e4c6f676162030051616c75666c766b00c30d52656d6f76654c6963656e73659c646e006c766b54c36165ef006462006c766b51c352c36c766b5d527ac46c766b5dc36c766b54c3617e6c766b5e527ac46168164e656f2e53746f726167652e476574436f6e74657874616c766b5ec37c6168124e656f2e53746f726167652e44656c6574656162030051616c75666c766b00c30a4765744c6963656e73659c646f000a4765744c6963656e736561680f4e656f2e52756e74696d652e4c6f67616168164e656f2e53746f726167652e476574436f6e74657874616c766b57c37c61680f4e656f2e53746f726167652e476574616c766b59527ac46c766b59c3640f006203006c766b59c3616c7566620300006600616c756657c56b6c766b00527ac417416d2049207468652070726f64756374206f776e65723f61680f4e656f2e52756e74696d652e4c6f67616168164e656f2e53746f726167652e476574436f6e74657874616c766b00c37c61680f4e656f2e53746f726167652e476574616c766b51527ac46c766b51c36168184e656f2e52756e74696d652e436865636b5769746e657373616c766b52527ac46c766b52c3632d00164e6f74207468652070726f64756374206f776e65722161680f4e656f2e52756e74696d652e4c6f67616203006c766b52c3616c756653c56b6c766b00527ac46c766b51527ac462030000616c756653c56b6c766b00527ac46c766b51527ac462030000616c756654c56b6c766b00527ac46c766b51527ac46c766b52527ac462030000616c756653c56b6c766b00527ac46c766b51527ac462030000616c756651c56b62030000616c756652c56b6c766b00527ac462030000616c7566", "hash": "54b96f38b8ca5ff9ff93a1b953ff91b941a16ff9", "returntype": "0710", "parameters": "10" } Could not execute command: ord() expected a character, but string of length 2 found File "/usr/lib/python3.5/threading.py", line 882, in _bootstrap self._bootstrap_inner() File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner self.run() File "/usr/lib/python3.5/threading.py", line 862, in run self._target(*self._args, **self._kwargs) File "/home/myaps/Documents/neo_systems/neo-boa/venv/lib/python3.5/site-packages/twisted/_threads/_threadworker.py", line 46, in work task() File "/home/myaps/Documents/neo_systems/neo-boa/venv/lib/python3.5/site-packages/twisted/_threads/_team.py", line 190, in doWork task() File "/home/myaps/Documents/neo_systems/neo-boa/venv/lib/python3.5/site-packages/twisted/python/threadpool.py", line 250, in inContext result = inContext.theWork() File "/home/myaps/Documents/neo_systems/neo-boa/venv/lib/python3.5/site-packages/twisted/python/threadpool.py", line 266, in inContext.theWork = lambda: context.call(ctx, func, *args, **kw) File "/home/myaps/Documents/neo_systems/neo-boa/venv/lib/python3.5/site-packages/twisted/python/context.py", line 122, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw) File "/home/myaps/Documents/neo_systems/neo-boa/venv/lib/python3.5/site-packages/twisted/python/context.py", line 85, in callWithContext return func(*args,**kw) File "prompt.py", line 914, in run traceback.print_stack() Traceback (most recent call last): File "prompt.py", line 867, in run self.do_import(arguments) File "prompt.py", line 325, in do_import return self.load_smart_contract(arguments) File "prompt.py", line 729, in load_smart_contract contract_script = GatherContractDetails(function_code, self) File "/home/myaps/Documents/neo_systems/neo-python/neo/Prompt/Commands/LoadSmartContract.py", line 200, in GatherContractDetails function_code.ContractProperties, ord(function_code.ReturnType), TypeError: ord() expected a character, but string of length 2 found neo> exit
`
send nonexistingassetid {address} {amount}
throws an uncatched AttributeError.
The wallet can actually do more than is currently described in the readme and I'll update that once the current pull request is worked in.
Right now there's 2 logs- print to the console ( fun, but annoying sometimes ) and log to prompt.log
.
Ideally we'd keep prompt.log
as it is, but add another log or loglevel to print smart contract debugging statements and Runtime.Notify
events.
Invoking a (Java) smart contract that is using Runtime.log("..") in the Main method will cause the following error:
COULD NOT GET STR LENGTH! could not execute command: maximum recursion depth exceeded
...
File "/neo-python/neo/VM/InteropService.py", line 349, in stack_item_to_py
return [stack_item_to_py(item) for item in stack_item.GetArray()]
RecursionError: maximum recursion depth exceeded
All CoZ repos need to have an MIT license.
testinvoke ad60f5039b4fb0b5cd606ab7b77c770ddb2d6cce deploy []
invoking contract - ImusifyXYZ
checkhing hash...
key is <neo.Wallets.KeyPair.KeyPair object at 0x7fa84ac4e470>
Signing.... <neo.Core.TX.InvocationTransaction.InvocationTransaction object at 0x7fa8426d71d0> <neo.Wallets.KeyPair.KeyPair object at 0x7fa84ac4e470>
private key b'AXMzg\x07\xc5r\xc5\x93W\x08\xeb,\xed\x13\x9a\xbf\x11\x87\xbf\xb1O\xc1\x8b\xff\x919<\xfelI' result is bytearray(b'o\xab\x16\x91\xd2\xa1\xe6h\x1c\xb0m?7\x88\xaa+=\x83_T\xf5\xd7-I\x0fc\x1d\x81\xdd\x08:Zjr\x16\xbb`\xfd\xa1\xff\xd28\x1eW\xfd\xf9/\xbfy@\xd5\xfa\x91\xe61\xc2\x9f\xba\xa8w\xfb\xd9\x00\x18')
signature bytearray(b'o\xab\x16\x91\xd2\xa1\xe6h\x1c\xb0m?7\x88\xaa+=\x83_T\xf5\xd7-I\x0fc\x1d\x81\xdd\x08:Zjr\x16\xbb\xfd\xa1\xff\xd28\x1eW\xfd\xf9/\xbfy@\xd5\xfa\x91\xe61\xc2\x9f\xba\xa8w\xfb\xd9\x00\x18') ADDING SIG!! .... <neo.SmartContract.Contract.Contract object at 0x7fa84431c908> 0 bytearray(b'o\xab\x16\x91\xd2\xa1\xe6h\x1c\xb0m?7\x88\xaa+=\x83_T\xf5\xd7-I\x0fc\x1d\x81\xdd\x08:Zjr\x16\xbb
\xfd\xa1\xff\xd28\x1eW\xfd\xf9/\xbfy@\xd5\xfa\x91\xe61\xc2\x9f\xba\xa8w\xfb\xd9\x00\x18')
ADDING iTEM:: <neo.SmartContract.ContractParameterContext.ContextItem object at 0x7fa8427675f8>
result is True
success is True
going through items b'2102d69b910e9158304eeed1627a06fae7177c257caa8d4106937b9ee50dfea9f39fac'
item parameters??? <neo.SmartContract.ContractParameterContext.ContractParamater object at 0x7fa8428aa748>
going through items b'2102d69b910e9158304eeed1627a06fae7177c257caa8d4106937b9ee50dfea9f39fac'
item parameters??? <neo.SmartContract.ContractParameterContext.ContractParamater object at 0x7fa8428aa748>
GETTING SCRIPTS, item is <neo.SmartContract.ContractParameterContext.ContextItem object at 0x7fa8427675f8>
[Neo.Storage.Get] [Script:ad60f5039b4fb0b5cd606ab7b77c770ddb2d6cce] [b'totalSupply'] -> 0
self._bootstrap_inner()
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "~/venv/lib/python3.5/site-packages/twisted/_threads/_threadworker.py", line 46, in work
task()
File "~/venv/lib/python3.5/site-packages/twisted/_threads/_team.py", line 190, in doWork
task()
File "~/venv/lib/python3.5/site-packages/twisted/python/threadpool.py", line 250, in inContext
result = inContext.theWork()
File "~/venv/lib/python3.5/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
File "~/venv/lib/python3.5/site-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "~/venv/lib/python3.5/site-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
File "prompt.py", line 742, in run
self.test_invoke_contract(arguments)
File "prompt.py", line 596, in test_invoke_contract
tx, fee, results,num_ops = TestInvokeContract(self.Wallet, args)
File "~/neo-python/neo/Prompt/Commands/Invoke.py", line 139, in TestInvokeContract
return test_invoke(out, wallet, outputs)
File "~/neo-python/neo/Prompt/Commands/Invoke.py", line 201, in test_invoke
success = engine.Execute()
File "~/neo-python/neo/SmartContract/ApplicationEngine.py", line 163, in Execute
self.gas_consumed = self.gas_consumed + self.GetPrice() * self.ratio
File "~/neo-python/neo/SmartContract/ApplicationEngine.py", line 208, in GetPrice
return self.GetPriceForSysCall()
Exception calculating gas consumbed Not supported- Cant get byte array for item <class 'neo.VM.InteropService.InteropInterface'> <neo.SmartContract.StorageContext.StorageContext object at 0x7fa842773400>```
error executing contract.....
Error testing contract invoke
This prevents further syncing of mainnet chain
Implement support for the NEP-6 wallet spec: neo-project/neo-gui-2.x#106
For example if wget in docker_build.sh can not download the
https://github.com/neo-project/neo-cli/releases/download/v2.5.2/neo-cli-ubuntu.16.04-x64.zip
2 files with 0 size are generated:
-rw-r--r-- 1 user staff 0B 15 Jan 09:29 neo-cli.zip
-rw-r--r-- 1 user staff 0B 15 Jan 09:29 neo-release-2.5.2.zip
This again causes the build fail:
Step 13/40 : RUN unzip -q -d /opt/node1 /opt/neo-cli.zip
---> Running in 3ed4eb892609
[/opt/neo-cli.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
#!/bin/bash
unzip: cannot find zipfile directory in one of /opt/neo-cli.zip or
/opt/neo-cli.zip.zip, and cannot find /opt/neo-cli.zip.ZIP, period.
Solved this problem with using the
--no-check-certificate for wget in my case.
wget --no-check-certificate -O https://github.com/neo-project/neo-cli/releases/download/v2.5.2/neo-cli-ubuntu.16.04-x64.zip
But the underlying problem should be solved in my opinion:
If files are not downloaded in a correct manner:
docker build -t neo-privnet .
should not be executed
With transfer notifications now persisting #155 we are able to show a balance history for NEP5 tokens in the wallet. This feature request proposes integrating those transfer notifications into UserWallet
so that users can see their NEP5 token transfer history.
Observed while syncing test net
[I 171120 13:40:57 EventHub:99] [SmartContract.Execution.Success][646058] [8947279d24cfcac050e14c84d748ec78aeea6dd4] [tx a0f11cf23d1c828d782beae8103b6089e036aacce776a55ccfb544994f1925ea] [b'\x00']
[E 171120 13:40:57 ExecutionEngine:800] COULD NOT EXECUTE OP: list assignment index out of range b'\xc4' SETITEM
[E 171120 13:40:57 ExecutionEngine:801] list assignment index out of range
Traceback (most recent call last):
File "/Users/erik/Documents/code/neo-python/neo/VM/ExecutionEngine.py", line 798, in StepInto
self.ExecuteOp(op, self.CurrentContext)
File "/Users/erik/Documents/code/neo-python/neo/VM/ExecutionEngine.py", line 710, in ExecuteOp
newItem = newItem.Clone()
File "/Users/erik/Documents/code/neo-python/neo/VM/InteropService.py", line 265, in Clone
newArray[i] = None
IndexError: list assignment index out of range
[I 171120 13:40:57 EventHub:99] [SmartContract.Execution.Fail][646061] [8947279d24cfcac050e14c84d748ec78aeea6dd4] [tx 18378c04113089f56ce36ac474a2a6da9da249db628e37ba4c23bec370834a5c] [[[<neo.Core.TX.InvocationTransaction.InvocationTransaction object at 0x107011978>, <neo.Core.TX.Transaction.TransactionOutput object at 0x10590f630>, b'/<\xaa!\xd8(\x94\x02\xf2\x96\tT\x9a2\xed\xa0aZ7\xb7', [<neo.Core.TX.Transaction.TransactionOutput object at 0x117dfa550>, <neo.Core.TX.Transaction.TransactionOutput object at 0x117dfaeb8>, <neo.Core.TX.Transaction.TransactionOutput object at 0x120613160>], b"\xd4m\xea\xaex\xecH\xd7\x84L\xe1P\xc0\xca\xcf$\x9d'G\x89", 10000000000, [<neo.Core.TX.Transaction.TransactionOutput object at 0x117dfa550>, <neo.Core.TX.Transaction.TransactionOutput object at 0x117dfaeb8>, <neo.Core.TX.Transaction.TransactionOutput object at 0x120613160>], 3, <neo.Core.TX.Transaction.TransactionOutput object at 0x120613160>, False, None, None], 10], None, 6]
Hi,
I've run into an issue while following the install instructions for OSX with Python 3.5. I've installed leveldb with brew and successfully installed the requirements with pip with no errors outputted. However, when I ran:
python prompt.py
i received the following output:
Traceback (most recent call last):
File "prompt.py", line 25, in <module>
from neo.Implementations.Blockchains.LevelDB.LevelDBBlockchain import LevelDBBlockchain
File "/Users/andylee/Desktop/Repos/neo-python/neo/Implementations/Blockchains/LevelDB/LevelDBBlockchain.py", line 2, in <module>
import plyvel
File "/Users/andylee/Desktop/Repos/neo-python/venv/lib/python3.5/site-packages/plyvel/__init__.py", line 6, in <module>
from ._plyvel import ( # noqa
ImportError: dlopen(/Users/andylee/Desktop/Repos/neo-python/venv/lib/python3.5/site-packages/plyvel/_plyvel.cpython-35m-darwin.so, 2): Symbol not found: __ZTIN7leveldb10ComparatorE
Referenced from: /Users/andylee/Desktop/Repos/neo-python/venv/lib/python3.5/site-packages/plyvel/_plyvel.cpython-35m-darwin.so
Expected in: dynamic lookup
I followed the recommended solution and uninstalled plyvel and reinstalled with the recommended cflags
pip uninstall plyvel
CFLAGS='-mmacosx-version-min=10.7 -stdlib=libc++' pip install --no-use-wheel plyvel --no-cache-dir --global-option=build_ext --global-option="-I/usr/local/Cellar/leveldb/1.20_2/include/" --global-option="-L/usr/local/lib"
Now when I run python prompt.py
I am faced with the following
Traceback (most recent call last):
File "prompt.py", line 25, in <module>
from neo.Implementations.Blockchains.LevelDB.LevelDBBlockchain import LevelDBBlockchain
File "/Users/andylee/Desktop/Repos/neo-python/neo/Implementations/Blockchains/LevelDB/LevelDBBlockchain.py", line 2, in <module>
import plyvel
File "/Users/andylee/Desktop/Repos/neo-python/venv/lib/python3.5/site-packages/plyvel/__init__.py", line 6, in <module>
from ._plyvel import ( # noqa
ImportError: dynamic module does not define module export function (PyInit__plyvel)
Not quite sure where to go from here, and any help would be greatly appreciated!
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.