@@ -84,22 +84,34 @@ You can then use the examples code to create assets (see examples directory):
8484 # it does not start with arc_
8585 }
8686 #
87- # The first argument are the attributes of the asset
88- # The second argument is wait for confirmation:
89- # If @confirm@ is True then this function will not
90- # return until the asset is confirmed and ready
91- # to accept events (or an error occurs)
87+ # There are 3 alternatives
9288 #
89+ # 1. Create the asset:
90+ # The first argument is the attributes of the asset
91+ return arch.assets.create(attrs = attrs)
92+ #
93+ # 2. alternatively one can wait for the asset to be confirmed in the
94+ # immutable store.
95+ # The second argument is wait for confirmation:
96+ # If @confirm@ is True then this function will not
97+ # return until the asset is confirmed.
98+ #
99+ # Confirmation guarantees that 3rd parties can retrieve and cryptographically
100+ # verify your Assets, which can take a few seconds to propagate. It is typically
101+ # not necessary to wait unless your workflow involves near-real-time
102+ # communication with 3rd parties and the 3rd party needs immediate cryptographic
103+ # verification of your new Asset.
93104 return arch.assets.create(attrs = attrs, confirm = True )
94- # alternatively if some work can be done whilst the asset is confirmed then this call can be
95- # replaced by a two-step alternative:
105+ #
106+ # 3. lastly if some work can be done whilst the asset is confirmed then this call
107+ # can be replaced by a two-step alternative:
96108
97- # asset = arch.assets.create(props=props, attrs=attrs, confirm=False )
109+ asset = arch.assets.create(props = props, attrs = attrs)
98110
99111 # ... do something else here
100112 # and then wait for confirmation
101113
102- # self. arch.assets.wait_for_confirmation(asset['identity']))
114+ return arch.assets.wait_for_confirmation(asset[' identity' ]))
103115
104116
105117 def main ():
@@ -238,7 +250,12 @@ Each step consists of control parameters (specified in the 'step' dictionary) an
238250the yaml representation of the request body for an asset or event.
239251
240252The confirm: field is a control variable for the PythonSDK that ensures that the
241- asset or event is confirmed before returning.
253+ asset or event is confirmed before returning. This is optional and is only required
254+ 3rd parties need to immediately retrieve and cryptographically
255+ verify your Assets, which can take a few seconds to propagate. It is typically
256+ not necessary to wait unless your workflow involves near- real- time
257+ communication with 3rd parties and the 3rd party needs instant cryptographic
258+ verification of your new Asset.
242259
243260.. note::
244261
@@ -276,7 +293,6 @@ asset or event is confirmed before returning.
276293 radioactive: " true"
277294 radiation_level: " 0"
278295 weight: " 0"
279- confirm: true
280296
281297 # setup the radiation bags to have a varing amount of radiactive waste
282298 # note the values to the events.create method are string representations of boolean
@@ -294,7 +310,6 @@ asset or event is confirmed before returning.
294310 asset_attributes:
295311 radiation_level: " 3"
296312 weight: " 1"
297- confirm: true
298313
299314Logging
300315========
0 commit comments