The cert-viewer project is a Flask webapp to display and verify blockchain certificates after they have been issued and to allow learners to request a certificate and generate their own Bitcoin identity needed for the certificate creation process.
-
First ensure you have Docker installed. See our Docker installation help.
-
Git clone the repository and change to the directory
git clone https://github.com/blockchain-certificates/cert-viewer.git && cd cert-viewer
-
From a command line in the cert-viewer dir, run docker-compose
docker-compose build
-
Start the container
docker-compose up
-
The output of the previous command (example below) will tell you how to access the site. You can enter that value in a browser.
web_1 | INFO - * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
The quick start steps do the following:
- Creates a container that runs the cert-viewer Flask app with MongoDB using Docker Compose details
- Copies the certificates in cert_data into the Docker container's file system.
- Starts the container. This configuration exposes port 5000.
These steps allow you to install and run outside outside of Docker. Step 5 describes the configuration options that should be changed if you're using this for anything other than demo purposes.
-
Ensure you have an python environment. Recommendations
-
Install mongodb
-
Git clone the repository and change to the directory
git clone https://github.com/blockchain-certificates/cert-viewer.git && cd cert-viewer
-
Setup your conf.ini file (see 'Configuration')
-
Start mongo database.
--dbpath
can be left off if you used the default locationmongod --dbpath <path to data directory>
-
Run cert-viewer setup
pip install .
-
Run the flask server
python run.py
-
Open
http://localhost:5000
-
Copy the template ini file
cp conf_template.ini conf.ini
-
Edit the following entries (refer to conf_sample.ini for examples):
secret_key
is a random string used by Flask as a secret key to enable cryptographically signed sessionmandrill_api_key
is used to send out notifications when a user signs up. Setup your mandrill account at https://www.mandrill.com/mongodb_uri
is used to access your mongodb instance. The canonical form ismongodb://<username>:<password>@<domain>:<mongo_port>/<db_name>
. Examples follow:- Local mongo installation:
mongodb_uri = mongodb://localhost:27017/test
- Docker installation:
mongodb_uri = mongodb://<DOCKER_MACHINE_IP>:27017/test
, where DOCKER_MACHINE_IP is given bydocker-machine ip
- Local mongo installation:
cert_store_type
is the type of key value store to use for certificatescert_store_path
is the file system path to the certificates
See cert-store for information on advanced certificate storage setup.
This project uses tox to validate against several python environments.
-
Ensure you have an python environment. Recommendations
-
Run tests
./run_tests.sh
About the database collections
Contact info@blockcerts.org with questions