-
Notifications
You must be signed in to change notification settings - Fork 14
Add Comprehensive Developer Guides and Best Practices #126
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
base: main
Are you sure you want to change the base?
Add Comprehensive Developer Guides and Best Practices #126
Conversation
gblend @ypszn and thank you for your contribution, I will have to take a closer look at this when I have some bandwidth. will keep you posted |
🔄 @tmsdkeys triggered a preview deployment for PR #126 at commit 🚀 Deployment starting... |
gblend @tmsdkeys. okay, no problem |
@ypszn does not have sufficient permissions to trigger deployments. |
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've made a first round of reviews here. A couple of high-level notes:
- I'll add this more specifically to the contribution guidelines, but for features additions like this it would have been good to add an issue first to discuss scope of the addition to avoid redundant work
- Can I ask if this was generated with the help of AI tools? Seems like some of the code here was hallucinated... I think it's fine to leverage AI tools (we do internally) but it would be good to: 1) make a mention of this and 2) review everything personally before submitting
In general, I am in favour of adding common-patterns and troubleshooting sections but arguably the common patterns would be better situated in the Fluentbase SDK section (I would refer to external sources for Solidity best practices and common patterns). The troubleshooting guide does make sense to me as a guide and is a good extension of the gblend troubleshooting section.
As mentioned in a comment, the guide with the Hybrid Token Exchange is something we're working on in the Fluent workshop series https://github.com/tmsdkeys/fluent-workshop-series and I am inclined to use that as canonical version, however I suggested adding your project as a community contribution in awesome-fluent.
In conclusion, for next steps:
- Please make requested changes + testing to common-patterns and we can see if it makes sense as a guide or move it around
- Please make revision to troubleshooting-guide.md
- Please migrate the token exchange guide to its own project repo and open a PR in awesome-fluent.
Thanks again for your contribution!
} | ||
``` | ||
|
||
### Solidity Error Handling |
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.
Not sure if I'd want to add this here. There are better resources out there to learn about Solidity best practices
|
||
### Rust Contract Optimization | ||
|
||
#### 1. Efficient Storage Patterns |
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.
These are not the canonical way to manage storage with the Fluentbase SDK, and there's already best practices in https://docs.fluent.xyz/fluentbase-sdk/storage#generated-api
} | ||
``` | ||
|
||
### Solidity Gas Optimization |
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.
Ditto regarding Solidity best practices and patterns
} | ||
``` | ||
|
||
## Testing Strategies |
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.
The need for testing docs to be added is valid, yet this is not the correct way to do it
|
||
```toml | ||
[dependencies] | ||
fluentbase-sdk = "0.3.6" # Use the latest compatible version |
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.
at 0.4.3-dev currently
|
||
**Problem**: Solidity interface not generated correctly. | ||
|
||
**Solution**: Check your Rust contract structure: |
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 is not very specific
- `bool` → `bool` | ||
- `string` → `String` | ||
|
||
### Storage Access Issues |
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.
Again, storage with Fluentbase SDK is handled differently
- `"functionName(address,uint256)"` - Multiple parameters | ||
- `"functionName(uint256[])"` - Array parameter | ||
|
||
### 4. Storage Initialization |
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.
Ditto regarding storage
|
||
### High Gas Consumption | ||
|
||
#### 1. Inefficient Storage Operations |
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.
Ditto regarding storage
sidebar_position: 6 | ||
--- | ||
|
||
Complete Blended App Tutorial |
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 developer guide is similar but less detailed than something we're internally working on, so I'm leaning towards not including this guide here.
What I would suggest here is that you add this guide as a README to the project repo (fully functioning) and then you can create a PR to https://github.com/fluentlabs-xyz/awesome-fluent to have it added as a community project
Hello @tmsdkeys I apologize for not mentioning it but i did use AI tools to assist me with some of the codes and i've done a proper review before pushing these new changes. Changes Made
I made changes to everything you pointed out and i've removed the hybrid token exchange section (working on creating a repo for it and open a PR in awesome-fluent) |
@ypszn does not have sufficient permissions to trigger deployments. |
Thanks for applying changes @ypszn , had a bit of a backlog but should be able to review again in the upcoming days! |
🔄 @tmsdkeys triggered a preview deployment for PR #126 at commit 🚀 Deployment starting... |
Summary
Added three comprehensive developer guides to improve the Fluent development experience:
Why This is Needed
The existing developer guides were basic and lacked comprehensive examples. These new guides provide:
Testing
✅ All guides tested locally and render correctly
✅ Build passes without errors (
npm run build
successful)✅ Navigation and links work properly
✅ Code examples are properly formatted
Impact
Significantly improves developer onboarding and reduces friction when building on Fluent.
Files Added
docs/developer-guides/common-patterns.md
docs/developer-guides/troubleshooting-guide.md
docs/developer-guides/complete-blended-app-tutorial.md