Skip to main content
PSUT / IoTEngineering learning studio
WORKSPACE
Offline-first portalDr. Mohammad Alja’afreh
Distributed Ledger StudioBlockchain for IoTExperimentsWorkspaces
ENGINEERING WORKSPACE
Home/Engineering Workspaces/B15 · Local IoT dApp and contract acceptance
IoTPSUT IoT Engineering StudioPrincess Sumaya University for Technology · Dr. Mohammad Alja’afreh
Blockchain for IoT · advanced laboratory
Blockchain for IoT

Local IoT dApp and contract acceptance

Ask Dr. Mohammad · B15 →

Trace a fictional sensor record into a local EVM transaction, verify receipt and event fields, and test access and replay invariants.

Design experiment & verify evidence →
B15 · Laboratory mentorAsk about the current experiment, its algorithms or Python notebook.
Ask Dr. MohammadAdaptive practice
Learning workflow · Advanced blockchainB15 · Local IoT dApp and contract acceptance
B15 · Academic orientation

Scope and objectives

Scope of the experiment

Trace a fictional sensor record into a local EVM transaction, verify receipt and event fields, and test access and replay invariants.

The focus of this experiment is to trace end-to-end local IoT dApp and contract interactions. Students then test valid and invalid acceptance criteria across components, and record transaction, state and application evidence with trust assumptions. The Concepts view explains the operation before the practical work; the Simulation view is used to examine reference and changed inputs, not to substitute for actual measurements.

Learning objectives

  • Trace end-to-end local IoT dApp and contract interactions.
  • Test valid and invalid acceptance criteria across components.
  • Record transaction, state and application evidence with trust assumptions.
  • Identify the configured inputs (Contract scenario) and record the corresponding observed outputs with units where applicable.
  • Compare the reference calculation or decision with an independent implementation or authorized observation; state any discrepancy and the applicable model boundary.

Expected learning outcomes

On completion, students can trace end-to-end local IoT dApp and contract interactions, test valid and invalid acceptance criteria across components, and record transaction, state and application evidence with trust assumptions.

Required deliverables

Submit the derivation or state trace for the named operation, the exact reference and changed configurations, the associated simulator or practical evidence, and a short validation statement addressing record transaction, state and application evidence with trust assumptions. Separate predicted values from observations.

Prerequisite knowledge and related learning

Review the following catalogue prerequisites before starting.

Environment and experimental methodology

The listed browser model and experiment-specific local Python, Solidity or EVM workflow, where provided. Do not treat a model as a deployed ledger.

Begin with a manual prediction, record the baseline, change one independent condition at a time, and compare the resulting trace or measurements with the original prediction. Record observations and uncertainty separately from reference values. Follow the experiment’s specific procedure, safety limits, and acceptance checks.

B15 · learning outcome

Understand the experiment

Scientific architecture · Local IoT dApp and contract acceptance

Local dApp acceptance path — Sensor payload / validated record; Wallet / sign local transaction; Contract / authorization and state; Receipt / status, logs; Accept / compare against intended payload
Scientific concept map: Local dApp — User interface; Wallet — Selected account; Local contract — Deploy and execute; IoT payload — Telemetry record; Acceptance — Receipt and state checks.

Scientific foundations and analytical reasoning

An integrated dApp must verify serialization, signer identity, sequence, receipt and event independently. Failure at one stage must not be hidden by another.

Before operating the equipment or executing the program, derive the expected outcome using the required theoretical work in Experiment. Use the diagram to identify the variables and system boundaries.

Scientific theory · Integrated dApp acceptance

An IoT dApp comprises sample acquisition, serialization, commitment, authenticated transaction, execution and reconciliation. Every stage has a separate acceptance criterion. A correct hash cannot compensate for an unauthorized signer or stale sequence; a valid receipt cannot prove the physical reading.

Worked example and engineering interpretation

For one assigned record, record the canonical bytes, digest, signer, transaction receipt and stored state. Deliberately change one classroom record after commitment and check verification. Keep stage-level failures distinct instead of labeling every exception a blockchain error.

Engineering principles · additional worked teaching example

A dApp has acquisition, canonical serialization, authorization, transaction execution, event indexing and retrieval verification. Each boundary needs separate acceptance evidence; a successful transaction does not validate a physical sensor.

From theory to experiment

Predict the reference result before operating the workbench; check the actual intermediate state, units and constraints. The existing simulation, implementation and procedure below are distinct sources of evidence.

How to investigate Local IoT dApp and contract acceptance

Trace a fictional sensor record into a local EVM transaction, verify receipt and event fields, and test access and replay invariants.

Analytical investigation means collecting an observation, identifying the mechanism, using a calculation or state trace to explain it, and checking your conclusion against evidence. Controlled comparison means changing one independent variable, holding the remaining relevant conditions constant, and measuring a dependent variable against a baseline. Experimental validation means comparing a predicted result to a reproducible observation or assertion; agreement inside a model does not certify hardware. Evidence-based reasoning connects a specific observation to a theoretical rule and states uncertainty, not merely an opinion. Performance characterization records a named metric and its units across conditions; sensitivity analysis changes one parameter across several values. A threat assessment links an asset, threat, consequence and evidence to a mitigation.

Experiment-specific guided practice

Objective: Trace a fictional sensor record into a local EVM transaction, verify receipt and event fields, and test access and replay invariants.

  1. Complete B04–B07 and B10–B13. Run each model scenario separately; note that each begins with a fresh state. Save baseline and compare negative controls.
  2. From the extracted portal root in Ubuntu WSL (not browser terminal), run node --version (20 or newer), npm --version . If absent install Node.js from a trusted supported distribution; follow its official installation instructions. Enter cd blockchain , run npm install and npm ls --depth=0 . Expected solc 0.8.28, ethers 6.13.5, ganache 7.9.2. Initial download requires internet.
  3. Run npm run test:advanced . Expected 13 passing named checks, including actual RoleRegistry and BatchAnchor controls, the gateway digest, receipt/event fields and replay rejection. It writes advanced-evm-evidence.json in the current directory; archive it before rerunning. If installation or compilation fails, record the error and mark blocked/failed as appropriate.
  4. For the automated verification center, return to portal root ( cd .. ) and run python3 verification/runner.py --profile advanced-blockchain --output advanced-evidence.json . The model and Python checks can pass independently of the EVM dependency gate. Import the report and preserve actual receipts.

Reference check: An accepted reading above 8°C raises the declared teaching-policy warning. Offline delivery does not create a commitment. Altered bytes do not match an accepted digest.

Model boundary: 8°C is a teaching threshold, not a universal food-safety standard. Hashes cannot establish actual temperature or physical custody.

Independent task and submission evidence

2. From the extracted portal root in Ubuntu WSL (not browser terminal), run node --version (20 or newer), npm --version . If absent install Node.js from a trusted supported distribution; follow its official installation instructions. Enter cd blockchain , run npm install and npm ls --depth=0 . Expected solc 0.8.28, ethers 6.13.5, ganache 7.9.2. Initial download requires internet. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat.

Before execution write the independent variable and its levels, dependent observation with units where applicable, baseline, controlled variables, measurement method and expected result. For a state machine use state/event/output rather than inventing a numeric metric. Record failures and repeat the baseline. A weak conclusion is “it works”; a supported conclusion names the changed setting, observed value/state, corresponding rule and one limitation.

TrialChanged settingFixed settingsPredicted resultActual observation / unitsEvidence / uncertainty
A: baselineReferenceRecordPredictRecordRecord
B: one changeRecordSame as APredictRecordRecord
A: repeatRestoreSame as APredictRecordRecord

Completion: submit the filled table, relevant simulator screenshot or terminal/notebook output, reasoning with units/assumptions, and one limitation. Preserve the independent assessment questions; this guide does not fill their answers.

Trace a fictional sensor record into a local EVM transaction, verify receipt and event fields, and test access and replay invariants.

Offline state machine is not Ethereum. Optional actual in-process Ganache uses test accounts and no public RPC, real funds, hardware or wallet keys.

Worked engineering reasoning and boundary conditions

Engineering reference configuration: Contract scenario = none. In the classroom model, First anchor = Accepted; Final sequence = 1; Successful state match = Yes; Last decision = Accepted in model. This is a model of TelemetryAnchor, not an EVM. Run the separate in-process dApp script for real local transactions, receipts and verification. Never use real keys or sensor identifiers. Offline state machine is not Ethereum. Optional actual in-process Ganache uses test accounts and no public RPC, real funds, hardware or wallet keys.

Use the diagram to follow the calculation or state progression. Keep the teaching configuration separate from the independent exercise values; compare observations with the actual model and implementation.

Concept animation · operation pathway

Explore the teaching example independently of the simulator. Each step reveals an operation, data relationship or calculated state. The Simulation view has separate editable inputs.

Local IoT dApp and contract acceptance: operation pathwayowner / enableAccepted in modelsensor / anchorAccepted in modelRead the active operation, then inspect the accumulated state.

Step 1 of 2 · owner / enable

owner / enable

owner / enable
Accepted in model

Teaching example only; inspect live calculations or real practical evidence separately.

Recall the concept before revealing its explanation.

0 / 3 revealed
B15 · 01 / 08Why avoid real keys?Reveal explanation
Engineering explanation

Test accounts are temporary and not intended to protect assets.

B15 · 02 / 08What does the dApp verify?Reveal explanation
Engineering explanation

The receipt, log fields, state and digest equality for fictional telemetry.

B15 · 03 / 08What remains unverified?Reveal explanation
Engineering explanation

Actual sensor truth, production deployment, public network finality and security certification.

B15 · 04 / 08Why test replay and revoked writers in the dApp?Reveal explanation
Engineering reasoning

They are negative controls for freshness and authorization; neither should advance accepted state.

B15 · 05 / 08Why compare the commitment from client and contract evidence?Reveal explanation
Engineering reasoning

It verifies agreement on the exact serialized telemetry digest, separate from proving sensor truth.

B15 · 06 / 08A local dApp transaction is accepted. Select every technically valid statement. A. Verify receipt and event fields against the intended operation. B. Include negative access and replay tests. C. A transaction hash proves authorization and successful execution. D. A positive test alone verifies rejection of every invalid caller.Reveal explanation
Applied scenario

Correct: A. Verify receipt and event fields against the intended operation.; B. Include negative access and replay tests.

B15 · 07 / 08In Local IoT dApp and contract acceptance, which reference and changed settings are prescribed for Contract scenario?Reveal explanation
Controlled configuration

Contract scenario: none → replay; hold the remaining settings fixed.

B15 · 08 / 08What expected result distinguishes the reference and changed trials in Local IoT dApp and contract acceptance?Reveal explanation
Expected observation

Baseline sequence 1 accepted and digest matches; replay rejected while sequence stays 1; revoked/unregistered writers cannot advance state.

Loading experiment-specific apparatus…
Previous model / additional reference tools
Simulation task

Trace a fictional sensor record into a local EVM transaction, verify receipt and event fields, and test access and replay invariants.

Explore the model using its own controls. Record a prediction before changing a condition. Compare the reference with a changed condition, then use the Experiment tab for the procedure, acceptance criteria and notebook. Model outputs and physical observations must remain separate.

Interactive engineering workbenchB15 · Existing model
Interactive workbench

Predict, configure and observe

Loading executable simulation…

B15 · Model-linked instrumentation

Visual observation lens

Back to controls ↑

Readout from the original computational model; not physical measurements.

Loading instrument…

Awaiting model display.

Experimental instrumentation · A/B

Compare two model conditions

Capture a baseline, change one experimental condition, run the model if required and capture the comparison. Snapshots contain visible controls and display text, not physical sensor readings. Review before exporting.

Open simulation view
Baseline A
Not captured
Comparison B
Not captured

Capture a baseline to begin.

Evidence portfolio →
V19.0 · Contextual AI workspace

Ask your engineering assistants

B15 · current context

Ask Dr. Mohammad locally, or prepare an experiment-aware prompt for ChatGPT, Gemini or Claude. The external providers open in their own tabs; nothing is automatically submitted.

Dr. Mohammad · offline
Dr. Mohammad

Offline curriculum-grounded assistance.

Open local tutor
Local IoT dApp and contract acceptance

Public course objective, displayed commands, source excerpts and procedure. Private assessment content is not collected.

Prepare a contextual AI prompt

0 characters

Common secret and email patterns are redacted on preparation; this is not a comprehensive privacy filter. Review the entire editable prompt, including student work and unpublished research, before sharing. The providers apply their own accounts, privacy settings and limits.

Prepare → review → copy & open your selected provider → paste and submit there.

Independent theoretical exercises

Before the simulation or practical, solve both experiment-specific tasks. List the given inputs, show the intermediate calculation or state trace, identify the expected observation, and state a limitation. Show formulas and intermediate calculations where relevant, or draw the requested state/sequence diagram. These are independent classroom fixtures; where they differ from the reference configuration below, do not treat them as measured values. Compare your predictions with the corresponding experiment afterwards.

01 · Predict and derive using the given inputs

Draw the end-to-end record→digest→transaction→event→state path with identifiers at each stage.

02 · Compare or justify using evidence

Construct acceptance cases for authorized fresh, unauthorized, replay and mismatched retrieval; predict which must fail and what state must remain unchanged.

03 · Architecture analysis

Architecture analysis · Independent work

A signed fresh record is committed successfully, then retrieved with a modified payload and a valid receipt. Identify failing stage and what to preserve.

Work is saved locally when browser storage is available. Export it for submission; no remote upload or automatic grade is assigned.

Expanded independent theoretical exercise bank

Progress from calculation and interpretation to diagnosis and controlled engineering design. Complete the questions without opening the simulation first; show intermediate steps.

Intermediate · Explain a changed-input result

Independent theoretical exercise · B15-01

Use the reference configuration (Contract scenario = none), but change Contract scenario = revoked. The model reports First anchor = Rejected. Explain the governing rule and assumptions that make this output plausible; identify an independent verification method.

Intermediate · Interpret a state transition

Independent theoretical exercise · B15-02

The reference model reports First anchor: Accepted. Under Contract scenario = revoked it reports Rejected. Explain which configured condition changed and what the two outputs establish, and what they do not establish.

Intermediate · Interpret a technical trace

Independent theoretical exercise · B15-03

For Contract scenario = replay, the model supplies this excerpt from Calculated trace: Item · Value · Explanation owner / enable · Accepted in model · sensor / anchor · Accepted in model · sensor / anchor · InvalidSequence · Count rows whose Value value is exactly “Accepted in model”, and identify the displayed row numbers. Explain what the count describes.

Advanced · Reverse reasoning

Independent theoretical exercise · B15-04

An observation is Last decision = InvalidSequence. Candidate A uses Contract scenario = none. Candidate B changes the listed settings (Contract scenario = replay) and keeps the remaining settings fixed. Which is consistent with the observation? If both can explain it, say what additional evidence is required.

Advanced · Diagnose a reported mismatch

Independent theoretical exercise · B15-05

A student configures Contract scenario = replay while preserving all other reference settings, but copies the reference report of Last decision = Accepted in model. Evaluate whether the report is justified. Identify the first configuration/output check to perform.

Challenging · Design a controlled verification

Independent theoretical exercise · B15-06

Design a controlled comparison for Local IoT dApp and contract acceptance using reference Contract scenario = none and test Contract scenario = revoked. Specify the changed setting(s), measured metric First anchor, controls, repetitions, an acceptance check and what evidence can distinguish an actual implementation from the model.

Step-by-step experimental procedure

Trace a fictional sensor record into a local EVM transaction, verify receipt and event fields, and test access and replay invariants.

1 · Reference workbench configuration

Use the named reference workbench and its reference inputs. Additional live instruments may have different controls; use the matching instrument. Record virtual and practical results separately.

Contract scenarionone

2 · Perform the investigation in order

  1. Complete B04–B07 and B10–B13. Run each model scenario separately; note that each begins with a fresh state. Save baseline and compare negative controls.
  2. From the extracted portal root in Ubuntu WSL (not browser terminal), run node --version (20 or newer), npm --version. If absent install Node.js from a trusted supported distribution; follow its official installation instructions. Enter cd blockchain, run npm install and npm ls --depth=0. Expected solc 0.8.28, ethers 6.13.5, ganache 7.9.2. Initial download requires internet.
  3. Run npm run test:advanced. Expected 13 passing named checks, including actual RoleRegistry and BatchAnchor controls, the gateway digest, receipt/event fields and replay rejection. It writes advanced-evm-evidence.json in the current directory; archive it before rerunning. If installation or compilation fails, record the error and mark blocked/failed as appropriate.
  4. For the automated verification center, return to portal root (cd ..) and run python3 verification/runner.py --profile advanced-blockchain --output advanced-evidence.json. The model and Python checks can pass independently of the EVM dependency gate. Import the report and preserve actual receipts.
  5. Compare actual receipt status, contract state, event device/sequence/digest and the Python fixture. No public chain or hardware is needed. This is a local CLI dApp demonstration; a physical gateway and production web frontend are future integration work.

3 · Compare controlled trials

TrialIndependent changeExpected checkObservation
ReferenceUse reference inputs aboveBaseline sequence 1 accepted and digest matches; replay rejected while sequence stays 1; revoked/unregistered writers cannot advance state.Record actual result
Controlled changeContract scenario = replayBaseline sequence 1 accepted and digest matches; replay rejected while sequence stays 1; revoked/unregistered writers cannot advance state.Record actual result

4 · Analyze and report

Offline state machine is not Ethereum. Optional actual in-process Ganache uses test accounts and no public RPC, real funds, hardware or wallet keys.

Required evidence: Record the local iot dapp and contract acceptance comparison and justify the changed outcome from the calculated trace.

Model boundary: Offline state machine is not Ethereum. Optional actual in-process Ganache uses test accounts and no public RPC, real funds, hardware or wallet keys.

Controlled investigation · reproducible evidence

Method. Use the existing reference workbench configuration and the named controlled changes below. A controlled variable stays fixed while the independent variable is intentionally changed; the dependent variable is the resulting observed output. First predict each trial from the Concepts page. Run the baseline, then change only the specified setting and record the outcome. For deterministic traces one execution per case and a repeated verification are sufficient; for timing or stochastic measurements repeat at least five times, recording each run, median and range. Reset to the reference state between independent comparisons.

TrialIndependent changeDependent observation
ReferenceUse reference inputs aboveRecord actual outcome and units
Controlled changeContract scenario = replayRecord actual outcome and units

Evidence: attach the completed comparison table, one trace or screenshot per condition, and actual practical terminal/hardware evidence where applicable. Explain any prediction mismatch and distinguish modeled behavior from measured results.

Loading laboratory-specific procedure…

Complete practical procedure & acceptance

✓ Expected baseline and controlled change: Baseline sequence 1 accepted and digest matches; replay rejected while sequence stays 1; revoked/unregistered writers cannot advance state.

  1. Complete B04–B07 and B10–B13. Run each model scenario separately; note that each begins with a fresh state. Save baseline and compare negative controls.
  2. From the extracted portal root in Ubuntu WSL (not browser terminal), run node --version (20 or newer), npm --version. If absent install Node.js from a trusted supported distribution; follow its official installation instructions. Enter cd blockchain, run npm install and npm ls --depth=0. Expected solc 0.8.28, ethers 6.13.5, ganache 7.9.2. Initial download requires internet.
  3. Run npm run test:advanced. Expected 13 passing named checks, including actual RoleRegistry and BatchAnchor controls, the gateway digest, receipt/event fields and replay rejection. It writes advanced-evm-evidence.json in the current directory; archive it before rerunning. If installation or compilation fails, record the error and mark blocked/failed as appropriate.
  4. For the automated verification center, return to portal root (cd ..) and run python3 verification/runner.py --profile advanced-blockchain --output advanced-evidence.json. The model and Python checks can pass independently of the EVM dependency gate. Import the report and preserve actual receipts.
  5. Compare actual receipt status, contract state, event device/sequence/digest and the Python fixture. No public chain or hardware is needed. This is a local CLI dApp demonstration; a physical gateway and production web frontend are future integration work.
  6. Export observed evidence, restore baseline and record limitations. Do not treat browser-model output as actual hardware or EVM evidence.

Experimental notebook

Record your own results. Values are not prefilled or independently verified.

Solidity source

Download TelemetryAnchor.sol · Open Remix IDE

SOLIDITY · Source code
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
/// @notice Store only a digest and monotonic sequence, never raw private telemetry.
/// A commitment proves equality with supplied bytes, not truth of sensor measurements.
contract TelemetryAnchor {
    address public immutable owner;
    mapping(address => bool) public active;
    mapping(address => uint64) public lastSequence;
    mapping(address => bytes32) public lastDigest;
    event DeviceStatus(address indexed device, bool enabled);
    event Anchored(address indexed device, uint64 sequence, bytes32 digest);
    error NotOwner();
    error InvalidDevice();
    error Unauthorized();
    error InvalidSequence();
    error EmptyDigest();
    constructor() { owner = msg.sender; }
    function setDevice(address device, bool enabled) external {
        if (msg.sender != owner) revert NotOwner();
        if (device == address(0)) revert InvalidDevice();
        active[device] = enabled;
        emit DeviceStatus(device, enabled);
    }
    function anchor(uint64 sequence, bytes32 digest) external {
        if (!active[msg.sender]) revert Unauthorized();
        if (sequence <= lastSequence[msg.sender]) revert InvalidSequence();
        if (digest == bytes32(0)) revert EmptyDigest();
        lastSequence[msg.sender] = sequence;
        lastDigest[msg.sender] = digest;
        emit Anchored(msg.sender, sequence, digest);
    }
    function verifyLatest(address device, uint64 sequence, bytes32 digest) external view returns (bool) {
        return sequence != 0 && lastSequence[device] == sequence && lastDigest[device] == digest;
    }
}

Record & discuss

Notebook exports use related core lab B07; the supplementary ID is retained in the evidence. Technical reference.

Learning progress

Mark complete only after documenting your observations. This is not a verified result or official grade.

View prerequisites and related learning

Python / Google Colab laboratory

B15 · 9 notebook cells · 2 executable Python cells

Complete the theoretical investigation first. Run the cells in order, record actual outputs and compare against your prediction.

How to execute

  1. Download this notebook and open Google Colab. Select File → Upload notebook and choose the downloaded .ipynb.
  2. Read the Markdown instructions before each executable cell. Use a Python runtime, run cells from top to bottom, and resolve imports if necessary.
  3. Perform the baseline and controlled changes. Save the notebook with actual outputs and your written interpretation.

Execution scope: 8°C is a teaching threshold, not a universal food-safety standard. Hashes cannot establish actual temperature or physical custody. Default computational cells passed isolated local Python execution; physical equipment and live services require separate verification.

01Instructions · Markdown
# B15 · Local IoT dApp and contract acceptance **PSUT IoT Engineering Studio — Dr. Mohammad Alja’afreh** ## 1. Scientific objective Trace a fictional sensor record into a local EVM transaction, verify receipt and event fields, and test access and replay invariants. Complete the analytical worksheet in the portal first. Record your predictions before running this notebook. This notebook is a bounded local computational investigation; use the portal’s separate WSL, hardware or Remix procedure for real interfaces.
02Instructions · Markdown
## Experiment-specific preparation Trace a fictional sensor record into a local EVM transaction, verify receipt and event fields, and test access and replay invariants. **Reference procedure (use the matching simulator/WSL tool where named, not an unrelated service):** 1. Complete B04–B07 and B10–B13. Run each model scenario separately; note that each begins with a fresh state. Save baseline and compare negative controls. 2. From the extracted portal root in Ubuntu WSL (not browser terminal), run node --version (20 or newer), npm --version . If absent install Node.js from a trusted supported distribution; follow its official installation instructions. Enter cd blockchain , run npm install and npm ls --depth=0 . Expected solc 0.8.28, ethers 6.13.5, ganache 7.9.2. Initial download requires internet. 3. Run npm run test:advanced . Expected 13 passing named checks, including actual RoleRegistry and BatchAnchor controls, the gateway digest, receipt/event fields and replay rejection. It writes advanced-evm-evidence.json in the current directory; archive it before rerunning. If installation or compilation fails, record the error and mark blocked/failed as appropriate. 4. For the automated verification center, return to portal root ( cd .. ) and run python3 verification/runner.py --profile advanced-blockchain --output advanced-evidence.json . The model and Python checks can pass independently of the EVM dependency gate. Import the report and preserve actual receipts. 5. Compare actual receipt status, contract state, event device/sequence/digest and the Python fixture. No public chain or hardware is needed. This is a local CLI dApp demonstration; a physical gateway and production web frontend are future integration work. **Evidence:** An accepted reading above 8°C raises the declared teaching-policy warning. Offline delivery does not create a commitment. Altered bytes do not match an accepted digest. **Boundary:** 8°C is a teaching threshold, not a universal food-safety standard. Hashes cannot establish actual temperature or physical custody.
03Instructions · Markdown
## 2. Reference configuration and investigation 1. Complete B04–B07 and B10–B13. Run each model scenario separately; note that each begins with a fresh state. Save baseline and compare negative controls. 2. From the extracted portal root in Ubuntu WSL (not browser terminal), run node --version (20 or newer), npm --version . If absent install Node.js from a trusted supported distribution; follow its official installation instructions. Enter cd blockchain , run npm install and npm ls --depth=0 . Expected solc 0.8.28, ethers 6.13.5, ganache 7.9.2. Initial download requires internet. 3. Run npm run test:advanced . Expected 13 passing named checks, including actual RoleRegistry and BatchAnchor controls, the gateway digest, receipt/event fields and replay rejection. It writes advanced-evm-evidence.json in the current directory; archive it before rerunning. If installation or compilation fails, record the error and mark blocked/failed as appropriate. 4. For the automated verification center, return to portal root ( cd .. ) and run python3 verification/runner.py --profile advanced-blockchain --output advanced-evidence.json . The model and Python checks can pass independently of the EVM dependency gate. Import the report and preserve actual receipts. 5. Compare actual receipt status, contract state, event device/sequence/digest and the Python fixture. No public chain or hardware is needed. This is a local CLI dApp demonstration; a physical gateway and production web frontend are future integration work. Run cells in order; do not substitute model results for physical measurements.
04Instructions · Markdown
## 3. Represent receipt and indexer state separately.
05Python · executable cell
PYTHON · Code cell
# =====================================================================
# B15 | Code cell 01 | Local IoT dApp and contract acceptance
# Purpose: 3. Represent receipt and indexer state separately.
# Inputs: the explicit fixture/settings below and any preceding cell state.
# Output: inspect printed values, returned records or assertions; record evidence.
# =====================================================================
# Define the reusable operation process; keep its logic separate from the trial.
def process(seq, receipt, event, old_state=1, old_index=1):
    state=seq if receipt=="success" and seq>old_state else old_state
    index=state if event and receipt=="success" else old_index
    return state,index
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert process(2,"success",True)==(2,2)
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert process(2,"success",False)==(2,1)
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert process(2,"reverted",False)==(1,1)
Ask Dr. Mohammad about this cell
06Instructions · Markdown
## 4. Reconcile missing events and ignore duplicates. This is not a deployed EVM.
07Python · executable cell
PYTHON · Code cell
# =====================================================================
# B15 | Code cell 02 | Local IoT dApp and contract acceptance
# Purpose: 4. Reconcile missing events and ignore duplicates. This is not a deployed EVM.
# Inputs: the explicit fixture/settings below and any preceding cell state.
# Output: inspect printed values, returned records or assertions; record evidence.
# =====================================================================
# Set (state, index) for the next computation or reference condition.
state,index=process(2,"success",False)
# Set index for the next computation or reference condition.
index=state # independent authorized state query in model
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert (state,index)==(2,2)
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert process(2,"success",True,state,index)==(2,2)
Ask Dr. Mohammad about this cell
08Instructions · Markdown
## Experimental analysis and submission 1. Record the reference input, predicted output and actual result. 2. Modify one independent variable and run the relevant cells again. 3. Explain the result using the theory and identify model limitations. 4. Save the notebook with outputs and retain the separate theoretical worksheet. **Your derivation and conclusion:** (Complete independently.)
09Instructions · Markdown
## Guided reasoning and evidence A controlled comparison changes one independent input while keeping the other relevant inputs fixed; the dependent variable is the recorded output. Use this lab’s reference condition above. **Independent task:** 2. From the extracted portal root in Ubuntu WSL (not browser terminal), run node --version (20 or newer), npm --version . If absent install Node.js from a trusted supported distribution; follow its official installation instructions. Enter cd blockchain , run npm install and npm ls --depth=0 . Expected solc 0.8.28, ethers 6.13.5, ganache 7.9.2. Initial download requires internet. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat. | Trial | Input/configuration | Prediction | Observation | Evidence / limitation | |---|---|---|---|---| | A | Reference | | | | | B | Changed input | | | | | A repeat | Reference | | | | A conclusion is supported only when it cites the recorded values or observed states and explains them with the experiment theory.
Shared research workbenches · network designer & advanced studies
Concurrent-device simulation & Monte Carlo research
Distributed digital twin · topology, protocol & battery research