aletheia-foundation / aletheia-app

Alethia peer to peer publishing platform
http://aletheia-foundation.io/
GNU General Public License v3.0
48 stars 11 forks source link
education ipfs publishing science

alt tag

Publish research for free, access research for free.

Downloadable Aletheia App

About

Decentralisation

Why a downloadable app?

Ethereum

Truffle

Filesharing

Livenet vs Testnet vs Development

Electron

Requirements

OSX instructions

  git clone https://github.com/aletheia-foundation/aletheia-app.git
  cd aletheia-app

  # note, this is not strictly required for local development as the fake ethereum client `testrpc` can be used.
  brew install ethereum # installs geth
  brew install nodejs
  # OSX should have python 2.X pre installed
  npm install -g electron

Ubuntu instructions

These instructions were tested on ubuntu 16.10

  git clone https://github.com/aletheia-foundation/aletheia-app.git
  cd aletheia-app
  # this installs nodejs 6.x, geth and electron
  sudo ./scripts/install-ubuntu.sh

Run project in web browser

Clone this repo and cd into its directory

This project requires IPFS and Ethereum clients to be running in the background

  # open three terminal tabs in the project folder:
  # in tab 1
  npm config set python $(which python) # Python 2 is needed, not python 3
  npm install
  npm run ethereum-local
  # in tab 2 (must be in project directory)
  npm run ipfs-local

  # in tab 3 (must be in project directory)
  npm run start:web # (app will start but be unable to connect to filesharing or blockchain)

Test the app build on the testnet

npm run electron:serve

note: this will not be able to connect to the local ethereum testrpc (npm run ethereum-local) and can only be tested on the real testnet e.g.:

    # In tab 1
    npm run ethereum-testnet 

    # in tab 2 
    npm run ipfs-local

    # In tab 3
    npm run electron:serve

Test the dist build

You can also generate the actual executables for different platforms with

    npm run electron:linux
    npm run electron:windows
    npm run electron:mac

Video Tutorial

Note: The video mentions installing/running the project on Mac OS. The steps followed in the video are also applicable to any Linux distribution (Ubuntu, CentOS, ...).

Tests

Linting

npm run lint

Tests run in a browser with karma.

  npm run test:js

Smart contract tests with truffle

  # in tab 1 
  npm run ethereum-local

  # in tab 2
  npm run test:truffle

Testing notes

Test data

npm run test-data

Start the app with another user

ACCOUNT_NUMBER=1 npm run start

Force mine a block

Call this from debugger window:

  web3.currentProvider.sendAsync({
        jsonrpc: "2.0",
        method: "evm_mine",
        id: 12345
    }, function(err, result) {
      // this is your callback
    });