discipl / core

Discipl Core
GNU General Public License v3.0
9 stars 8 forks source link

Create tutorial for discipl-core-<platform> demonstration purposes #7

Open sgort opened 6 years ago

sgort commented 6 years ago

Become somewhat familiar with Node.js, run Logiesbelasting use case scripts on personal hadware and/or environment and provide a public tutorial for demonstration purposes.

sgort commented 6 years ago

reminder

Show https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-a-linux-vps with example


steven@steven-K501LX:~/Code/discipl-core-iota$ nano ~/.bashrc

# Iota full node url
# set environment variable for iota full node used with discipl node.js scripts
export IOTANODEURL="http://167.99.37.75:14265/"
sgort commented 6 years ago

reminder

Don't forget to publish 'discipl-core-baseconnector' as npm package to prevent this error from happening.

steven@steven-K501LX:~/Code/discipl-core-uport$ npm update

npm ERR! code E404
npm ERR! 404 Not found : discipl-core-baseconnector
npm ERR! 404 
npm ERR! 404  'discipl-core-baseconnector' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Where the dsicipl-core-baseconnector isn't published yet, we need to define dependencies with proper git source(s).

Add to the package.json file:


"dependencies": {
    "discipl-core-baseconnector": "git+https://github.com/discipl/discipl-core-baseconnector.git"
  }
sgort commented 6 years ago

reminder

With an error such as: Error: Cannot find module 'uport-connect'

steven@steven-K501LX:~/Code/discipl-core-uport$ npm i --save uport-connect

Git status will look something like:

steven@steven-K501LX:~/Code/discipl-core-uport$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   package-lock.json
    modified:   package.json

no changes added to commit (use "git add" and/or "git commit -a")

Git add, commit and push is what's left:

steven@steven-K501LX:~/Code/discipl-core-uport$ git add .
steven@steven-K501LX:~/Code/discipl-core-uport$ git commit -m 'save uport-connect dependency'
[master 2674b29] save uport-connect dependency
 2 files changed, 300 insertions(+), 296 deletions(-)
steven@steven-K501LX:~/Code/discipl-core-uport$ git push
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 3.01 KiB | 3.01 MiB/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To github.com:discipl/discipl-core-uport.git
   ba4472a..2674b29  master -> master
steven@steven-K501LX:~/Code/discipl-core-uport$ 
sgort commented 6 years ago

Reminder

Notes for installing & running IPv8 connector tests

  1. Clone Tribler Python implementation of the IPv8 layer

    steven@steven-K501LX:~/Code$ git clone https://github.com/Tribler/py-ipv8.git
    Cloning into 'py-ipv8'...
    remote: Counting objects: 2901, done.
    remote: Compressing objects: 100% (14/14), done.
    remote: Total 2901 (delta 4), reused 4 (delta 0), pack-reused 2887
    Receiving objects: 100% (2901/2901), 667.38 KiB | 1.30 MiB/s, done.
    Resolving deltas: 100% (1997/1997), done.
  2. Install pip if not already done

    steven@steven-K501LX:~/Code/py-ipv8$ sudo apt install python-pip *(note the error!)*
  3. Install dependencies for IPv8

    steven@steven-K501LX:~/Code/py-ipv8$ pip install --upgrade -r requirements.txt
    Collecting cryptography>=2.3dev1 (from -r requirements.txt (line 1))
    Downloading https://files.pythonhosted.org/packages/87/e6/915a482dbfef98bbdce6be1e31825f591fc67038d4ee09864c1d2c3db371/cryptography-2.3.1-cp27-cp27mu-manylinux1_x86_64.whl (2.1MB)
    100% |████████████████████████████████| 2.1MB 453kB/s 
    Collecting libnacl>=1.6.1 (from -r requirements.txt (line 2))
    Downloading https://files.pythonhosted.org/packages/60/55/0ce2a0b37264b8ec2be2765fdeefc5e7991b54f78bc9142120fa3f352782/libnacl-1.6.1-py2.py3-none-any.whl
    Collecting netifaces (from -r requirements.txt (line 3))
    Downloading https://files.pythonhosted.org/packages/70/dd/411bb4cda549136cf9ff5dbd4f33f898fd90b25ac73fd4ea42a3d3e8fd15/netifaces-0.10.7-cp27-cp27mu-manylinux1_x86_64.whl
    Collecting networkx (from -r requirements.txt (line 4))
    Downloading https://files.pythonhosted.org/packages/11/42/f951cc6838a4dff6ce57211c4d7f8444809ccbe2134179950301e5c4c83c/networkx-2.1.zip (1.6MB)
    100% |████████████████████████████████| 1.6MB 481kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named setuptools
    
    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-dVoV7N/networkx/

    About the error: setuptools do not appear to be installed. Follow the Installation Instructions from the PyPI website.

  4. The libsodium package will have to be installed manually. (note the error!)

    steven@steven-K501LX:~/Code/py-ipv8$ sudo apt-get install libsodium18
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package libsodium18

    Sounds like How To Install the Django Web Framework on Ubuntu 14.04 from Digital Ocean is a better option to follow installing python.