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

Introduce Cookbook #424

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open

Conversation

0x009922
Copy link
Contributor

(ideally) Closes #423


As of now, a very raw structure of examples that might be useful for users. Will need to add some real content with:

  • Why the example might be needed, in what context it might be useful
  • Short summary what happens in the example
  • Code snippets with comments. It is critical to include multiple SDKs (at least bash + Rust, Java and JavaScript later)

@0x009922 0x009922 self-assigned this Oct 30, 2023
@vercel
Copy link

vercel bot commented Oct 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
iroha-2-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 11:10am

@0x009922 0x009922 added documentation M-meta Issues/PRs on the documentation itself (presentation, localization, navigation, etc.) labels Oct 30, 2023
@outoftardis outoftardis changed the base branch from main to doc-restructure-temp November 2, 2023 13:25
@outoftardis
Copy link
Contributor

I'm using a temp branch with restructured docs as the base for this change in order for us to see the whole picture

.vitepress/config.mts Outdated Show resolved Hide resolved
Comment on lines 209 to 221
text: 'Events and Filters',
collapsed: true,
items: [
{
text: 'Pipeline Events',
collapsed: true,
items: [],
},
{
text: 'Data Events',
collapsed: true,
items: [],
},
{
text: 'Trigger Events',
collapsed: true,
items: [],
},
{
text: 'Advanced Filtering',
collapsed: true,
items: [],
},
Copy link
Contributor

Choose a reason for hiding this comment

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

this also needs more details, what kind of example can we include here? just "work with {event type}"? or something else?

@outoftardis
Copy link
Contributor

@mversic please review the cookbook structure
you can see the preview here

.vitepress/config.mts Outdated Show resolved Hide resolved
.vitepress/config.mts Outdated Show resolved Hide resolved
.vitepress/config.mts Outdated Show resolved Hide resolved
.vitepress/config.mts Outdated Show resolved Hide resolved
.vitepress/config.mts Outdated Show resolved Hide resolved
.vitepress/config.mts Outdated Show resolved Hide resolved
magical_keys.clone(),
AssetValueType::Numeric(NumericSpec::integer()),
).mintable_once()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This snippet registers an asset with mintable_once, which is different from a non-mintable asset.

Copy link
Contributor

Choose a reason for hiding this comment

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


```rust
fn mint_non_mintable_asset(
Copy link
Contributor Author

@0x009922 0x009922 May 7, 2024

Choose a reason for hiding this comment

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

If it's non-mintable, how could we mint it 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question, I think the mintability naming is unfortunate, and we should rethink it. But that's an issue for the main repo

Copy link
Contributor

Choose a reason for hiding this comment

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

Same as #424 (comment)

@nxsaken nxsaken removed the iroha2 label May 16, 2024
RegisterExpr::new(AssetDefinition::quantity(asset_definition_id.clone()));

let _hash = admin_client.submit_all_blocking({
let isi: [InstructionExpr; 3] = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let isi: [InstructionExpr; 3] = [
let isi: [InstructionBox; _] = [

];
isi
})?;
```
Copy link
Contributor

Choose a reason for hiding this comment

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

this example needs to be reworked, it doesn't work like this

Comment on lines +176 to +187
```rust [Rust]
let error = mad_hatter_client
.request(client::asset::by_id(asset_id.clone()))
.expect_err("Asset should not be found");

assert!(matches!(
error,
ClientQueryError::Validation(ValidationFail::QueryFailed(QueryExecutionFail::Find(
FindError::Asset(_)
)))
));
```
Copy link
Contributor

Choose a reason for hiding this comment

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

What if this account has already that asset? Is there any reliable way to check? Is there any way to store partially signed transaction?

@nxsaken nxsaken added E-examples Examples in the form of code snippets or word problems and removed documentation labels May 20, 2024
@nxsaken nxsaken added this to the 2.0.0-rc.1.0 milestone May 21, 2024
Signed-off-by: Nurzhan Sakén <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-examples Examples in the form of code snippets or word problems M-meta Issues/PRs on the documentation itself (presentation, localization, navigation, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initial Cookbook structure
8 participants