Skip to content

add node registrar client #7

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

Merged
merged 27 commits into from
Mar 20, 2025

Conversation

Eslam-Nawara
Copy link
Collaborator

@Eslam-Nawara Eslam-Nawara commented Feb 19, 2025

Description

add node registrar client

Changes

List of changes this PR includes

Related Issues

Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstring

@Eslam-Nawara Eslam-Nawara force-pushed the development-add-node-registrar-client branch from 45455c2 to 7ceeea7 Compare February 20, 2025 09:50
@Eslam-Nawara Eslam-Nawara force-pushed the development-add-node-registrar-client branch 5 times, most recently from c27651f to c74f8eb Compare February 26, 2025 19:56
return errors.Wrap(err, "failed to parse request body")
}

req, err := http.NewRequest("PATCH", url, &body)

Choose a reason for hiding this comment

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

why using patch here? we r updating one account

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

patch method in http request is used for making partial changes to an existing resource.

}

func (c *RegistrarClient) updateAccount(opts []UpdateAccountOpts) (err error) {
err = c.ensureTwinID()

Choose a reason for hiding this comment

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

ensure account creates account if it doesn't exist, while i believe update on none existing account should fail

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this function call here is ensureTwin not ensureAccount, it ensures that the registrar client is set up probably with a valid account, it doesn't create account if not exist.

Eslam-Nawara and others added 5 commits March 9, 2025 15:51
* support mnemonics in registrar client

* fix drive keys from seed

* update registrar client readme file

* remove extra print lines

* remove extra comments

* lower case error messages
@Eslam-Nawara Eslam-Nawara force-pushed the development-add-node-registrar-client branch from 9d8b469 to 7908c98 Compare March 9, 2025 13:52
@Eslam-Nawara Eslam-Nawara force-pushed the development-add-node-registrar-client branch from 513a105 to 3eb0fb7 Compare March 10, 2025 14:23

data := map[string]any{
"public_key": c.keyPair.Public(),
"signature": signature,
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't signature be encoded in base64?

@Eslam-Nawara Eslam-Nawara merged commit 4d8c2e9 into development Mar 20, 2025
4 checks passed
@Eslam-Nawara Eslam-Nawara deleted the development-add-node-registrar-client branch March 20, 2025 14:46
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