Skip to content

Commit 683f62a

Browse files
authored
Simple Hash is removed. (#265)
* Simple Hash is removed. The proof mechanism is now not specified anywhere and accepts and uses whatever the backend supples. The customer can still specify the proof mechanism as MERKLE_LOG but cannot specify any other value. AB#9189
1 parent 718d598 commit 683f62a

40 files changed

Lines changed: 132 additions & 518 deletions

README.rst

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ You can then use the examples code to create assets (see examples directory):
5555
from os import getenv
5656
5757
from archivist.archivist import Archivist
58-
from archivist.proof_mechanism import ProofMechanism
5958
6059
6160
def create_asset(arch):
@@ -85,21 +84,13 @@ You can then use the examples code to create assets (see examples directory):
8584
# it does not start with arc_
8685
}
8786
#
88-
# Select the mechanism used to prove evidence for the asset. If the selected proof
89-
# mechanism is not enabled for your tenant then an error will occur.
90-
# If unspecified then SIMPLE_HASH is used.
91-
props = {
92-
"proof_mechanism": ProofMechanism.SIMPLE_HASH.name,
93-
}
94-
95-
# The first argument are the properties of the asset
96-
# The second argument are the attributes of the asset
97-
# The third argument is wait for confirmation:
87+
# The first argument are the attributes of the asset
88+
# The second argument is wait for confirmation:
9889
# If @confirm@ is True then this function will not
99-
# return until the asset is confirmed on the blockchain and ready
90+
# return until the asset is confirmed and ready
10091
# to accept events (or an error occurs)
10192
#
102-
return arch.assets.create(props=props, attrs=attrs, confirm=True)
93+
return arch.assets.create(attrs=attrs, confirm=True)
10394
# alternatively if some work can be done whilst the asset is confirmed then this call can be
10495
# replaced by a two-step alternative:
10596
@@ -131,9 +122,8 @@ You can then use the examples code to create assets (see examples directory):
131122
client_secret = tokenfile.read().strip()
132123
133124
# Initialize connection to Archivist. max_time is the time to wait for confirmation
134-
# of an asset or event creation - the default is 1200 seconds but one can optionally
135-
# specify a different value here particularly when creating assets on SIMPLE_HASH
136-
# as confirmation times are much shorter in this case.
125+
# of an asset or event creation - the default is 300 seconds but one can optionally
126+
# specify a different value.
137127
with arch = Archivist(
138128
"https://app.datatrails.ai",
139129
(client_id, client_secret),

archivist/assets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def create(
127127
Creates asset with defined properties and attributes.
128128
129129
Args:
130-
props (dict): Properties - usually only the proof_mechanism setting
130+
props (dict): Properties
131131
attrs (dict): attributes of created asset.
132132
confirm (bool): if True wait for asset to be confirmed.
133133

archivist/confirmer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def _wait_for_confirmation(self: Managers, identity: str) -> ReturnTypes:
101101
f"confirmation for {identity} FAILED - this is unusable"
102102
)
103103

104-
# Simple hash and merkleLog
105104
if status in (
106105
ConfirmationStatus.CONFIRMED.name,
107106
ConfirmationStatus.COMMITTED.name,

archivist/notebooks/Check Asset Compliance using CURRENT OUTSTANDING Policy.ipynb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"from archivist.archivist import Archivist\n",
4141
"from archivist.compliance_policy_requests import CompliancePolicyCurrentOutstanding\n",
4242
"from archivist.constants import ASSET_BEHAVIOURS\n",
43-
"from archivist.proof_mechanism import ProofMechanism\n",
4443
"from archivist.logger import set_logger\n",
4544
"\n",
4645
"filterwarnings(\"ignore\", message=\"Unverified HTTPS request\")"
@@ -164,7 +163,6 @@
164163
" },\n",
165164
" ],\n",
166165
" \"behaviours\": ASSET_BEHAVIOURS,\n",
167-
" \"proof_mechanism\": ProofMechanism.SIMPLE_HASH.name,\n",
168166
" \"attributes\": {\n",
169167
" \"arc_display_name\": \"Gringott's Vault 2\",\n",
170168
" \"arc_description\": \"Main door to the second level security vault in Gringott's Wizarding Bank\",\n",
@@ -355,7 +353,6 @@
355353
" \"owner\": \"0xe889E67FdBa658C6f27ccBDa98D9d1B5500Dbbce\",\n",
356354
" \"at_time\": \"2023-01-16T11:51:30Z\",\n",
357355
" \"storage_integrity\": \"TENANT_STORAGE\",\n",
358-
" \"proof_mechanism\": \"SIMPLE_HASH\",\n",
359356
" \"chain_id\": \"827586838445807967\",\n",
360357
" \"public\": false,\n",
361358
" \"tenant_identity\": \"tenant/9bfb80ee-81f6-40dc-b5c7-1c7fb2fb9866\"\n",
@@ -377,7 +374,6 @@
377374
" \"owner\": \"0xe889E67FdBa658C6f27ccBDa98D9d1B5500Dbbce\",\n",
378375
" \"at_time\": \"2023-01-16T11:51:30Z\",\n",
379376
" \"storage_integrity\": \"TENANT_STORAGE\",\n",
380-
" \"proof_mechanism\": \"SIMPLE_HASH\",\n",
381377
" \"chain_id\": \"827586838445807967\",\n",
382378
" \"public\": false,\n",
383379
" \"tenant_identity\": \"tenant/9bfb80ee-81f6-40dc-b5c7-1c7fb2fb9866\"\n",

archivist/notebooks/Check Asset Compliance using SINCE Policy.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@
300300
" \"owner\": \"0xe889E67FdBa658C6f27ccBDa98D9d1B5500Dbbce\",\n",
301301
" \"at_time\": \"2023-01-16T11:52:27Z\",\n",
302302
" \"storage_integrity\": \"TENANT_STORAGE\",\n",
303-
" \"proof_mechanism\": \"SIMPLE_HASH\",\n",
304303
" \"chain_id\": \"827586838445807967\",\n",
305304
" \"public\": false,\n",
306305
" \"tenant_identity\": \"tenant/9bfb80ee-81f6-40dc-b5c7-1c7fb2fb9866\"\n",
@@ -322,7 +321,6 @@
322321
" \"owner\": \"0xe889E67FdBa658C6f27ccBDa98D9d1B5500Dbbce\",\n",
323322
" \"at_time\": \"2023-01-16T11:52:27Z\",\n",
324323
" \"storage_integrity\": \"TENANT_STORAGE\",\n",
325-
" \"proof_mechanism\": \"SIMPLE_HASH\",\n",
326324
" \"chain_id\": \"827586838445807967\",\n",
327325
" \"public\": false,\n",
328326
" \"tenant_identity\": \"tenant/9bfb80ee-81f6-40dc-b5c7-1c7fb2fb9866\"\n",

archivist/notebooks/Checking the Dog's Weight.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"from archivist.compliance_policy_requests import (\n",
4949
" CompliancePolicyRichness,\n",
5050
")\n",
51-
"from archivist.proof_mechanism import ProofMechanism\n",
5251
"from archivist.logger import set_logger"
5352
]
5453
},

archivist/notebooks/Create Artist and Album Release Info.ipynb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"from dotenv import load_dotenv\n",
4545
"\n",
4646
"from archivist.archivist import Archivist\n",
47-
"from archivist.proof_mechanism import ProofMechanism\n",
4847
"from archivist.logger import set_logger"
4948
]
5049
},
@@ -207,7 +206,6 @@
207206
" \"owner\": \"0x5284e740A744F075E402f7fB0c4485532ddf4Af8\",\n",
208207
" \"at_time\": \"2023-06-02T20:57:01Z\",\n",
209208
" \"storage_integrity\": \"TENANT_STORAGE\",\n",
210-
" \"proof_mechanism\": \"SIMPLE_HASH\",\n",
211209
" \"chain_id\": \"8275868384\",\n",
212210
" \"public\": false,\n",
213211
" \"tenant_identity\": \"tenant/0a62f7c9-fd7b-4791-8041-01218d839ec1\"\n",

archivist/notebooks/Create Event with Verified Domain.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,8 @@
232232
" # The first argument is the attributes of the asset\n",
233233
" # The second argument is wait for confirmation:\n",
234234
" # If @confirm@ is True then this function will not\n",
235-
" # return until the asset is confirmed on the blockchain and ready\n",
235+
" # return until the asset is confirmed and ready\n",
236236
" # to accept events (or an error occurs)\n",
237-
" # After an asset is submitted to the blockchain (submitted),\n",
238-
" # it will be in the \"Pending\" status.\n",
239-
" # Once it is added to the blockchain, the status will be changed to \"Confirmed\"\n",
240237
" return arch.assets.create(attrs=attrs, confirm=True)"
241238
]
242239
},
@@ -276,7 +273,6 @@
276273
" \"confirmation_status\": \"CONFIRMED\",\n",
277274
" \"identity\": \"assets/0047715f-368e-4a62-aa04-48e6fa974e85\",\n",
278275
" \"owner\": \"0xe889E67FdBa658C6f27ccBDa98D9d1B5500Dbbce\",\n",
279-
" \"proof_mechanism\": \"SIMPLE_HASH\",\n",
280276
" \"public\": false,\n",
281277
" \"storage_integrity\": \"TENANT_STORAGE\",\n",
282278
" \"tenant_identity\": \"tenant/9bfb80ee-81f6-40dc-b5c7-1c7fb2fb9866\",\n",

archivist/notebooks/Feeding the Dog Hourly.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"from archivist.compliance_policy_requests import (\n",
4949
" CompliancePolicyPeriodOutstanding,\n",
5050
")\n",
51-
"from archivist.proof_mechanism import ProofMechanism\n",
5251
"from archivist.logger import set_logger"
5352
]
5453
},

archivist/notebooks/Feeding the Dog in a Timely Manner.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"from archivist.compliance_policy_requests import (\n",
4949
" CompliancePolicyDynamicTolerance,\n",
5050
")\n",
51-
"from archivist.proof_mechanism import ProofMechanism\n",
5251
"from archivist.logger import set_logger"
5352
]
5453
},

0 commit comments

Comments
 (0)