-
Notifications
You must be signed in to change notification settings - Fork 113
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
docs: Update Keychain SDK #706
docs: Update Keychain SDK #706
Conversation
Update go version Update json for keychain-fees Update chain-id
update branch
Add basic info for keychain Implement main func with - handleKeyRequest and handleSignRequest Write test function
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
WalkthroughWalkthroughThe changes introduce the "Keychain SDK" documentation, which includes a structured configuration file, detailed documentation on key modules for cryptographic operations, and a tutorial for building a Keychain Service. The documentation defines several modules, such as Sign Requests, Keychain, Key Requests, Configuration, Transaction Writer, Request Tracker, and Encryption Utilities, facilitating the development of applications that interact with the Warden Protocol. Additionally, the Docusaurus configuration file has been updated to reflect changes in the documentation path. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (18)
docs/developer-docs/docs/build-a-keychain/sdk/keychain-sdk.md (9)
9-9
: Clarify the sentence for better readability.Consider rephrasing the sentence to improve clarity. Here's a suggestion:
"The Keychain SDK provides a comprehensive framework for managing cryptographic operations within the Warden Protocol. It streamlines the development of applications that interact with the Warden Protocol, efficiently and securely handling both key requests and sign requests."
13-13
: Add a closing punctuation mark.The sentence should end with a period.
21-23
: Ensure consistency in method descriptions.The descriptions for the methods in the
SignResponseWriter Interface
should be consistent in style. Consider rephrasing for uniformity:
Fulfil(signature []byte) error
: Writes a signature to fulfill a sign request.Reject(reason string) error
: Writes a rejection message for a sign request.
34-34
: Clarify the purpose statement.Consider rephrasing for clarity:
"Purpose: Manages the central application, coordinating the handling of key and sign requests."
50-50
: Clarify the purpose statement.Consider rephrasing for clarity:
"Purpose: Manages key requests, providing interfaces to fulfill or reject requests for public keys."
67-67
: Clarify the purpose statement.Consider rephrasing for clarity:
"Purpose: Defines the configuration structure for the Keychain SDK, detailing all necessary parameters for application setup."
92-92
: Clarify the purpose statement.Consider rephrasing for clarity:
"Purpose: Manages transaction batching and sending operations."
107-107
: Clarify the purpose statement.Consider rephrasing for clarity:
"Purpose: Tracks processed request IDs to prevent duplicate processing."
121-121
: Clarify the purpose statement.Consider rephrasing for clarity:
"Purpose: Provides encryption utilities for cryptographic operations."
docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md (9)
9-9
: Clarify the sentence for better readability.Consider rephrasing the sentence to improve clarity. Here's a suggestion:
"The Keychain Service is a vital component of the Warden Protocol ecosystem, responsible for managing cryptographic keys and signing operations. Below is a breakdown of its main functions:"
21-21
: Clarify the sentence for better readability.Consider rephrasing the sentence to improve clarity. Here's a suggestion:
"The service is configured to interact with a specific blockchain, identified by the ChainID."
27-27
: Clarify the sentence for better readability.Consider rephrasing the sentence to improve clarity. Here's a suggestion:
"In a production environment, you would need to implement actual key generation and signing logic, integrate with a secure key storage solution, and incorporate more robust error handling and security measures."
96-96
: Add a space after the period.Add a space after the period for consistency and readability.
121-121
: Correct the language for clarity.Consider rephrasing for clarity:
"Next, let's define a Go function called
handleSignRequest
that takes aSignResponseWriter
and aSignRequest
as parameters. It logs the received sign request and then generates a dummy signature. If theFulfil
method of theSignResponseWriter
returns an error, it logs the error and attempts to reject the sign request."
215-215
: Correct the section title for consistency.Consider changing "Creating Test" to "Creating Tests" for consistency with the plural form used in the content.
217-217
: Clarify the sentence for better readability.Consider rephrasing the sentence to improve clarity. Here's a suggestion:
"Now, let's write a test for the functions we previously implemented."
368-368
: Clarify the sentence for better readability.Consider rephrasing the sentence to improve clarity. Here's a suggestion:
"We define mock implementations of
KeyResponseWriter
andSignResponseWriter
for testing purposes."
407-407
: Add a comma for clarity.Consider adding a comma for better readability:
"This tutorial has walked you through creating a basic Keychain Service using the Warden Protocol. You've set up the main application, implemented placeholder handlers for key and sign requests, and created tests to verify the basic functionality."
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (3)
- docs/developer-docs/docs/build-a-keychain/sdk/category.json (1 hunks)
- docs/developer-docs/docs/build-a-keychain/sdk/keychain-sdk.md (1 hunks)
- docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md (1 hunks)
Files skipped from review due to trivial changes (1)
- docs/developer-docs/docs/build-a-keychain/sdk/category.json
Additional context used
Path-based instructions (2)
docs/developer-docs/docs/build-a-keychain/sdk/keychain-sdk.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
Additional comments not posted (2)
docs/developer-docs/docs/build-a-keychain/sdk/keychain-sdk.md (1)
128-134
: Ensure hyperlinks are functional and relevant.Verify that the links provided are correct and lead to the intended resources.
docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md (1)
31-31
: Ensure version consistency.Verify that the Go version mentioned is consistent with the actual requirements and update if necessary.
|
||
// In a real application, you would generate a public key here | ||
// For this example, we'll use a dummy public key | ||
publicKey := []byte("dummy_public_key") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this tx will fail on-chain because there is a check for the length of the public key
2. Add the following code to `main.go` with the skeleton: | ||
|
||
```go | ||
package main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's indent the Go code for readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- docs/developer-docs/docusaurus.config.ts (1 hunks)
Additional comments not posted (1)
docs/developer-docs/docusaurus.config.ts (1)
123-123
: Documentation path updated correctly.The change in the
docId
for the "Keychain SDK" reflects a reorganization of the documentation structure. Ensure that this new path is correctly implemented across the documentation site.The code change is approved.
Run the following script to verify the consistency of the new documentation path:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md (1)
40-199
: Indent the Go code for readability.The instructions and code snippets are clear and easy to follow. However, the Go code should be indented for better readability.
Apply this diff to indent the Go code:
package main import ( "context" "log/slog" "os" "time" "github.com/warden-protocol/wardenprotocol/keychain-sdk" ) func main() { logger := slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{ Level: slog.LevelDebug, })) app := keychain.NewApp(keychain.Config{ Logger: logger, ChainID: "warden", GRPCURL: "localhost:9090", GRPCInsecure: true, KeychainID: 1, Mnemonic: "zebra future seed foil jungle eyebrow rubber spatial measure auction unveil blue toy good lift audit truth obvious voyage inspire gold rule year canyon", DerivationPath: "m/44'/118'/0'/0/0", GasLimit: 400000, BatchInterval: 8 * time.Second, BatchSize: 10, }) app.SetKeyRequestHandler(handleKeyRequest) app.SetSignRequestHandler(handleSignRequest) if err := app.Start(context.Background()); err != nil { logger.Error("application error", "error", err) os.Exit(1) } } func handleKeyRequest(w keychain.KeyResponseWriter, req *keychain.KeyRequest) { logger := slog.Default() logger.Info("received key request", "id", req.Id, "key_type", req.KeyType) // In a real application, you would generate a public key here // For this example, we'll use a dummy public key publicKey := []byte("dummy_public_key") if err := w.Fulfil(publicKey); err != nil { logger.Error("failed to fulfill key request", "error", err) if err := w.Reject("Internal error"); err != nil { logger.Error("failed to reject key request", "error", err) } } } func handleSignRequest(w keychain.SignResponseWriter, req *keychain.SignRequest) { logger := slog.Default() logger.Info("received sign request", "id", req.Id, "key_id", req.KeyId) // In a real application, you would sign the data here // For this example, we'll use a dummy signature signature := []byte("dummy_signature") if err := w.Fulfil(signature); err != nil { logger.Error("failed to fulfill sign request", "error", err) if err := w.Reject("Internal error"); err != nil { logger.Error("failed to reject sign request", "error", err) } } }Tools
Markdownlint
107-107: null
Spaces inside code span elements(MD038, no-space-in-code)
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- docs/developer-docs/docs/build-a-keychain/sdk/keychain-sdk.md (1 hunks)
- docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- docs/developer-docs/docs/build-a-keychain/sdk/keychain-sdk.md
Additional context used
Path-based instructions (1)
docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
Markdownlint
docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md
107-107: null
Spaces inside code span elements(MD038, no-space-in-code)
Additional comments not posted (6)
docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md (6)
1-13
: LGTM!The front matter and overview section are correctly formatted and provide necessary context.
The code changes are approved.
15-19
: LGTM!The prerequisites section is clear and concise.
The code changes are approved.
21-38
: LGTM!The instructions for setting up the project are clear and easy to follow.
The code changes are approved.
201-349
: LGTM!The instructions for creating a test file and the code snippets are clear and easy to follow.
The code changes are approved.
360-389
: LGTM!The instructions for running the tests and the expected output are clear and easy to follow.
The code changes are approved.
391-395
: LGTM!The conclusion is well-written and provides a good summary of the tutorial.
The code changes are approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md (1 hunks)
Additional context used
Path-based instructions (1)
docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
Markdownlint
docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md
107-107: null
Spaces inside code span elements(MD038, no-space-in-code)
Additional comments not posted (9)
docs/developer-docs/docs/build-a-keychain/sdk/tutorial.md (9)
1-5
: LGTM!The front matter and title are correct.
7-13
: LGTM!The overview section is clear and informative.
15-19
: LGTM!The prerequisites section is clear and concise.
21-38
: LGTM!The setup instructions are clear and correct.
42-80
: Indent the Go code for readability.The Go code should be properly indented for better readability.
82-86
: Summarize and reword this paragraph.This paragraph is very wordy and can be summarized for better readability.
127-199
: Fix the closing of the function.The function should be closed with
}
without)
.
201-349
: LGTM!The test code is correct and comprehensive.
351-395
: LGTM!The conclusion and running tests sections are clear and informative.
@Pitasi - Rita has addressed most of your concerns. I would like to Merge this PR & then shuffle the content placement categories. |
* chore(wardend): bump ibc-go to v8.4.0 * docs: Update Keychain SDK (#706) * Upgrade keychain docs Update go version Update json for keychain-fees Update chain-id * Add categorization to Keychain SDK * Categorization * Add Keychain SDK + Description * Create a new tutorial Add basic info for keychain Implement main func with - handleKeyRequest and handleSignRequest Write test function * fixed a link in the Tools menu * quick fixes * quick fixes * quick fixes * remove ) --------- Co-authored-by: Margarita Skomorokh <ijonele@gmail.com> * fixed links to the keychain sdk (#733) --------- Co-authored-by: Antonio Pitasi <antonio@pitasi.dev> Co-authored-by: Margarita Skomorokh <ijonele@gmail.com> Co-authored-by: Margarita Skomorokh <margaret.skomorokh@anychart.com>
* Upgrade keychain docs Update go version Update json for keychain-fees Update chain-id * Add categorization to Keychain SDK * Categorization * Add Keychain SDK + Description * Create a new tutorial Add basic info for keychain Implement main func with - handleKeyRequest and handleSignRequest Write test function * fixed a link in the Tools menu * quick fixes * quick fixes * quick fixes * remove ) --------- Co-authored-by: Margarita Skomorokh <ijonele@gmail.com>
…dd-genesis-space (#723) * validate bench32 in cmd add-genesis-keychain add-genesis-space * in executeAnalyzers return error on bad contract address (#716) * in executeAnalyzers return error on bad contract address * update changelog * validate bench32 in cmd add-genesis-keychain add-genesis-space * fix spelling and duplicates * * Added KeybaseId, Url and Name fields to keychain * Added changelog * Review comments * Code review fixes * Regenerated model --------- Co-authored-by: Archie <artur.abliazimov@gmail.com> * Fix of localnet.just (#726) * Fixed localnet.just * Fixed localnet.just * Remove the GMP default params from genesis (#727) * feat(faucet): new faucet (#479) * feat(faucet): new faucet This version of the Faucet does not have any limitations per user, only limitations are daily token supply * fix: minor css changes for mobile * fix(faucet): add daily refresh and token refresh job * fix(faucet): fix bugs and ci * fix(faucet): remove unnessary go.mod files, replace dockerfile faucet-v2 * chore(faucet): remove unnessary variables and modify types this will modify the types of DailyLimit and Batchinterval to remove unnessary conversions and remove Cooldown and BatchInterval * fix(faucet): acquire a lock when setting the new supply * fix(faucet): removed locking where it's not needed other enhancements as well, the loading and setting context to correct place * fix(faucet): converted background to much smaller image * feat(faucet): make the run out of daily nicer * feat(faucet): add new style * feat(faucet): add check that same address cannot be multiple time in one batch * feat(faucet): add metrics * fix(faucet): Dockerfile libwasmvm was missing access rights * feat(faucet): add pre input option to address form --------- Co-authored-by: Jon Heywood <94459819+jjheywood@users.noreply.github.com> * chore(wardend): bump ibc-go to v8.4.0 * docs: Update Keychain SDK (#706) * Upgrade keychain docs Update go version Update json for keychain-fees Update chain-id * Add categorization to Keychain SDK * Categorization * Add Keychain SDK + Description * Create a new tutorial Add basic info for keychain Implement main func with - handleKeyRequest and handleSignRequest Write test function * fixed a link in the Tools menu * quick fixes * quick fixes * quick fixes * remove ) --------- Co-authored-by: Margarita Skomorokh <ijonele@gmail.com> * fixed links to the keychain sdk (#733) * Made KeychainFees = nil invalid * ci: add check to ensure go.mod is tidy * chore: go mod tidy * fix(wardend): ICAHostKeeper initialization requires QueryRouter to be set Breaking change introduced in ibc-go v8.3 * feat(spaceward): key creation in sidebar (#728) * fix key icon in sidebar cleanup * fix getProider call * bump ethers version; fix erc20 send * build: use new justfile commands * fix(x/warden): make KeychainFees non-nullable * fix(x/warden): allow empty KeychainFees * cosmoshubtestnet hotfix; do not fail on wrong message type (#746) * feat(faucet): configurable chain name (#747) this change adds configurable chain/faucet name to the site * fix(faucet): chain variable missing from struct (#749) This PR adds the missing Chain variable that missed in #747 * #561 Keychain fees should not be paid in advance (#662) * Added keychain max wanted fees handling * Implemented new testcase & snapshot * Added annotations * Added keychain fee max value specification * Code review fixes * Changed validation messages * fix(x/act): add support for sdk.Coins in CLI flags * Changed type to sdk.Coin * Updated CHANGELOG.md * Implemented escrow accounts for keychain fees * Added CHANGELOG.md line * Regenerated keychain snapshot * Updated keychain deduction fee code * Added test case for fee deduction with --max-keychain-fee * Fixed actions auto parsing for cli * Fixed bug with not forking fees deduction and context missing values * Docker versions update * Update cmd/wardend/cmd/gen-keychains.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Proto rebuild * Merged changes from #560 * Code-review fixes * Implemented integration test for escrow account * Code review fixes * Made KeychainFees = nil invalid * Fixed error message * Keychain fee validations * Code review fixes * Merge conflict fixes * Lint fixes --------- Co-authored-by: Antonio Pitasi <antonio@pitasi.dev> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat(spaceward): update for rebrand (#748) * feat(spaceward): New theme added * fix(spaceward): Some theme fixes * fix(spaceward): Fixed keychains * fix(spaceward): Some theme fixes and metamask * fix(spaceward): Some more * fix(spaceward): Space Mono * fix(spaceward): fix for space mono font issue (#750) * fix(spaceward): updated welcome message (#751) * fix(faucet): fix daily limit i64 (#755) This fixes issue where user puts high uward amount to daily limit and go cannot parse it due to int restrictions * Add chain upgrade instructions for v0.4.2 (#757) * Add chain upgrade instructions for v0.4.2 * Update v0.4.2.md * update v0.4.2 Co-authored-by: Joonas Lehtimäki <joonas.lehtimaki@gmail.com> * remove reference to side-car --------- Co-authored-by: Joonas Lehtimäki <joonas.lehtimaki@gmail.com> * fixed spelling (#758) * fixed spelling * deleted the tip, fixed spelling * update slinky * fix(x/act): simplify prepareHandlerContext to always use sdk.Context * updated gov proto; fix governance types (#761) * Fix returned field (#765) * fix(spaceward): Fix logos (#767) * fix(spaceward): Fix logos * fix(spaceward): updated logo for WC connection and updated hover fill colour --------- Co-authored-by: Jon Heywood <94459819+jjheywood@users.noreply.github.com> * fix(faucet): tx page loading (#768) * feat(faucet): add new metric dailySupply * fix(faucet): page keeps loading even if tx was finished --------- Co-authored-by: backsapc <backsapce@hotmail.com> Co-authored-by: Archie <artur.abliazimov@gmail.com> Co-authored-by: Joonas Lehtimäki <joonas.lehtimaki@gmail.com> Co-authored-by: Jon Heywood <94459819+jjheywood@users.noreply.github.com> Co-authored-by: Antonio Pitasi <antonio@pitasi.dev> Co-authored-by: Aliasgar Merchant <44069404+alijnmerchant21@users.noreply.github.com> Co-authored-by: Margarita Skomorokh <ijonele@gmail.com> Co-authored-by: Margarita Skomorokh <margaret.skomorokh@anychart.com> Co-authored-by: Alex D <alex.d.nax@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Alice <37526212+laniakea42@users.noreply.github.com> Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
Summary by CodeRabbit
New Features
Documentation