Closed nedgar closed 1 year ago
My original intent was to allow --index
and --value
to be given multiple times (well, up to twice each), but the standard Go arg parsing doesn't easily support that, so it's just (max) one of each for now.
@nedgar I wonder whether it's more intuitive to assign the 4 user input fields with distinct names e.g. --indexDataSlotA --indexDataSlotB, etc
@Chengxuan yes, that's doable and I had considered that. I'll Go ahead and make that change.
Another option would be to parse the schema and use its property names, eg --set birthDay 19950401
, but that can be added later. I think the low level slot args are still useful.
@Chengxuan I've updated it to use separate args, as discussed. I also changed --expiryDays
to round to nearest second.
Example output:
> go run main.go claim --issuer JohnDoe --holder 112SXajpU6Snneh5odyxhYsBa1RerKcKP359tgMHp6 --schemaType AgeCredential --indexDataA 19950704 -expiryDays 30 --nonce 2
# command-line-arguments
ld: warning: -no_pie is deprecated when targeting new OS versions
Using:
issuer identity with name: JohnDoe
holder identity: 112SXajpU6Snneh5odyxhYsBa1RerKcKP359tgMHp6
schema file: ./schemas/kyc.json-ld
schema type: AgeCredential
index data: [19950704 <nil>]
value data: [<nil> <nil>]
expiry date: 2023-02-23 12:49:50 -0500 EST
revocation nonce: 2
and:
> go run main.go claim --issuer JohnDoe --holder 112SXajpU6Snneh5odyxhYsBa1RerKcKP359tgMHp6 --schemaType AgeCredential --indexDataA 0xCAFE --indexDataB 0xBABE --valueDataA 19950704 --valueDataB '"Hello world"' --expiry 2023-01-23T12:34:56Z --nonce 2
Using:
issuer identity with name: JohnDoe
holder identity: 112SXajpU6Snneh5odyxhYsBa1RerKcKP359tgMHp6
schema file: ./schemas/kyc.json-ld
schema type: AgeCredential
index data: [51966 47806]
value data: [19950704 1273167712557435731605610182174856580228028615716151467925829928863437938514]
expiry date: 2023-01-23 12:34:56 +0000 UTC
revocation nonce: 2
...
Any feedback on the Go code is welcome. I'm pretty new to it.
@nedgar thanks Nick, going to pull this into main branch so that I can merge with my refactor
For #30 -- issuing various claims. This adds a few command line args, to make it easier to issue various claims against different schema. The KYC schema is still the default.
I've not updated the README yet. Please LMK if this approach looks OK, and I'll be happy to make those updates.
FYI @jimthematrix @Chengxuan