Coder Social home page Coder Social logo

nos-local's Introduction

nOS Local

An environment for nOS development.

For now, manually start the neo-local environment and load contracts:

$ git clone https://github.com/nos/nos-local.git
$ cd nos-local
$ make run

If you exit the neo-python prompt, access it again with Docker:

$ sudo docker exec -it neo-python /bin/sh -c /bin/bash
$ np-prompt -p -v

Windows enviroment

Install Docker: https://docs.docker.com/docker-for-windows/install/#what-to-know-before-you-install Switch to linux containers (right click on tray icon)

$ git clone https://github.com/nos/nos-local.git
$ cd nos-local
$ makeWIN

Once you're at the neo-python prompt (wallet password is "coz"):

open wallet ./neo-privnet.wallet
build /smart-contracts/contract.py
import contract /smart-contracts/contract.avm 0710 05 True False False

Fill out the prompts for the contract meta data. Just hit [enter] if you're in a hurry 😉.

Wait a 🔥 minute and the nOS name service contract is deployed!

Let's register an example domain name with nOS:

testinvoke 9a309cfe03cead5b653bbb11f68ff6beced8f031 RegisterDomain ['AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y', 'bucket.neo', 'https://ihasabucket.com/', 'AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y']

Wait for the TX to clear, and test your domain is registered:

testinvoke 9a309cfe03cead5b653bbb11f68ff6beced8f031 GetDomain ['AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y', 'bucket.neo']

Visit nos://bucket.neo in the client!

nos-local's People

Contributors

ambethia avatar deanpress avatar jeroenptrs avatar mhuggins avatar robmoorman avatar wechta avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nos-local's Issues

NeoSCAN and other clients cannot connect to neo local

Expected Behavior

NEOScan should get the number of transactions and addresses from neo local chain.
NeoScan

Current Behavior

NEOScan show empty fields regarding the number of transactions and addresses.

Steps to Reproduce

  1. clone nos-local
  2. make run
  3. open localhost:4000

Possible Solution

Additional context

Your Environment

  • nOS Client version used: latest master / latest dev
  • Environment name and version
    • Node version: v10.10.0
    • NPM version: 6.4.1
    • Yarn version: v1.7.0
  • Operating System and version (desktop or mobile):
MacOS: 10.13.6
Docker: Version 18.06.1-ce-mac74 (26766)
Nos-local, neo-local: latest
Tried: Factory reset docker multiple times.

Cannot start Neo Scan - MAC

I am trying to run the nos-local shell via "make run"
I observed that the neo scan container starts and then stops with an exception after few seconds. When I observed the logs of the container, I can see several instances of exception below -

2018-07-15 06:03:27.172 [warn] [[email protected]] found 0 missing blocks
2018-07-15 06:03:27.177 [error] [[email protected]] GenServer NeoscanSync.TokenSyncer terminating
** (MatchError) no match of right hand side value: {:ok, []}
    (neoscan_node) lib/neoscan_node/notifications.ex:49: NeoscanNode.Notifications.get_token_notifications/0
    (neoscan_sync) lib/neoscan_sync/token_syncer.ex:30: NeoscanSync.TokenSyncer.sync_tokens/0
    (neoscan_sync) lib/neoscan_sync/token_syncer.ex:25: NeoscanSync.TokenSyncer.handle_info/2
    (stdlib) gen_server.erl:616: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:686: :gen_server.handle_msg/6
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: :sync

=CRASH REPORT==== 15-Jul-2018::06:03:27 ===
  crasher:
    initial call: Elixir.NeoscanSync.TokenSyncer:init/1
    pid: <0.1983.0>
    registered_name: 'Elixir.NeoscanSync.TokenSyncer'
    exception error: no match of right hand side value {ok,[]}
      in function  'Elixir.NeoscanNode.Notifications':get_token_notifications/0 (lib/neoscan_node/notifications.ex, line 49)
      in call from 'Elixir.NeoscanSync.TokenSyncer':sync_tokens/0 (lib/neoscan_sync/token_syncer.ex, line 30)
      in call from 'Elixir.NeoscanSync.TokenSyncer':handle_info/2 (lib/neoscan_sync/token_syncer.ex, line 25)
      in call from gen_server:try_dispatch/4 (gen_server.erl, line 616)
      in call from gen_server:handle_msg/6 (gen_server.erl, line 686)
    ancestors: ['Elixir.NeoscanSync.Supervisor',<0.1849.0>]
    message_queue_len: 0
    messages: []
    links: [<0.1707.0>,<0.1850.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 1598
    stack_size: 27
    reductions: 5164
  neighbours:

=SUPERVISOR REPORT==== 15-Jul-2018::06:03:27 ===
     Supervisor: {local,'Elixir.NeoscanSync.Supervisor'}
     Context:    child_terminated
     Reason:     {{badmatch,{ok,[]}},
                  [{'Elixir.NeoscanNode.Notifications',
                       get_token_notifications,0,
                       [{file,"lib/neoscan_node/notifications.ex"},{line,49}]},
                   {'Elixir.NeoscanSync.TokenSyncer',sync_tokens,0,
                       [{file,"lib/neoscan_sync/token_syncer.ex"},{line,30}]},
                   {'Elixir.NeoscanSync.TokenSyncer',handle_info,2,
                       [{file,"lib/neoscan_sync/token_syncer.ex"},{line,25}]},
                   {gen_server,try_dispatch,4,
                       [{file,"gen_server.erl"},{line,616}]},
                   {gen_server,handle_msg,6,
                       [{file,"gen_server.erl"},{line,686}]},
                   {proc_lib,init_p_do_apply,3,
                       [{file,"proc_lib.erl"},{line,247}]}]}
     Offender:   [{pid,<0.1983.0>},
                  {id,'Elixir.NeoscanSync.TokenSyncer'},
                  {mfargs,{'Elixir.NeoscanSync.TokenSyncer',start_link,[]}},
                  {restart_type,permanent},
                  {shutdown,5000},
                  {child_type,worker}]

I am not able to figure out what is causing this? Any help will be appreciated

Error with installing smart contract on UBuntu 16.04

Running below command gives error in neo-python on Ubuntu 16.04
neo> import contract /smart-contracts/contract.avm 0710 05 True False

Please fill out the following contract details:
[Contract Name] > 1
[Contract Version] > 1
[Contract Author] > 1
[Contract Email] > 1
[Contract Description] > 1
Creating smart contract....
                 Name: 1 
              Version: 1
               Author: 1 
                Email: 1 
          Description: 1 
        Needs Storage: True 
 Needs Dynamic Invoke: False 
{
    "hash": "0xe60a3fa8149a853eb4dff4f6ed93c931646a9e22",
    "script": "0123c56b6a00527ac46a51527ac46a51c300c36a52527ac46a51c351c36a53527ac46a53c3062e6f776e65727e6a54527ac46a53c3072e7461726765747e6a55527ac41423ba2703c53263e8d6e522dc32203339dcd8eee96a56527ac46a00c309476574446f6d61696e9c64350068164e656f2e53746f726167652e476574436f6e74657874616a55c37c680f4e656f2e53746f726167652e476574616c7566616a52c368184e656f2e52756e74696d652e436865636b5769746e657373616a57527ac46a57c36328000e4e6f7420417574686f72697a6564680f4e656f2e52756e74696d652e4c6f6761006c7566610a417574686f72697a6564680f4e656f2e52756e74696d652e4c6f67616a00c30e5265676973746572446f6d61696e9c64ac006a56c368184e656f2e52756e74696d652e436865636b5769746e65737361648b006a51c352c36a58527ac468164e656f2e53746f726167652e476574436f6e74657874616a54c36a58c35272680f4e656f2e53746f726167652e507574616a51c3c0549c6440006a51c353c36a59527ac468164e656f2e53746f726167652e476574436f6e74657874616a55c36a59c35272680f4e656f2e53746f726167652e5075746161516c7566616a00c30f536574446f6d61696e5461726765749c6487006a54c368184e656f2e52756e74696d652e436865636b5769746e657373616324006a56c368184e656f2e52756e74696d652e436865636b5769746e65737361644500616a51c352c36a59527ac468164e656f2e53746f726167652e476574436f6e74657874616a55c36a59c35272680f4e656f2e53746f726167652e50757461516c7566616a00c30c44656c657465446f6d61696e9c648c006a56c368184e656f2e52756e74696d652e436865636b5769746e65737361646b0068164e656f2e53746f726167652e476574436f6e74657874616a54c37c68124e656f2e53746f726167652e44656c6574656168164e656f2e53746f726167652e476574436f6e74657874616a55c37c68124e656f2e53746f726167652e44656c65746561516c756661006c75665ec56b6a00527ac46a51527ac46a51c36a00c3946a52527ac46a52c3c56a53527ac4006a54527ac46a00c36a55527ac461616a00c36a51c39f6433006a54c36a55c3936a56527ac46a56c36a53c36a54c37bc46a54c351936a54527ac46a55c36a54c3936a00527ac462c8ff6161616a53c36c7566",
    "parameters": "0710",
    "returntype": "05"
}
Could not execute command: invalid literal for int() with base 10: b'\x05'
  File "/usr/lib/python3.6/threading.py", line 884, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/dist-packages/twisted/_threads/_threadworker.py", line 46, in work
    task()
  File "/usr/local/lib/python3.6/dist-packages/twisted/_threads/_team.py", line 190, in doWork
    task()
  File "/usr/local/lib/python3.6/dist-packages/twisted/python/threadpool.py", line 250, in inContext
    result = inContext.theWork()
  File "/usr/local/lib/python3.6/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.6/dist-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.6/dist-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
  File "/neo-python/neo/bin/prompt.py", line 1030, in run
    traceback.print_stack()
Traceback (most recent call last):
  File "/neo-python/neo/bin/prompt.py", line 978, in run
    self.do_import(arguments)
  File "/neo-python/neo/bin/prompt.py", line 378, in do_import
    return self.load_smart_contract(arguments)
  File "/neo-python/neo/bin/prompt.py", line 803, in load_smart_contract
    contract_script = GatherContractDetails(function_code, self)
  File "/neo-python/neo/Prompt/Commands/LoadSmartContract.py", line 185, in GatherContractDetails
    function_code.ContractProperties, function_code.ReturnTypeBigInteger,
  File "/neo-python/neo/Core/FunctionCode.py", line 19, in ReturnTypeBigInteger
    return BigInteger(self.ReturnType)
ValueError: invalid literal for int() with base 10: b'\x05'
neo> 
neo> import contract /smart-contracts/contract.avm 0710 05 True False
Please fill out the following contract details:
[Contract Name] > 1
[Contract Version] > 1
[Contract Author] > 1
[Contract Email] > 1
[Contract Description] > 11
Creating smart contract....
                 Name: 1 
              Version: 1
               Author: 1 
                Email: 1 
          Description: 11 
        Needs Storage: True 
 Needs Dynamic Invoke: False 
{
    "hash": "0xe60a3fa8149a853eb4dff4f6ed93c931646a9e22",
    "script": "0123c56b6a00527ac46a51527ac46a51c300c36a52527ac46a51c351c36a53527ac46a53c3062e6f776e65727e6a54527ac46a53c3072e7461726765747e6a55527ac41423ba2703c53263e8d6e522dc32203339dcd8eee96a56527ac46a00c309476574446f6d61696e9c64350068164e656f2e53746f726167652e476574436f6e74657874616a55c37c680f4e656f2e53746f726167652e476574616c7566616a52c368184e656f2e52756e74696d652e436865636b5769746e657373616a57527ac46a57c36328000e4e6f7420417574686f72697a6564680f4e656f2e52756e74696d652e4c6f6761006c7566610a417574686f72697a6564680f4e656f2e52756e74696d652e4c6f67616a00c30e5265676973746572446f6d61696e9c64ac006a56c368184e656f2e52756e74696d652e436865636b5769746e65737361648b006a51c352c36a58527ac468164e656f2e53746f726167652e476574436f6e74657874616a54c36a58c35272680f4e656f2e53746f726167652e507574616a51c3c0549c6440006a51c353c36a59527ac468164e656f2e53746f726167652e476574436f6e74657874616a55c36a59c35272680f4e656f2e53746f726167652e5075746161516c7566616a00c30f536574446f6d61696e5461726765749c6487006a54c368184e656f2e52756e74696d652e436865636b5769746e657373616324006a56c368184e656f2e52756e74696d652e436865636b5769746e65737361644500616a51c352c36a59527ac468164e656f2e53746f726167652e476574436f6e74657874616a55c36a59c35272680f4e656f2e53746f726167652e50757461516c7566616a00c30c44656c657465446f6d61696e9c648c006a56c368184e656f2e52756e74696d652e436865636b5769746e65737361646b0068164e656f2e53746f726167652e476574436f6e74657874616a54c37c68124e656f2e53746f726167652e44656c6574656168164e656f2e53746f726167652e476574436f6e74657874616a55c37c68124e656f2e53746f726167652e44656c65746561516c756661006c75665ec56b6a00527ac46a51527ac46a51c36a00c3946a52527ac46a52c3c56a53527ac4006a54527ac46a00c36a55527ac461616a00c36a51c39f6433006a54c36a55c3936a56527ac46a56c36a53c36a54c37bc46a54c351936a54527ac46a55c36a54c3936a00527ac462c8ff6161616a53c36c7566",
    "parameters": "0710",
    "returntype": "05"
}
Could not execute command: invalid literal for int() with base 10: b'\x05'
  File "/usr/lib/python3.6/threading.py", line 884, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/dist-packages/twisted/_threads/_threadworker.py", line 46, in work
    task()
  File "/usr/local/lib/python3.6/dist-packages/twisted/_threads/_team.py", line 190, in doWork
    task()
  File "/usr/local/lib/python3.6/dist-packages/twisted/python/threadpool.py", line 250, in inContext
    result = inContext.theWork()
  File "/usr/local/lib/python3.6/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.6/dist-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.6/dist-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
  File "/neo-python/neo/bin/prompt.py", line 1030, in run
    traceback.print_stack()
Traceback (most recent call last):
  File "/neo-python/neo/bin/prompt.py", line 978, in run
    self.do_import(arguments)
  File "/neo-python/neo/bin/prompt.py", line 378, in do_import
    return self.load_smart_contract(arguments)
  File "/neo-python/neo/bin/prompt.py", line 803, in load_smart_contract
    contract_script = GatherContractDetails(function_code, self)
  File "/neo-python/neo/Prompt/Commands/LoadSmartContract.py", line 185, in GatherContractDetails
    function_code.ContractProperties, function_code.ReturnTypeBigInteger,
  File "/neo-python/neo/Core/FunctionCode.py", line 19, in ReturnTypeBigInteger
    return BigInteger(self.ReturnType)
ValueError: invalid literal for int() with base 10: b'\x05'

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

TestInvoke Doesn't Work on Sample Contract

I am trying the sample contract.py present in the codebase which is used to register and transfer domain. I used the create-nos-app boilerplate to create a react application and filled the details of contract for invocation as below:

   // Add your smart contract's scriptHash here
    const scriptHash = "e60a3fa8149a853eb4dff4f6ed93c931646a9e22";
    // The operation of your smart contract you want to (test)invoke
    const operation = "RegisterDomain";

    // The necessary arguments for you (test)invoke
    const args = ['AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y', 'google.nos', 
    'AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y', 'https://ihasabucket.com/'];

    // The storagekey you want to query
    const key = "google.nos.target";

Problems:

  • The "RegisterDomain" operation doesn't work. The value is never stored to the blockchain.
  • "Invoke" always returns error.

I am using local environment. "GetDomain" and "GetStorage" works if I set the domain from the nos-local shell.
I am not sure about how to test "RegisterDomain" and "Invoke"

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Update neo-local

Currently the neo-local is linked to the NeoAuth version of Neo-Local. This version is old and outdated.

We should replace this submodule with the one from CoZ - which is maintained and compatible with windows aswell

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.