Compare commits
1 Commits
lash/token
...
sohail/pip
| Author | SHA1 | Date | |
|---|---|---|---|
|
e81b34278b
|
34
README.md
34
README.md
@@ -1,19 +1,41 @@
|
||||
# Community Inclusion Currency Stack (CIC Stack)
|
||||
|
||||
A custodial evm wallet for executing transactions via USSD
|
||||
# cic-internal-integration
|
||||
|
||||
## Getting started
|
||||
|
||||
This repo uses docker-compose and docker buildkit. Set the following environment variables to get started:
|
||||
|
||||
|
||||
```
|
||||
export COMPOSE_DOCKER_CLI_BUILD=1
|
||||
export DOCKER_BUILDKIT=1
|
||||
```
|
||||
|
||||
To get started see [./apps/contract-migration/README.md](./apps/contract-migration/README.md)
|
||||
start services, database, redis and local ethereum node
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## Documentation
|
||||
Run app/contract-migration to deploy contracts
|
||||
```
|
||||
RUN_MASK=3 docker-compose up contract-migration
|
||||
```
|
||||
|
||||
[https://docs.grassecon.org/cic_stack/](https://docs.grassecon.org/cic_stack/)
|
||||
stop cluster
|
||||
```
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
stop cluster and delete data
|
||||
```
|
||||
docker-compose down -v --remove-orphans
|
||||
```
|
||||
|
||||
rebuild an images
|
||||
```
|
||||
docker-compose up --build <service_name>
|
||||
```
|
||||
|
||||
to delete the buildkit cache
|
||||
```
|
||||
docker builder prune --filter type=exec.cachemount
|
||||
```
|
||||
|
||||
@@ -515,7 +515,7 @@ class Api(ApiBase):
|
||||
:param password: Password to encode the password with in the backend (careful, you will have to remember it)
|
||||
:type password: str
|
||||
:param register: Register the new account in accounts index backend
|
||||
:type register: bool
|
||||
:type password: bool
|
||||
:returns: uuid of root task
|
||||
:rtype: celery.Task
|
||||
"""
|
||||
|
||||
@@ -382,8 +382,6 @@ def cache_transfer_data(
|
||||
sender_address = tx_normalize.wallet_address(tx['from'])
|
||||
recipient_address = tx_normalize.wallet_address(tx_data[0])
|
||||
token_value = tx_data[1]
|
||||
source_token_address = tx_normalize.executable_address(tx['to'])
|
||||
destination_token_address = source_token_address
|
||||
|
||||
|
||||
session = SessionBase.create_session()
|
||||
@@ -391,8 +389,8 @@ def cache_transfer_data(
|
||||
'hash': tx_hash_hex,
|
||||
'from': sender_address,
|
||||
'to': recipient_address,
|
||||
'source_token': source_token_address,
|
||||
'destination_token': destination_token_address,
|
||||
'source_token': tx['to'],
|
||||
'destination_token': tx['to'],
|
||||
'from_value': token_value,
|
||||
'to_value': token_value,
|
||||
}
|
||||
@@ -424,16 +422,14 @@ def cache_transfer_from_data(
|
||||
spender_address = tx_data[0]
|
||||
recipient_address = tx_data[1]
|
||||
token_value = tx_data[2]
|
||||
source_token_address = tx_normalize.executable_address(tx['to'])
|
||||
destination_token_address = source_token_address
|
||||
|
||||
session = SessionBase.create_session()
|
||||
tx_dict = {
|
||||
'hash': tx_hash_hex,
|
||||
'from': tx['from'],
|
||||
'to': recipient_address,
|
||||
'source_token': source_token_address,
|
||||
'destination_token': destination_token_address,
|
||||
'source_token': tx['to'],
|
||||
'destination_token': tx['to'],
|
||||
'from_value': token_value,
|
||||
'to_value': token_value,
|
||||
}
|
||||
@@ -465,16 +461,14 @@ def cache_approve_data(
|
||||
sender_address = tx_normalize.wallet_address(tx['from'])
|
||||
recipient_address = tx_normalize.wallet_address(tx_data[0])
|
||||
token_value = tx_data[1]
|
||||
source_token_address = tx_normalize.executable_address(tx['to'])
|
||||
destination_token_address = source_token_address
|
||||
|
||||
session = SessionBase.create_session()
|
||||
tx_dict = {
|
||||
'hash': tx_hash_hex,
|
||||
'from': sender_address,
|
||||
'to': recipient_address,
|
||||
'source_token': source_token_address,
|
||||
'destination_token': destination_token_address,
|
||||
'source_token': tx['to'],
|
||||
'destination_token': tx['to'],
|
||||
'from_value': token_value,
|
||||
'to_value': token_value,
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ def __balance_incoming_compatible(token_address, receiver_address):
|
||||
status_compare = dead()
|
||||
q = q.filter(Otx.status.op('&')(status_compare)==0)
|
||||
# TODO: this can change the result for the recipient if tx is later obsoleted and resubmission is delayed.
|
||||
#q = q.filter(Otx.status.op('&')(StatusBits.IN_NETWORK)==StatusBits.IN_NETWORK)
|
||||
q = q.filter(Otx.status.op('&')(StatusBits.IN_NETWORK)==StatusBits.IN_NETWORK)
|
||||
q = q.filter(TxCache.destination_token_address==token_address)
|
||||
delta = 0
|
||||
for r in q.all():
|
||||
|
||||
@@ -27,7 +27,6 @@ In the current version of the scripts, two token types may be deployed; [`giftab
|
||||
This step may be run multiple times, as long as the token symbol is different from all previously deployed tokens.
|
||||
|
||||
|
||||
|
||||
## 4. Initialize custodial engine.
|
||||
|
||||
Adds system accounts to the custodial engine, and unlocks the initialization seal. After this step, the custodial system is ready to use.
|
||||
@@ -36,12 +35,10 @@ Adds system accounts to the custodial engine, and unlocks the initialization sea
|
||||
## Services dependency graph
|
||||
|
||||
1. evm
|
||||
2. bootstrap runlevel 1 - deploy global contracts (RUN_MASK=1 docker-compose up bootstrap)
|
||||
3. bootstrap runlevel 2 - deploy instance contracts (RUN_MASK=2 docker-compose up bootstrap)
|
||||
4. bootstrap runlevel 4 - deploy token (RUN_MASK=4 docker-compose up bootstrap)
|
||||
2. bootstrap runlevel 1
|
||||
3. bootstrap runlevel 2
|
||||
4. bootstrap runlevel 3
|
||||
5. redis
|
||||
6. postgres
|
||||
7. cic-eth-tasker
|
||||
8. boostrap runlevel 8 - deploy custodial contracts (RUN_MASK=8 docker-compose up bootstrap)
|
||||
9. boostrap runlevel 16 - data seeding for development (RUN_MASK=16 docker-compose up bootstrap)
|
||||
10. bring up the remainig services (docker-compose up -d)
|
||||
7. cic-eth-tasker
|
||||
8. boostrap runlevel 4
|
||||
|
||||
@@ -67,7 +67,7 @@ services:
|
||||
RUN_MASK: ${RUN_MASK:-0}
|
||||
TOKEN_NAME: $TOKEN_NAME
|
||||
TOKEN_SYMBOL: $TOKEN_SYMBOL
|
||||
TOKEN_TYPE: ${TOKEN_TYPE:-giftable_erc20_token}
|
||||
TOKEN_TYPE: $TOKEN_TYPE
|
||||
TOKEN_DECIMALS: $TOKEN_DECIMALS
|
||||
TOKEN_REDISTRIBUTION_PERIOD: $TOKEN_REDISTRIBUTION_PERIOD
|
||||
TOKEN_SUPPLY_LIMIT: $TOKEN_SUPPLY_LIMIT
|
||||
|
||||
Reference in New Issue
Block a user