Skip to content

Commit

Permalink
Merge branch 'v8/develop' into feature/ruff-formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Zvonimir authored and Zvonimir committed Jan 12, 2025
2 parents 637b447 + c3ec955 commit c25854a
Show file tree
Hide file tree
Showing 29 changed files with 5,103 additions and 3,649 deletions.
1,201 changes: 616 additions & 585 deletions dkg/asset.py

Large diffs are not rendered by default.

103 changes: 97 additions & 6 deletions dkg/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from enum import Enum
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand All @@ -15,10 +16,72 @@
# specific language governing permissions and limitations
# under the License.

DEFAULT_CANON_ALGORITHM = "URDNA2015"
DEFAULT_RDF_FORMAT = "application/n-quads"

PRIVATE_ASSERTION_PREDICATE = (
"https://ontology.origintrail.io/dkg/1.0#privateAssertionID"
"https://ontology.origintrail.io/dkg/1.0#privateMerkleRoot"
)

PRIVATE_HASH_SUBJECT_PREFIX = "https://ontology.origintrail.io/dkg/1.0#metadata-hash:"

PRIVATE_RESOURCE_PREDICATE = (
"https://ontology.origintrail.io/dkg/1.0#representsPrivateResource"
)

CHUNK_BYTE_SIZE = 32

MAX_FILE_SIZE = 10000000


class DefaultParameters(Enum):
ENVIRONMENT: str = "mainnet"
PORT: int = 8900
FREQUENCY: int = 5
MAX_NUMBER_OF_RETRIES: int = 5
HASH_FUNCTION_ID: int = 1
IMMUTABLE: bool = False
VALIDATE: bool = True
OUTPUT_FORMAT: str = "JSON-LD"
STATE: None = None
INCLUDE_METADATA: bool = False
CONTENT_TYPE: str = "all"
HANDLE_NOT_MINED_ERROR: bool = False
SIMULATE_TXS: bool = False
FORCE_REPLACE_TXS: bool = False
GAS_LIMIT_MULTIPLIER: int = 1
PARANET_UAL: None = None
GET_SUBJECT_UAL: bool = False
REPOSITORY: str = "dkg"


class OutputTypes(Enum):
NQUADS: str = "N-QUADS"
JSONLD: str = "JSON-LD"


class Environments(Enum):
DEVELOPMENT: str = "development"
DEVNET: str = "devnet"
TESTNET: str = "testnet"
MAINNET: str = "mainnet"


class Blockchains(Enum):
HARDHAT_1: str = "hardhat1:31337"
HARDHAT_2: str = "hardhat2:31337"
BASE_DEVNET: str = "base:84532"
GNOSIS_DEVNET: str = "gnosis:10200"
NEUROWEB_DEVNET: str = "otp:20430"
BASE_TESTNET: str = "base:84532"
GNOSIS_TESTNET: str = "gnosis:10200"
NEUROWEB_TESTNET: str = "otp:20430"
BASE_MAINNET: str = "base:8453"
GNOSIS_MAINNET: str = "gnosis:100"
NEUROWEB_MAINNET: str = "otp:2043"


ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
BLOCKCHAINS = {
"development": {
"hardhat1:31337": {
Expand All @@ -32,20 +95,40 @@
},
"devnet": {
"base:84532": {
"hub": "0xaA849CAC4FA86f6b7484503f3c7a314772AED6d4",
"hub": "0xE043daF4cC8ae2c720ef95fc82574a37a429c40A",
"rpc": "https://sepolia.base.org",
}
},
"testnet": {
"base:84532": {
"hub": "0xCca0eA14540588A09c85cD6A6Fc53eA3A7010692",
"hub": "0xf21CE8f8b01548D97DCFb36869f1ccB0814a4e05",
"rpc": "https://sepolia.base.org",
}
},
"gnosis:10200": {
"hub": "0x2c08AC4B630c009F709521e56Ac385A6af70650f",
"rpc": "https://rpc.chiadochain.net",
},
"otp:20430": {
"hub": "0xd7d073b560412c6A7F33dD670d323D01061E5DEb",
"rpc": "https://lofar-testnet.origin-trail.network",
},
},
"mainnet": {
"base:8453": {
"hub": "0x99Aa571fD5e681c2D27ee08A7b7989DB02541d13",
"rpc": "https://mainnet.base.org",
},
"gnosis:100": {
"hub": "0x882D0BF07F956b1b94BBfe9E77F47c6fc7D4EC8f",
"rpc": "https://rpc.gnosischain.com/",
},
"otp:2043": {
"hub": "0x0957e25BD33034948abc28204ddA54b6E1142D6F",
"rpc": "https://astrosat-parachain-rpc.origin-trail.network",
},
},
"mainnet": {},
}

DEFAULT_HASH_FUNCTION_ID = 1
DEFAULT_PROXIMITY_SCORE_FUNCTIONS_PAIR_IDS = {
"development": {"hardhat1:31337": 2, "hardhat2:31337": 2, "otp:2043": 2},
"devnet": {
Expand All @@ -67,3 +150,11 @@

PRIVATE_HISTORICAL_REPOSITORY = "privateHistory"
PRIVATE_CURRENT_REPOSITORY = "privateCurrent"


class Operations(Enum):
PUBLISH = "publish"
GET = "get"
QUERY = "query"
PUBLISH_PARANET = "publishParanet"
FINALITY = "finality"
Loading

0 comments on commit c25854a

Please sign in to comment.