Skip to content

Conversation

ypszn
Copy link

@ypszn ypszn commented Aug 23, 2025

Summary

Added three comprehensive developer guides to improve the Fluent development experience:

  • Common Patterns & Best Practices: Covers error handling, gas optimization, security, testing, and debugging
  • Troubleshooting Guide: Solutions for common build, deployment, and runtime issues
  • Complete Blended App Tutorial: Step-by-step tutorial for building hybrid Rust/Solidity applications

Why This is Needed

The existing developer guides were basic and lacked comprehensive examples. These new guides provide:

  • Real-world patterns and best practices
  • Solutions to common developer problems
  • Complete tutorial examples that developers can follow

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

@tmsdkeys tmsdkeys self-requested a review August 27, 2025 09:17
@tmsdkeys
Copy link
Member

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

@github-actions
Copy link

🔄 @tmsdkeys triggered a preview deployment for PR #126 at commit 9c24756.

🚀 Deployment starting...
🔗 Check deployment status

@tmsdkeys tmsdkeys added the documentation Improvements or additions to documentation label Aug 27, 2025
@ypszn
Copy link
Author

ypszn commented Aug 27, 2025

gblend @tmsdkeys. okay, no problem

@github-actions
Copy link

@ypszn does not have sufficient permissions to trigger deployments.

Copy link
Member

@tmsdkeys tmsdkeys left a 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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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:
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

@ypszn
Copy link
Author

ypszn commented Sep 8, 2025

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

  • Fixed storage access issues and how storage is handled with Fluentbase SDK
  • Updated troubleshooting guide with the correct Fluentbase SDK patterns
  • Moved common-patterns to Fluentbase SDK section
  • Removed duplicate guides and improved structure

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)

@github-actions
Copy link

github-actions bot commented Sep 8, 2025

@ypszn does not have sufficient permissions to trigger deployments.

@ypszn ypszn requested a review from tmsdkeys September 16, 2025 21:39
@tmsdkeys
Copy link
Member

Thanks for applying changes @ypszn , had a bit of a backlog but should be able to review again in the upcoming days!

@github-actions
Copy link

🔄 @tmsdkeys triggered a preview deployment for PR #126 at commit e7edbec.

🚀 Deployment starting...
🔗 Check deployment status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants