Skip to content

CPChain/cpchain-website

Repository files navigation

CPChain Website

logo

Including CPCHAIN.IO and EXPLORER of CPCHAIN.

lang License: GPL v3 Pull Requests Follow Twitter

What is CPChain

CPChain is a new distributed infrastructure for next generation IoT. CPChain intends to build a fundamental data platform for IoT systems in combination with distributed storage, encryption computation and blockchain technologies, providing the whole process solution from data acquisition, storage, sharing to application.

CPChain is a promising solution to a series of challenges of the current "chimney architecture" of IoT systems, reducing connectivity cost of devices, protecting data privacy and maximizing the value of IoT data.

Installation

Clone

Clone this repo to your local machine using git clone https://github.com/CPChain/cpchain-website.git

Setup

Update and install the requirements first

pip3 install -r requirements.txt

Change your settings in config.default.ini

[chain]
ip=127.0.0.1
port=8501

[db]
ip=127.0.0.1 #mongodb
mkdir -p logs

# start database
docker-compose up -d mysql mongo

# start monitor
docker-compose up -d monitor

# collect static
docker-compose run collect-static

# makemigrations and migrate
docker-compose run migrations

# start test-container if you are developing or testing
docker-compose up dev

# create super user in test-env
docker exec -it cpchain-website_dev_1 python manage.py createsuperuser

# username: admin
# password: 123456

# start daphne
docker-compose up -d daphne

# When you develop locally, start the nginx-dev.
# But if you want to deploy on prod-env or test-env, do not use this Nginx, use the Nginx which installed on prod-env or test-env
# start nginx: http://localhost:8001/
docker-compose up -d nginx-dev

# start worker and beat
docker-compose up -d beat worker

# start the uwsgi container
docker-compose up -d uwsgi

# if you want to test, start the nginx container
docker-compose up -d nginx-uwsgi-test

# cleanup ip access table
python manage.py cleanup

Start Celery

# start worker
celery worker -A tasks.app

# beat start
celery beat -A tasks.app

Start

To run this website with explorer of cpchain ,you need to install mongodb to save the data from chain.

run db monitor :

python3 db_monitor.py

There are two modes to start this website , through http or socket(default):

./uwsgi_reload.sh http
[Mode]http
[uWSGI] getting INI configuration from uwsgi.ini
[uwsgi-static] added mapping for /static => ./static

Now You can access localhost

Documentation

The website uses a third-party package cpc-fusion. For more detailed information, please see here: cpc-fusion


License