Skip to content

Commit

Permalink
rename issuer to cert-issuer and remove bad links
Browse files Browse the repository at this point in the history
  • Loading branch information
kimdhamilton committed May 31, 2016
1 parent ccefbde commit 844e986
Show file tree
Hide file tree
Showing 26 changed files with 113 additions and 119 deletions.
18 changes: 9 additions & 9 deletions Dockerfile
Expand Up @@ -7,7 +7,7 @@ RUN echo "rpcuser=foo\nrpcpassword=bar\nrpcport=18333\nregtest=1\n" > ~/.bitcoin

RUN apt-get update

# Install issuer app
# Install cert-issuer app
RUN apt-get install -y -q build-essential python-gdal python-simplejson --fix-missing
RUN apt-get install -y python python-pip wget
RUN apt-get install -y python-dev
Expand All @@ -22,24 +22,24 @@ RUN cd /opt/Python-3.4.3 & make install


# Create a working directory.
RUN mkdir issuer
RUN mkdir cert-issuer

# Install VirtualEnv.
RUN pip install virtualenv

# Add requirements file.
ADD requirements.txt /issuer/requirements.txt
ADD requirements.txt /cert-issuer/requirements.txt

# Run VirtualEnv.
RUN virtualenv -p /usr/local/bin/python3 /issuer/env/
RUN /issuer/env/bin/pip install wheel
RUN virtualenv -p /usr/local/bin/python3 /cert-issuer/env/
RUN /cert-issuer/env/bin/pip install wheel

COPY . /issuer
COPY . /cert-issuer

RUN /issuer/env/bin/pip install /issuer/.
RUN /cert-issuer/env/bin/pip install /cert-issuer/.

# Copy configuration file
RUN mkdir /etc/issuer
COPY conf_regtest.ini /etc/issuer/conf.ini
RUN mkdir /etc/cert-issuer
COPY conf_regtest.ini /etc/cert-issuer/conf.ini


30 changes: 15 additions & 15 deletions README.md
Expand Up @@ -7,7 +7,7 @@ on the Bitcoin blockchain that includes the hash of the certificate itself. [See
Documentation
-------------

[http://issuer.readthedocs.io/](http://issuer.readthedocs.io/)
[http://cert-issuer.readthedocs.io/](http://cert-issuer.readthedocs.io/)

Quick start
-----------
Expand All @@ -19,15 +19,15 @@ experimenting only.
1. Clone the repo:

```
git clone https://github.com/digital-certificates/issuer.git
git clone https://github.com/digital-certificates/cert-issuer.git
```


2. From a command line in issuer dir, build your docker container:
2. From a command line in cert-issuer dir, build your docker container:

```
cd issuer
docker build -t ml/issuer:1.0 .
cd cert-issuer
docker build -t ml/cert-issuer:1.0 .
```

3. Read before running!
Expand All @@ -37,13 +37,13 @@ experimenting only.

```
docker ps -l
docker commit <container for your ml/issuer> my_cert_issuer
docker commit <container for your ml/cert-issuer> my_cert_issuer
```

4. When you're ready to run:

```
docker run -it ml/issuer:1.0 bash
docker run -it ml/cert-issuer:1.0 bash
```

5. Start bitcoind. This will use the bitcoin.conf from the docker container, which runs in regtest mode:
Expand All @@ -64,16 +64,16 @@ Ensure your docker image is running and bitcoind process is started

```
issuer=`bitcoin-cli getnewaddress`
sed -i.bak "s/<issuing-address>/$issuer/g" /etc/issuer/conf.ini
bitcoin-cli dumpprivkey $issuer > /etc/issuer/pk_issuer.txt
sed -i.bak "s/<issuing-address>/$issuer/g" /etc/cert-issuer/conf.ini
bitcoin-cli dumpprivkey $issuer > /etc/cert-issuer/pk_issuer.txt
```

2. Create a 'revocation address' and save the output as follows. Note that we don't need to save this
corresponding private key for testing issuing certificates:

```
revocation=`bitcoin-cli getnewaddress`
sed -i.bak "s/<revocation-address>/$revocation/g" /etc/issuer/conf.ini
sed -i.bak "s/<revocation-address>/$revocation/g" /etc/cert-issuer/conf.ini
```

3. Don't forget to save snapshots so you don't lose your work (see step 3 of client setup)
Expand All @@ -96,18 +96,18 @@ Issuing certificates
app, the standard unit is satoshis. This sends 5 bitcoins to the address

```
bitcoin-cli sendtoaddress moH7X29kt5T8fbxTCjoxYzjfLeMR56Ju94 5
bitcoin-cli sendtoaddress @issuer 5
```

3. Run
TODO: There is an issuer the Dockerfile and/or setup.py. The pip install here shouldn't be required.
TODO: There is an cert-issuer the Dockerfile and/or setup.py. The pip install here shouldn't be required.
For now, these get it running:

```
source /issuer/env/bin/activate
cd issuer
source /cert-issuer/env/bin/activate
cd cert-issuer
pip install .
python issuer -c /etc/issuer/conf.ini
cert-issuer -c /etc/cert-issuer/conf.ini
```


Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions issuer/__main__.py → cert_issuer/__main__.py
Expand Up @@ -12,9 +12,9 @@


def main(args=None):
from issuer import config
from cert_issuer import config
parsed_config = config.get_config()
from issuer import create_certificates
from cert_issuer import create_certificates
create_certificates.main(parsed_config)


Expand Down
5 changes: 3 additions & 2 deletions issuer/config.py → cert_issuer/config.py
Expand Up @@ -4,11 +4,12 @@


PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEFAULT_CONFIG = os.path.join(PATH, 'conf.ini')


def parse_args():
p = configargparse.getArgumentParser(default_config_files=[DEFAULT_CONFIG, '/etc/issuer/conf.ini'])
p = configargparse.getArgumentParser(default_config_files=[os.path.join(PATH, 'conf.ini'),
'/etc/cert-issuer/conf.ini',
os.path.join(PATH, 'conf_regtest.ini')])
p.add('-c', '--my-config', required=False, is_config_file=True, help='config file path')
p.add_argument('--issuing_address', required=True, help='issuing address')
p.add_argument('--revocation_address', required=True, help='revocation address')
Expand Down
6 changes: 3 additions & 3 deletions issuer/connectors.py → cert_issuer/connectors.py
Expand Up @@ -9,9 +9,9 @@
from bitcoin.core import *
from bitcoin.core.script import *
from bitcoin.wallet import CBitcoinAddress
from issuer.errors import UnrecognizedConnectorError, ConnectorError, NotImplementedError
from issuer.helpers import unhexlify, hexlify
from issuer.models import TransactionOutput
from cert_issuer.errors import UnrecognizedConnectorError, ConnectorError, NotImplementedError
from cert_issuer.helpers import unhexlify, hexlify
from cert_issuer.models import TransactionOutput


class WalletConnector:
Expand Down
Expand Up @@ -64,18 +64,18 @@
from pycoin.tx import Tx, TxOut
from pycoin.tx.pay_to import build_hash160_lookup

from issuer import helpers
from issuer.helpers import hexlify
from issuer.errors import UnverifiedDocumentError, UnverifiedSignatureError

from issuer.models import CertificateMetadata

from issuer import connectors
from issuer import wallet as wallet_helper
from issuer.wallet import Wallet
from issuer import helpers
from issuer.helpers import internet_off_for_scope
from issuer.helpers import hexlify
from cert_issuer import helpers
from cert_issuer.helpers import hexlify
from cert_issuer.errors import UnverifiedDocumentError, UnverifiedSignatureError

from cert_issuer.models import CertificateMetadata

from cert_issuer import connectors
from cert_issuer import wallet as wallet_helper
from cert_issuer.wallet import Wallet
from cert_issuer import helpers
from cert_issuer.helpers import internet_off_for_scope
from cert_issuer.helpers import hexlify


import bitcoin
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion issuer/helpers.py → cert_issuer/helpers.py
Expand Up @@ -7,7 +7,7 @@
import os
import requests
import shutil
from issuer import config
from cert_issuer import config
import logging

unhexlify = binascii.unhexlify
Expand Down
2 changes: 1 addition & 1 deletion issuer/models.py → cert_issuer/models.py
@@ -1,6 +1,6 @@
from collections import namedtuple

from issuer import helpers
from cert_issuer import helpers


TransactionOutput = namedtuple('TxOutput', ['outpoint', 'address', 'script_pub_key', 'amount'])
Expand Down
4 changes: 2 additions & 2 deletions issuer/wallet.py → cert_issuer/wallet.py
Expand Up @@ -3,8 +3,8 @@
from datetime import datetime

import random
from issuer.errors import InsufficientFundsError
from issuer.models import TransactionCosts
from cert_issuer.errors import InsufficientFundsError
from cert_issuer.models import TransactionCosts

COIN = 100000000 # satoshis in 1 btc
BYTES_PER_INPUT = 180
Expand Down
2 changes: 1 addition & 1 deletion conf_regtest.ini
Expand Up @@ -3,7 +3,7 @@ revocation_address = <revocation-address>

wallet_connector_type = bitcoind
broadcaster_type = bitcoind
usb_name=/etc/issuer/
usb_name=/etc/cert-issuer/
key_file = pk_issuer.txt

skip_wifi_check
8 changes: 4 additions & 4 deletions docs/Makefile
Expand Up @@ -96,9 +96,9 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/issuer.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/cert-issuer.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/issuer.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/cert-issuer.qhc"

.PHONY: applehelp
applehelp:
Expand All @@ -115,8 +115,8 @@ devhelp:
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/issuer"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/issuer"
@echo "# mkdir -p $$HOME/.local/share/devhelp/cert-issuer"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/cert-issuer"
@echo "# devhelp"

.PHONY: epub
Expand Down
4 changes: 2 additions & 2 deletions docs/blockchain_info.md
Expand Up @@ -6,11 +6,11 @@
1. Clone the repo:

```
git clone https://github.com/digital-certificates/issuer.git
git clone https://github.com/digital-certificates/cert-issuer.git
```
2. Create a Python 3 virtual environment and activate it
```
cd issuer
cd cert-issuer
virtualenv venv -p python3.4
source venv/bin/activate
```
Expand Down
14 changes: 7 additions & 7 deletions docs/conf.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# issuer documentation build configuration file, created by
# cert-issuer documentation build configuration file, created by
# sphinx-quickstart on Tue May 24 12:31:23 2016.
#
# This file is execfile()d with the current directory set to its
Expand Down Expand Up @@ -60,7 +60,7 @@
master_doc = 'index'

# General information about the project.
project = 'issuer'
project = 'cert-issuer'
copyright = '2016, MIT Media Lab Digital Certificates'
author = 'MIT Media Lab Digital Certificates'

Expand Down Expand Up @@ -135,7 +135,7 @@

# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#html_title = 'issuer v0.0.1'
#html_title = 'cert-issuer v0.0.1'

# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
Expand Down Expand Up @@ -239,7 +239,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'issuer.tex', 'issuer Documentation',
(master_doc, 'cert-issuer.tex', 'cert-issuer Documentation',
'MIT Media Lab Digital Certificates', 'manual'),
]

Expand Down Expand Up @@ -269,7 +269,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'issuer', 'issuer Documentation',
(master_doc, 'cert-issuer', 'cert-issuer Documentation',
[author], 1)
]

Expand All @@ -283,8 +283,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'issuer', 'issuer Documentation',
author, 'issuer', 'One line description of project.',
(master_doc, 'cert-issuer', 'cert-issuer Documentation',
author, 'cert-issuer', 'One line description of project.',
'Miscellaneous'),
]

Expand Down

0 comments on commit 844e986

Please sign in to comment.