Giter Club home page Giter Club logo

neosense's Introduction

neosense

NEO Licensing dApp Smart Contract built with Python (neo-boa), used as example contract in Dean's NEO Development Workshops.

The smart contract is explained in this tutorial (NEO Amsterdam Developer Workshop): https://youtu.be/yLPEsst_SVw

neosense's People

Contributors

deanpress avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

neosense's Issues

Error during deploying

Any ideas why we get this?

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

No output with testinvoke

Hi Dann! Thanks a lot for this talk really interesting. I followed it very carefully trying to mimic what you did. I created the smartcontract but when I use testinvoke I do not see the output coming from the compiled code. Can you help with it? Also which app are you using to see the privnet wallet?

I just report here the commands done:

docker pull cityofzion/neo-privatenet
docker run --rm -d --name neo-privatenet -p 20333-20336:20333-20336/tcp -p 30333-30336:30333-30336/tcp cityofzion/neo-privatenet

docker exec -it neo-privatenet /bin/bash
rm -rf /root/.neopython/Chains/privnet/
neopy
create wallet privnet1
pw: neocamp2018
import wif KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr
open wallet privnet1
pw: MyPW
build ./neosense.py
import contract ./neosense.avm 8172 01 True False False
...
...
{
 55         "hash": "0x20e01f4299ba22b1d151a7ec6c15eb2034e26ae2",
...
...
Results:
[<neo.Core.State.ContractState.ContractState object at 0x7f5ddd736a58>]
Deploy Invoke TX GAS cost: 490.0
Deploy Invoke TX Fee: 0.0

testinvoke 0x20e01f4299ba22b1d151a7ec6c15eb2034e26ae2 RegisterProduct ['AHN16o8aLv1y1fiY5xBqXBmshBneWZrHth','MyFirstProduct']

Used 1.393 Gas

--------------------------------------------------
Test invoke successful
Total operations: 145
Results [{'type': 'Integer', 'value': '1'}]
Invoke TX GAS cost: 0.0
Invoke TX fee: 0.0001

I cannot figure out the problem. Do you have any idea? Which tools can I use to debug it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.