Compare commits
12 Commits
feat/meta-
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
1a42f227c7 | ||
3cde79ef8f | |||
|
ab9f996174 | ||
de78753675 | |||
|
7b7fd1e2bb | ||
4eda0fb5cc | |||
|
fa43080602 | ||
15ae1143a5 | |||
|
efbe04df6d | ||
22b3062c49 | |||
|
2f4680e1a7 | ||
bfe7086178 |
@ -59,7 +59,7 @@ confidence=
|
||||
#
|
||||
# Kubeflow disables string-interpolation because we are starting to use f
|
||||
# style strings
|
||||
disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,missing-docstring,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,relative-import,invalid-name,bad-continuation,no-member,locally-disabled,fixme,import-error,too-many-locals,no-name-in-module,too-many-instance-attributes,no-self-use,logging-fstring-interpolation
|
||||
disable=old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,missing-docstring,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,relative-import,invalid-name,bad-continuation,no-member,locally-disabled,fixme,import-error,too-many-locals,no-name-in-module,too-many-instance-attributes,no-self-use,logging-fstring-interpolation
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
24
CHANGELOG.md
24
CHANGELOG.md
@ -2,6 +2,30 @@
|
||||
|
||||
<!--next-version-placeholder-->
|
||||
|
||||
## v0.5.5 (2023-03-24)
|
||||
### Fix
|
||||
* Lock erc20-demurrage-token ([`3cde79e`](https://git.grassecon.net/cicnet/cic-cli/commit/3cde79ef8fb77a6b03454e675568834e0ab4ba80))
|
||||
|
||||
## v0.5.4 (2022-07-05)
|
||||
### Fix
|
||||
* Pass headers through KeyedWriterFactory ([`de78753`](https://git.grassecon.net/cicnet/cic-cli/commit/de78753675242dd253359a5a5601d9062d81f0ee))
|
||||
|
||||
## v0.5.3 (2022-07-05)
|
||||
### Fix
|
||||
* Add auth headers to HTTPWriter ([`4eda0fb`](https://git.grassecon.net/cicnet/cic-cli/commit/4eda0fb5cc2c41a735619dc3e34f21c4e27fd112))
|
||||
|
||||
## v0.5.2 (2022-07-05)
|
||||
### Fix
|
||||
* Bump cic-types ([`15ae114`](https://git.grassecon.net/cicnet/cic-cli/commit/15ae1143a5230078219072d096741546ebcc3d07))
|
||||
|
||||
## v0.5.1 (2022-07-05)
|
||||
### Fix
|
||||
* Upgrade cic-types to support meta auth ([`22b3062`](https://git.grassecon.net/cicnet/cic-cli/commit/22b3062c4909400664bd2a50ca36d5ee737531a1))
|
||||
|
||||
## v0.5.0 (2022-07-04)
|
||||
### Feature
|
||||
* Add meta-auth ([#4](https://git.grassecon.net/cicnet/cic-cli/issues/4)) ([`bfe7086`](https://git.grassecon.net/cicnet/cic-cli/commit/bfe7086178f3fc2743dd68cc20c5459ca466ae8e))
|
||||
|
||||
## v0.4.1 (2022-06-14)
|
||||
### Fix
|
||||
* Bump deps ([`e36ea4b`](https://git.grassecon.net/cicnet/cic-cli/commit/e36ea4bcfb1c417d1adf2be9455cb20b23323414))
|
||||
|
@ -1 +1 @@
|
||||
__version__ = "0.4.1"
|
||||
__version__ = "0.5.5"
|
||||
|
@ -10,7 +10,7 @@ registry_address = 0xcf60ebc445b636a5ab787f9e8bc465a2a3ef8299
|
||||
[meta]
|
||||
url = http://localhost:63380
|
||||
http_origin =
|
||||
|
||||
auth_token =
|
||||
[rpc]
|
||||
provider = http://localhost:63545
|
||||
|
||||
|
@ -10,6 +10,7 @@ registry_address = 0xcf60ebc445b636a5ab787f9e8bc465a2a3ef8299
|
||||
[meta]
|
||||
url = http://localhost:8000
|
||||
http_origin =
|
||||
auth_token =
|
||||
|
||||
[rpc]
|
||||
provider = http://localhost:8545
|
||||
|
@ -10,6 +10,7 @@ registry_address = 0xe3e3431BF25b06166513019Ed7B21598D27d05dC
|
||||
[meta]
|
||||
url = https://meta.sarafu.network
|
||||
http_origin =
|
||||
auth_token =
|
||||
|
||||
[rpc]
|
||||
provider = https://rpc.sarafu.network
|
||||
|
@ -10,7 +10,7 @@ registry_address = 0x47269C43e4aCcA5CFd09CB4778553B2F69963303
|
||||
[meta]
|
||||
url = https://meta.sarafu.network
|
||||
http_origin =
|
||||
|
||||
auth_token =
|
||||
[rpc]
|
||||
provider = https://rpc.sarafu.network
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
GITABLE_CONTRACT_URL = "https://gitlab.com/cicnet/eth-erc20/-/raw/master/python/giftable_erc20_token/data/GiftableToken"
|
||||
DMR_CONTRACT_URL = "https://gitlab.com/cicnet/erc20-demurrage-token/-/raw/master/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap"
|
||||
DMR_CONTRACT_URL = "https://gitlab.com/cicnet/erc20-demurrage-token/-/raw/v0.1.1/python/erc20_demurrage_token/data/DemurrageTokenSingleNocap"
|
||||
|
||||
CONTRACT_URLS = [
|
||||
{
|
||||
|
@ -4,8 +4,10 @@ import logging
|
||||
import os
|
||||
from typing import List
|
||||
|
||||
# External imports
|
||||
from chainlib.chain import ChainSpec
|
||||
from chainlib.cli.config import Config
|
||||
|
||||
# Local Modules
|
||||
from cic.contract.components.attachment import Attachment
|
||||
from cic.contract.components.meta import Meta
|
||||
@ -15,7 +17,6 @@ from cic.contract.helpers import init_writers_from_config
|
||||
from cic.contract.network import Network
|
||||
from cic.contract.processor import ContractProcessor
|
||||
from cic.writers import HTTPWriter, KeyedWriterFactory, MetadataWriter
|
||||
# external imports
|
||||
from cic_types.ext.metadata import MetadataRequestsHandler
|
||||
from cic_types.ext.metadata.signer import Signer as MetadataSigner
|
||||
|
||||
@ -146,9 +147,12 @@ def deploy_contract(
|
||||
output_writer_path_meta = output_directory
|
||||
|
||||
metadata_endpoint = config.get("META_URL")
|
||||
|
||||
metadata_auth_token = config.get("META_AUTH_TOKEN")
|
||||
headers = {"Authorization": f"Basic {metadata_auth_token}"}
|
||||
if metadata_endpoint is not None:
|
||||
MetadataRequestsHandler.base_url = metadata_endpoint
|
||||
MetadataRequestsHandler.auth_token = metadata_auth_token
|
||||
|
||||
MetadataSigner.gpg_path = "/tmp"
|
||||
MetadataSigner.key_file_path = config.get("AUTH_KEYFILE_PATH")
|
||||
MetadataSigner.gpg_passphrase = config.get("AUTH_PASSPHRASE")
|
||||
@ -163,12 +167,12 @@ def deploy_contract(
|
||||
)
|
||||
ca = Attachment(
|
||||
path=contract_directory,
|
||||
writer=writers["attachment"](path=output_writer_path_meta),
|
||||
writer=writers["attachment"](path=output_writer_path_meta, headers=headers),
|
||||
)
|
||||
cp = Proof(
|
||||
path=contract_directory,
|
||||
attachments=ca,
|
||||
writer=writers["proof"](path=output_writer_path_meta),
|
||||
writer=writers["proof"](path=output_writer_path_meta, headers=headers),
|
||||
)
|
||||
cn = Network(path=contract_directory)
|
||||
|
||||
|
@ -84,6 +84,7 @@ class ContractProcessor:
|
||||
if a is None:
|
||||
logg.debug(f'skipping missing task receiver "{task}"')
|
||||
continue
|
||||
logg.debug(f'Processing "{ext}:{task}"')
|
||||
v = a.process(
|
||||
token_address=token_address,
|
||||
token_symbol=token_symbol,
|
||||
|
@ -10,7 +10,7 @@ registry_address = 0xe3e3431BF25b06166513019Ed7B21598D27d05dC
|
||||
[meta]
|
||||
url = https://meta.sarafu.network
|
||||
http_origin =
|
||||
|
||||
auth_token =
|
||||
[auth]
|
||||
type = gnupg
|
||||
keyfile_path =
|
||||
|
@ -90,7 +90,6 @@ def main():
|
||||
except Exception as e:
|
||||
logg.exception(e)
|
||||
sys.stderr.write("\033[;91m" + str(e) + "\033[;39m\n")
|
||||
argparser.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@ import logging
|
||||
import os
|
||||
import sys
|
||||
import urllib.request
|
||||
from typing import Type, Union
|
||||
from typing import Dict, Type, Union
|
||||
|
||||
from cic_types.ext.metadata import MetadataPointer, MetadataRequestsHandler
|
||||
|
||||
@ -33,6 +33,7 @@ class KVWriter(OutputWriter):
|
||||
os.makedirs(path)
|
||||
self.path = path
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def write(self, k, v):
|
||||
fp = os.path.join(self.path, str(k))
|
||||
logg.debug(f"path write {fp} {str(v)}")
|
||||
@ -42,16 +43,17 @@ class KVWriter(OutputWriter):
|
||||
|
||||
|
||||
class HTTPWriter(OutputWriter):
|
||||
def __init__(self, path=None, *args, **kwargs):
|
||||
def __init__(self, path=None, headers: Dict[str, str] = None, *args, **kwargs):
|
||||
super(HTTPWriter, self).__init__(*args, **kwargs)
|
||||
self.path = path
|
||||
self.headers = headers
|
||||
|
||||
def write(self, k, v):
|
||||
path = self.path
|
||||
if k is not None:
|
||||
path = os.path.join(path, k)
|
||||
logg.debug(f"http writer post {path} \n key: {k}, value: {v}")
|
||||
rq = urllib.request.Request(path, method="POST", data=v)
|
||||
logg.debug(f"HTTPWriter POST {path} data: {v}, headers: {self.headers}")
|
||||
rq = urllib.request.Request(path, method="POST", data=v, headers=self.headers)
|
||||
r = urllib.request.urlopen(rq)
|
||||
logg.info(f"http writer submitted at {r.read()}")
|
||||
|
||||
@ -83,13 +85,15 @@ class KeyedWriterFactory:
|
||||
logg.debug(f"adding key {k} t keyed writer factory")
|
||||
self.x[k] = v
|
||||
|
||||
def new(self, path=None, *_args, **_kwargs):
|
||||
def new(self, path=None, headers: Dict[str, str] = None, *_args, **_kwargs):
|
||||
writer_keyed = None
|
||||
writer_immutable = None
|
||||
if self.key_writer_constructor is not None:
|
||||
writer_keyed = self.key_writer_constructor(path, **self.x)
|
||||
if self.immutable_writer_constructor is not None:
|
||||
writer_immutable = self.immutable_writer_constructor(path, **self.x)
|
||||
writer_immutable = self.immutable_writer_constructor(
|
||||
path, headers, **self.x
|
||||
)
|
||||
return KeyedWriter(writer_keyed, writer_immutable)
|
||||
|
||||
|
||||
|
4762
poetry.lock
generated
4762
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "cic-cli"
|
||||
version = "0.4.1"
|
||||
version = "0.5.5"
|
||||
description = "Generic cli tooling for the CIC token network"
|
||||
authors = [
|
||||
"Louis Holbrook <dev@holbrook.no>",
|
||||
@ -32,27 +32,30 @@ cic = 'cic.runnable.cic_cmd:main'
|
||||
[[tool.poetry.source]]
|
||||
name = "grassroots_"
|
||||
url = "https://pip.grassrootseconomics.net/"
|
||||
default = true
|
||||
default = false
|
||||
secondary = true
|
||||
|
||||
[[tool.poetry.source]]
|
||||
name = "pypi_"
|
||||
url = "https://pypi.org/simple/"
|
||||
secondary = true
|
||||
default = true
|
||||
secondary = false
|
||||
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.8"
|
||||
funga-eth = "^0.6.0"
|
||||
cic-types = "^0.2.3"
|
||||
cic-types = "^0.2.7"
|
||||
confini = "^0.6.0"
|
||||
chainlib = "~0.3.0"
|
||||
chainlib = "~0.1.0"
|
||||
cbor2 = "~5.4.1"
|
||||
|
||||
chainlib-eth = { version = "~0.3.1", optional = true }
|
||||
chainlib-eth = { version = "~0.1.1", optional = true }
|
||||
eth-token-index = { version = "^0.3.0", optional = true }
|
||||
eth-address-index = { version = "~0.5.0", optional = true }
|
||||
okota = { version = "^0.4.0", optional = true }
|
||||
cic-eth-registry = { version = "^0.7.0", optional = true }
|
||||
cic-contracts = { version = "~0.2.0", optional = true }
|
||||
cic-eth-registry = { version = "^0.6.9", optional = true }
|
||||
cic-contracts = { version = "~0.1.0", optional = true }
|
||||
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
@ -61,9 +64,10 @@ pytest-cov = "2.10.1"
|
||||
python-semantic-release = "^7.25.2"
|
||||
pylint = "^2.12.2"
|
||||
black = { version = "^22.1.0", allow-prereleases = true }
|
||||
eth_tester = "0.6.0b6"
|
||||
py-evm = "0.5.0a3"
|
||||
eth_tester = "0.5.0b3"
|
||||
py-evm = "0.3.0a20"
|
||||
rlp = "2.0.1"
|
||||
mypy = "^0.961"
|
||||
|
||||
[tool.poetry.extras]
|
||||
eth = [
|
||||
|
Loading…
Reference in New Issue
Block a user