Including CPCHAIN.IO and EXPLORER of 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.
Clone this repo to your local machine using git clone https://github.com/CPChain/cpchain-website.git
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 worker
celery worker -A tasks.app
# beat start
celery beat -A tasks.app
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
The website uses a third-party package cpc-fusion. For more detailed information, please see here: cpc-fusion
- Copyright 2020 © cpchain.io.