Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripts to automate the AML and TAA registration and update process #232

Merged
merged 2 commits into from
Sep 7, 2022

Conversation

WadeBarnes
Copy link
Member

@WadeBarnes WadeBarnes commented Aug 24, 2022

Signed-off-by: Wade Barnes wade@neoterictech.ca

@WadeBarnes WadeBarnes marked this pull request as ready for review August 28, 2022 12:56
@WadeBarnes WadeBarnes requested a review from ianco August 28, 2022 12:56
manage Show resolved Hide resolved
@swcurran
Copy link
Contributor

With that command, I get an error on a Mac, works on Linux.

@WadeBarnes
Copy link
Member Author

WadeBarnes commented Aug 29, 2022

The syntax on Mac is different. It's will be something like:

date -jf "%Y-%m-%dT%H:%M:%S%Z" "2022-08-09T11:05:00-0700" +%s

Would one of you be able to confirm?

@ianco
Copy link
Contributor

ianco commented Aug 29, 2022

date -jf "%Y-%m-%dT%H:%M:%S%Z" "2022-08-09T11:05:00-0700" +%s

$ date -jf "%Y-%m-%dT%H:%M:%S%Z" "2022-08-09T11:05:00-0700" +%s
Failed conversion of ``2022-08-09T11:05:00-0700'' using format ``%Y-%m-%dT%H:%M:%S%Z''
date: illegal time format
usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]

Let me play around with it a bit ...

@ianco
Copy link
Contributor

ianco commented Aug 29, 2022

This works, I think it automatically picks up the local timezone:

date -j -f "%Y-%m-%dT%H:%M:%S" "2022-08-09T11:05:00" +%s

@WadeBarnes
Copy link
Member Author

It would be nice to be able to specify the actual time offset since the ratification time and the person running the script may not be in the same time zone.

Signed-off-by: Wade Barnes <wade@neoterictech.ca>
@WadeBarnes
Copy link
Member Author

Looks like Z% for the MAC command needs to be an alphabetic time zone abbreviation.

So something like this should work:
date -jf "%Y-%m-%dT%H:%M:%S %Z" "2022-08-09T11:05:00 PDT" +%s

Expected result is 1660068300

@ianco, would you be able to try this out when you have a moment?

@swcurran
Copy link
Contributor

swcurran commented Sep 6, 2022

Works for Mac, not for Linux/gitBash (as expected...).

@WadeBarnes
Copy link
Member Author

Turns out Linux (and Git Bash) can use the "%Y-%m-%dT%H:%M:%S %Z" format without complaint too. So I've updated the script to support Mac and updated the example and docs to use the the "%Y-%m-%dT%H:%M:%S %Z" date format.

manage Outdated Show resolved Hide resolved
manage Outdated Show resolved Hide resolved
- Add Mac compatible taa ratification timestamp conversion.
- Update AML content parsing for Mac

Co-authored-by: Ian Costanzo <ian@anon-solutions.ca>
Signed-off-by: Wade Barnes <wade@neoterictech.ca>
@WadeBarnes
Copy link
Member Author

WadeBarnes commented Sep 7, 2022

Code updated based on @ianco's review.

Copy link
Contributor

@ianco ianco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added local file ./tmp/cliconfig.json

./manage cli init-pool local_net http://host.docker.internal:9000/genesis

./manage indy-cli create-wallet walletName=local_net_trustee_wallet

./manage apply-taa walletName=local_net_trustee_wallet poolName=local_net useDid=V4SGRU86Z58d6TV7PBUe6f amlUrl='https://raw.githubusercontent.com/wiki/bcgov/bc-vcpedia/(Layer-1)-CANdy-Acceptance-Mechanism-List-(AML).md' amlVersion=0.1 taaUrl='https://raw.githubusercontent.com/wiki/bcgov/bc-vcpedia/(Layer-1)-CANdy-Transaction-Author-Agreement.md' taaVersion=0.1 taaRatificationTime="2022-08-09T11:05:00PDT"

@WadeBarnes WadeBarnes merged commit 9a832ca into bcgov:main Sep 7, 2022
WadeBarnes added a commit to WadeBarnes/von-network that referenced this pull request Aug 28, 2024
Add scripts to automate the AML and TAA registration and update process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants