AKC-MAMBA manuals
I. Installation Instructions
1. Prerequisites
Before you begin, you should confirm that you have installed all the prerequisites below on the platform where you will be running AKC-Mamba.
a. Install pip3
If you have not installed pip3, use the following command to install:
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python3 get-pip.py --user
For checking version :
pip3 --version
2. Install AKC-Mamba
a. Install AKC-Mamba from pip package
You can use the following command:
pip3 install akc-mamba
After install successfuly, you can get help by command:
mamba --help
b. Install and run from source code
Install required Python3 modules with
pip3 install -r requirements.txt
Use akc-mamba using python3 command:
python3 mamba.py --help
3. Deploy and bootstrap network with CLI
a. Prepare environment
We now can use the Mamba tool to prepare required helm and k8s components
mamba environment
After running this command, the program will ask you to fill in some of the most necessary information of creating a blockchain network:
Cluster name: The name of the cluster network you created in step Setup an AWS EKS cluster. Default:cluster-mamba-exampleKubenetes type: Currentlyakc-mambais supporting kubenetes of two types:eksandminikube. The default iseksEFS infomation: After you have entered theKubenetes type,mambawill automatically search your k8s network for information aboutefs. If you haveEFSinstalled before, the system will automatically update the config file located at~/.akachain/akc-mamba/mamba/config/.env. If not, you need to fill in the informationEFS SERVERbased on the installation step Setup a Network File System. If the k8s type isminikubethen you do not need to enter this information.- Important Note: You can check and update configuration parameters in
~/.akachain/akc-mamba/mamba/config/.env, the file content is pretty much self-explained.
b. Deploy and bootstrap network
mamba start
The mamba start command executes a series of sub commands that installs various network components. For more information on each command for individual components, please refer to help section
mamba --help
To terminate the network, just run
mamba terminate
II. Development Guide
1. Project structure
Mamba makes use of Click_, an elegant python package for creating command line interfaces. The project structure is depicted in the tree below.
.
├── command_group_1
│ ├── commands.py
│ ├── __init__.py
│
├── utils
│ ├── __init__.py
│ ├── kube.py
├── settings
│ ├── settings.py
├── mamba.py
There are 4 main components:
- mamba.py : The bootstrap instance module of Mamba
- settings : Contains global variables that are shared accross all sub modules
- command_group : Each command group is separated into its own directory.
- utils : helper functions that must be initialized via settings.py
2. Coding Convention
Please follow PEP8 - Style guide for Python Code.
Another example can be found here
There are several notes that are different with other languages
Function names should be lowercase, with words separated by underscores as necessary to improve readability.
Camel case is for class name
3. Logging instruction
A snake must know how hiss ... or sometimes rattle.
Normally we can just use echo to print out message during execution However:
- It is mandatory to
hisswhen there is error. - also,
rattleis needed when a snake meet something ... at the beginning or at the end of an execution.
For more information about logging, please follow the standard convention in mamba/utils/hiss.py
Release files for akc-mamba 2.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| akc-mamba-2.1.1.tar.gz | 31.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| akc_mamba-2.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 212.2 kB
Release files / akc-mamba-2.1.1.tar.gz
| Download URL | akc-mamba-2.1.1.tar.gz |
|---|---|
| Size | 31.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c57a1451a1f76157f7ee19d82fc1dd3ecc91f446c3e8366e7385de4f7dd60454
|
|
BLAKE2b-256 checksum How to use checksums |
ff1000bdfba8aedf7a53aa7c7d91f0a358cbed5df4b701b5df772c0b02ea4c5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.9
|
Release files / akc_mamba-2.1.1-py3-none-any.whl
| Download URL | akc_mamba-2.1.1-py3-none-any.whl |
|---|---|
| Size | 180.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5bb31adfade03cf244db69d8d961f997fe23f4f9a8a5c2af89314502f6963fec
|
|
BLAKE2b-256 checksum How to use checksums |
ab1fc568f62c65f1e6cf59d83b90813a1ddc5ca2b1405ca87b2c0bf1aecd7572
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.9
|