├── .gitignore ├── LICENSE ├── README.md ├── main.py └── requirements.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | .vscode 4 | dump.rdb 5 | 6 | # Log files 7 | !logs/.gitkeep 8 | *.log 9 | logs/* 10 | 11 | # Django 12 | *.pot 13 | *.pyc 14 | __pycache__/ 15 | __pycache__/* 16 | db.sqlite3 17 | db.sqlite3-journal 18 | local_settings.py 19 | media 20 | 21 | # Byte-compiled / optimized / DLL files 22 | *$py.class 23 | *.py[cod] 24 | 25 | # C extensions 26 | *.so 27 | 28 | # Distribution / packaging 29 | *.egg 30 | *.egg-info/ 31 | .Python 32 | .eggs/ 33 | .installed.cfg 34 | MANIFEST 35 | build/ 36 | develop-eggs/ 37 | downloads/ 38 | eggs/ 39 | lib/ 40 | lib64/ 41 | parts/ 42 | pip-wheel-metadata/ 43 | sdist/ 44 | share/python-wheels/ 45 | var/ 46 | wheels/ 47 | dist/ 48 | 49 | # Unit test / coverage reports 50 | *.cover 51 | *.py,cover 52 | .cache 53 | .coverage 54 | .coverage.* 55 | .hypothesis/ 56 | .nox/ 57 | .pytest_cache/ 58 | .tox/ 59 | coverage.xml 60 | htmlcov/ 61 | nosetests.xml 62 | 63 | # pytest 64 | .pytest_cache 65 | 66 | # pyenv 67 | .python-version 68 | 69 | # Celery 70 | celerybeat-schedule 71 | celerybeat.pid 72 | 73 | # Environments 74 | .env 75 | .venv 76 | ENV/ 77 | env.bak/ 78 | env/ 79 | venv 80 | venv.bak/ 81 | venv/ 82 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 thenewboston 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Overview 2 | 3 | Generate keys needed for deployment of new nodes. 4 | 5 | ## Project Setup 6 | 7 | Follow the steps below to set up the project on your environment. If you run into any problems, feel free to leave a 8 | GitHub Issue or reach out to any of our communities. 9 | 10 | Install required packages: 11 | ``` 12 | pip3 install -r requirements.txt 13 | ``` 14 | 15 | ## Community 16 | 17 | Join the community to stay updated on the most recent developments, project roadmaps, and random discussions about completely unrelated topics. 18 | 19 | - [thenewboston.com](https://thenewboston.com/) 20 | - [Discord](https://discord.gg/thenewboston) 21 | - [Facebook](https://www.facebook.com/TheNewBoston-464114846956315/) 22 | - [Instagram](https://www.instagram.com/thenewboston_official/) 23 | - [LinkedIn](https://www.linkedin.com/company/thenewboston-developers/) 24 | - [Reddit](https://www.reddit.com/r/thenewboston/) 25 | - [Twitch](https://www.twitch.tv/thenewboston/videos) 26 | - [Twitter](https://twitter.com/thenewboston_og) 27 | - [YouTube](https://www.youtube.com/user/thenewboston) 28 | 29 | ## License 30 | 31 | thenewboston is [MIT licensed](http://opensource.org/licenses/MIT). 32 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from django.core.management.utils import get_random_secret_key 2 | from nacl.encoding import HexEncoder 3 | from nacl.signing import SigningKey 4 | 5 | """ 6 | Running this script will produce all keys necessary for deploying a new node. 7 | 8 | Account Number Signing Key: 9 | 1a39089ad26ed05ad9329e880f0df3fdd6681d5102a342e1828b58bf9d348865 10 | 11 | Account Number: 12 | 2ac4d35a74e8146f65007c3603af23591df158e3165ade812be65ac481fe9fd6 13 | 14 | NID Signing Key: 15 | 937a38c891e73d214f593cb8b11cce5cf07d12c0550961f779cc5d7ada520f4b 16 | 17 | NID: 18 | feca95b78fb42f6da1293855bcc0265224f81693d83cd32c0530f372def61a33 19 | 20 | SECRET_KEY: 21 | +y15h+q5v-)r)_wf7+&bb1)o+3i1e#8tcw5^hc5e07*n4l*+^= 22 | """ 23 | 24 | 25 | def create_key_pair(): 26 | """ 27 | Create and return private_key, public_key 28 | """ 29 | 30 | private_key = SigningKey.generate() 31 | public_key = private_key.verify_key 32 | return private_key, public_key 33 | 34 | 35 | def display_key_pair(*, label): 36 | """ 37 | Create and display key pair information 38 | """ 39 | 40 | private_key, public_key = create_key_pair() 41 | private_key = private_key.encode(encoder=HexEncoder).decode('utf-8') 42 | public_key = public_key.encode(encoder=HexEncoder).decode('utf-8') 43 | 44 | print(f'\n{label} Signing Key:\n{private_key}') 45 | print(f'\n{label}:\n{public_key}') 46 | 47 | 48 | def run(): 49 | """ 50 | Run main application 51 | """ 52 | 53 | display_key_pair(label='Account Number') 54 | display_key_pair(label='NID') 55 | 56 | random_secret_key = get_random_secret_key() 57 | print(f'\nSECRET_KEY:\n{random_secret_key}') 58 | 59 | 60 | if __name__ == '__main__': 61 | run() 62 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Django==3.1.3 2 | PyNaCl==1.4.0 3 | --------------------------------------------------------------------------------