Generic cli tooling for the CIC token network
Go to file
William Luke fb3253ae55 save 2022-02-21 08:34:25 +03:00
cic save 2022-02-21 08:34:25 +03:00
doc/sphinx Embedded image in readme md 2021-11-30 10:54:13 +01:00
tests save 2022-02-21 08:34:25 +03:00
.gitignore feat: add interactive token deployment 2022-02-10 11:22:21 +03:00
.pylintrc save 2022-02-21 08:34:25 +03:00
CHANGELOG WIP add entrypoint 2021-12-05 08:12:36 +01:00
LICENSE Initial commit 2021-10-09 18:50:43 +02:00
MANIFEST.in Add token deployment 2021-10-10 15:37:26 +02:00
README.md feat: add interactive token deployment 2022-02-10 11:22:21 +03:00
components.svg Add component diagram symlink 2021-11-30 10:34:46 +01:00
eth_requirements.txt save 2022-02-21 08:34:25 +03:00
requirements.txt save 2022-02-21 08:34:25 +03:00
run_tests.sh Add ciceth rpc tests 2021-10-10 13:48:32 +02:00
setup.cfg Add cmd module to setup 2021-12-05 08:34:47 +01:00
setup.py WIP add entrypoint 2021-12-05 08:12:36 +01:00
test_requirements.txt Make tests pass 2021-10-15 12:48:14 +02:00

README.md

CIC token deployment tool

CIC-CLI provides tooling to generate and publish metadata in relation to token deployments.

To install the project (replacing <VERSION> with the current version: 0.0.1):

python setup.py sdist
pip install --extra-index-url https://pip.grassrootseconomics.net:8433 dist/cic-<VERSION>.tar.gz

Structure of the components

image

CIC-CLI is designed to interface any network type backend. The current state of the package contains interface to EVM only. Thus, the examples below are limited to the context of the EVM.

Preparing for EVM token deployment

Some of the concepts described below assume familiarity with base concepts of the CIC architecture. Please refer to the appropriate documentation for more information.

To initialize a new token deployment for the EVM:

cic init --target eth --name <token_name> --symbol <token_symbol> --precision <token_value_precision> <settings_folder>

To automatically fill in settings detected in the network for the EVM:

cic ext --registry <contract_registry_address> -d <settings_folder> -i <chain_spec> -p <rpc_endpoint> eth

Development

Setup

 python3 -m venv ./.venv
 source ./.venv/bin/activate
 pip install --extra-index-url https://pip.grassrootseconomics.net -r requirements.txt -r test_requirements.txt eth_requirements.txt

Running the CLI

python -m cic.runnable.cic_cmd -h # Help

Deploying Token

  1. Generate Token Template
python -m cic.runnable.cic_cmd init --target eth --name "Foo Token" --symbol FOO --precision 6 foo
  1. Populating network.json Ea6225212005E86a4490018Ded4bf37F3E772161
python -m cic.runnable.cic_cmd ext -p http://localhost:63545 -i evm:byzantium:8996:bloxberg --registry 0xcf60ebc445b636a5ab787f9e8bc465a2a3ef8299 -d foo eth

add eb3907ecad74a0013c259d5874ae7f22dcbcc95c from stack/apps/contact_migrations/keystore:address to foo.network.resources.eth.contents.*.key_account

Fill out proof.json

{
	"description": "Smoking is bad for your health",
	"issuer": "William Luke",
	"namespace": "ge",
	"proofs": [],
	"version": 0
}

Fill out token.json eth-erc20 erc20-demurrage-token

{
	"code": "/home/will/grassroots/eth-erc20/python/giftable_erc20_token/data/GiftableToken.bin",
	"extra": [
		{
			"arg": "",
			"arg_type": ""
		}
	],
	"name": "Foo Token",
	"precision": "6",
	"supply": 1000000000000000000000000,
	"symbol": "FOO"
}

Deploy 0xcf60ebc445b636a5ab787f9e8bc465a2a3ef8299

python -m cic.runnable.cic_cmd export --metadata-endpoint http://localhost:63380 -vv -y /home/will/grassroots/cic-internal-integration/apps/contract-migration/keystore -o out -d foo eth

eth-contract-registry-list -e 0xcf60ebc445b636a5ab787f9e8bc465a2a3ef8299 -u
Use TokenRegistery for e eth-token-index-list -p http://localhost:63545 -i evm:byzantium:8996:bloxberg -e eb3907ecad74a0013c259d5874ae7f22dcbcc95c -u

Tests

bash ./run_tests.sh