6 Commits

Author SHA1 Message Date
c3e8883f15 fix: make store path relative to $HOME 2022-03-31 12:33:29 +03:00
5f62287913 docs: add gpg instructions and example
note: private key in example is publicly available in cic-stack
2022-02-23 19:38:35 +03:00
28d7699a4a Merge pull request 'docs: add readme' (#16) from sohail/docs into master
Reviewed-on: #16
2022-02-14 07:01:46 +00:00
05224a9dd6 docs: add readme 2022-02-02 18:14:31 +03:00
2f65aa37ff Merge pull request 'Release 0.0.6' (#13) from lash/0.0.6 into master
release: v0.0.6
2022-01-26 06:24:39 +00:00
lash
be7dea24ac Release 0.0.6 2022-01-24 17:03:54 +00:00
5 changed files with 96 additions and 4 deletions

2
.gitignore vendored
View File

@@ -2,3 +2,5 @@ __pycache__
*.egg-info
build/
*.pyc
.venv
.clicada

87
README.md Normal file
View File

@@ -0,0 +1,87 @@
## Clicada
> Admin Command Line Interface to interact with cic-meta and cic-cache
### Pre-requisites
- Public key uploaded to `cic-auth-helper`
- PGP Keyring for your key
### Installation
Use either of the following installation methods:
1. Install from git release (recommended)
```bash
wget https://git.grassecon.net/grassrootseconomics/clicada/archive/v0.0.6.zip
unzip clicada-v0.0.6.zip
cd clicada
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt --extra-index-url=https://pip.grassrootseconomics.net
```
2. Install from pip to path (non sudo)
```bash
pip3 install -UI --extra-index-url=https://pip.grassrootseconomics.net clicada
```
### GPG Keyring setup
PGP uses the default keyring, you can however pass in a custom keyring path.
To create a keyring from a specific key and get its path for `AUTH_KEYRING_PATH`:
```bash
# In some dir
gpg --homedir .gnupg --import private.pgp
pwd
```
### Usage
```bash
usage: clicada [...optional arguments] [...positional arguments]
positional arguments:
{user,u,tag,t}
user (u) retrieve transactions for a user
tag (t) locally assign a display value to an identifier
optional arguments:
-h, --help show this help message and exit
--no-logs Turn off all logging
-v Be verbose
-vv Be very verbose
-c CONFIG, --config CONFIG
Configuration directory
-n NAMESPACE, --namespace NAMESPACE
Configuration namespace
--dumpconfig {env,ini}
Output configuration and quit. Use with --raw to omit values and output schema only.
--env-prefix ENV_PREFIX
environment prefix for variables to overwrite configuration
-p P, --rpc-provider P
RPC HTTP(S) provider url
--rpc-dialect RPC_DIALECT
RPC HTTP(S) backend dialect
--height HEIGHT Block height to execute against
-i I, --chain-spec I Chain specification string
-u, --unsafe Do not verify address checksums
--seq Use sequential rpc ids
-y Y, --key-file Y Keystore file to use for signing or address
--raw Do not decode output
--fee-price FEE_PRICE
override fee price
--fee-limit FEE_LIMIT
override fee limit
```
### Example
```bash
AUTH_PASSPHRASE=queenmarlena AUTH_KEYRING_PATH=/home/kamikaze/grassroots/usumbufu/tests/testdata/pgp/.gnupg/ AUTH_KEY=CCE2E1D2D0E36ADE0405E2D0995BB21816313BD5 CHAIN_SPEC=evm:byzantium:8996:bloxberg CIC_REGISTRY_ADDRESS=0xcf60ebc445b636a5ab787f9e8bc465a2a3ef8299 RPC_PROVIDER=https://rpc.grassecon.net TX_CACHE_URL=https://cache.grassecon.net HTTP_CORS_ORIGIN=https://auth.grassecon.net META_HTTP_ORIGIN=https://auth.grassecon.net:443 PYTHONPATH=. python clicada/runnable/view.py u --meta-url https://auth.grassecon.net +254711000000
```

View File

@@ -3,7 +3,8 @@ import json
# external imports
from clicada.user import FileUserStore
from pathlib import Path
import os
categories = [
'phone',
@@ -35,7 +36,7 @@ def validate(config, args):
def execute(ctrl):
store_path = '.clicada'
store_path = os.path.join(str(Path.home()), '.clicada')
user_store = FileUserStore(None, ctrl.chain(), ctrl.get('_CATEGORY'), store_path, int(ctrl.get('FILESTORE_TTL')))
user_store.put(ctrl.get('_IDENTIFIER'), json.dumps(ctrl.get('_TAG')), force=True)
user_store.stick(ctrl.get('_IDENTIFIER'))

View File

@@ -2,6 +2,8 @@
import sys
import logging
import datetime
from pathlib import Path
import os
# external imports
from cic_eth_registry import CICRegistry
@@ -54,7 +56,7 @@ def validate(config, args):
def execute(ctrl):
tx_getter = TxGetter(ctrl.get('TX_CACHE_URL'), 10)
store_path = '.clicada'
store_path = os.path.join(str(Path.home()), '.clicada')
user_phone_file_label = 'phone'
user_phone_store = FileUserStore(ctrl.opener('meta'), ctrl.chain(), user_phone_file_label, store_path, int(ctrl.get('FILESTORE_TTL')), encrypter=ctrl.encrypter)

View File

@@ -1,6 +1,6 @@
[metadata]
name = clicada
version = 0.0.6a2
version = 0.0.6
description = CLI CRM tool for the cic-stack custodial wallet system
author = Louis Holbrook
author_email = dev@holbrook.no