Skip to content

Commit 0b03626

Browse files
committed
fix: configuration and cli arguments for examples
- Rename arguments for registration example from reg_folder to certDir. - Change registration configuration key from deviceId to device_id. - Update JSON encoding/decoding to use snake case keys for device configurations.
1 parent c3e107e commit 0b03626

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

etx/examples/node/src/0_registration_example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async function main() {
6363
// 7. Prepare the "Frozen Bundle" (Identity Artifact)
6464
const frozenBundle = {
6565
registration: {
66-
deviceId: regResp.deviceId,
66+
device_id: regResp.deviceId,
6767
certificate: {
6868
// Convert Date back to string for JSON persistence
6969
expiration_time: regResp.certificate.expirationTime.toISOString(),

etx/examples/node/src/1_deregistration_example.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ async function main() {
3434
logger.setLevel(config.logLevel);
3535

3636
// Extract device ID from the registration block
37-
deviceId = artifact.registration.deviceId;
37+
deviceId = artifact.registration.device_id;
38+
if (!deviceId) {
39+
throw new Error("Device ID is undefined.")
40+
}
3841

3942
} catch (error: any) {
4043
console.error(`CRITICAL: Failed to load device artifact: ${error.message}`);

etx/examples/python/src/examples/utils/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def load_config(config_source: Union[str, Path], args: Optional[argparse.Namespa
122122
config.logLevel = args.loglevel.upper()
123123

124124
if getattr(args, 'certDir', None):
125-
config.certDir = args.reg_folder
125+
config.certDir = args.certDir
126126

127127
if getattr(args, "lat", None):
128128
config.identity.attributes.location.lat = args.lat

0 commit comments

Comments
 (0)