visual-identity/plasma_cash
Richard Ramos 63918ff86b
Update README.md
2018-07-31 20:55:18 -04:00
..
child_chain Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
client Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
contract_binds Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
utils Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
.flake8 Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
License.md Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
Makefile Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
README.md Update README.md 2018-07-31 20:55:18 -04:00
auto_respond_challenge.py Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
benchmark.py Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
challenge_after_demo.py Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
challenge_before_demo.py Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
challenge_between_demo.py Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
config.py Finally running plasma_cash with Embark 2018-07-31 20:38:43 -04:00
demo.py Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
dependency_config.py Finally running plasma_cash with Embark 2018-07-31 20:38:43 -04:00
dump_test_data.py Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
requirements.txt Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00
unit_test.py Adding Loom's plasma_cash folder 2018-07-31 11:24:58 -04:00

README.md

@rramos notes

I configured the project to run with Embark (Only demo.py was tested). To run this project in Ubuntu, the following steps need to be executed

  1. npm install
  2. Open at least 4 terminals (you can use tmux for this)
  3. In Terminal-1, execute embark simulator
  4. In Terminal-2, execute embark run
  5. In Terminal-3:
cd plasma_cash
virtualenv erc721plasma -p python3.6
source erc721plasma/bin/activate
pip install -r requirements.txt
FLASK_APP=./child_chain FLASK_ENV=development flask run --port=8546
  1. In Terminal-4:
cd plasma_cash
source erc721plasma/bin/activate
python demo.py

Most of the previous instructions are covered here, I just wrote them here for quick reference.

If installing the server from scratch:

  1. Install Nodejs with nvm
  2. Follow the instructions from Embark for its installation,
  3. sudo apt install virtualenv python3 python3-dev libssl-dev build-essential

NOTE: nvm and Embark must be installed with a normal user. Don't use root! NOTE2: The contract addresses are hardcoded in config.py. If you want to execute the demo after it has already executed, you need to restart both Embark and its simulator

Development Dependencies

A patched version of web3.py is used because otherwise it does not work with Ganache due to issue #674. In addition, in order to be able to monitor events, PR #827, which is not merged yet. Pyethereum dependencies broke recently so we need to manually install a slightly older version of rlp encoding. Flask is used for server purposes.

On OSX + Homebrew

source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv erc721plasma --python=/usr/bin/python3.6
pip install -r requirements.txt

Launch Plasma Chain

  1. Make sure the contracts are deployed at the correct addresses (npm run migrate:dev in server directory)
  2. Run FLASK_APP=./child_chain FLASK_ENV=development flask run --port=8546 in one terminal. This will start a Plasma Chain instance which listens at localhost:8546 and is also connected to the deployed contracts
  3. Run python demo.py

TODO Should probably bundle these into makefiles, i.e. make server should launch the plasma chain.

Testing

make test

Linting

make lint