-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add examples using the releases #409
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
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4779b20
feat(bindings): add examples using the releases
Thoralf-M 19c9501
add Rust example
Thoralf-M 31cede7
remove unused dependency
Thoralf-M 01ce421
add go example
Thoralf-M 5675161
update to use latest versions
Thoralf-M cb438b3
copyright header
Thoralf-M d346c5e
fix python example format cmds
Thoralf-M 0804a75
rename to release
Thoralf-M a156418
make release examples
Thoralf-M 8fe189f
don't use uv for example/CI
Thoralf-M a9e694d
Update bindings/go/examples/release/README.md
thibault-martinez 527b1a2
Update crates/iota-sdk/examples/release/Cargo.toml
thibault-martinez a2a0a81
Update .github/workflows/tests.yml
thibault-martinez 74b236c
Update .github/workflows/tests.yml
thibault-martinez 914e344
bring back help cmd
Thoralf-M fd6a06f
Merge branch 'develop' into bindings/full-examples
thibault-martinez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| /target | ||
| target/ | ||
| Cargo.lock | ||
| .idea | ||
| *.dylib | ||
|
|
@@ -7,3 +7,4 @@ Cargo.lock | |
| __pycache__ | ||
| build | ||
| .vscode | ||
| .kotlin | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| Full project example using the released package. | ||
|
|
||
| ```bash | ||
thibault-martinez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| go get github.com/iotaledger/iota-sdk-go | ||
| ``` | ||
|
|
||
| ```bash | ||
| go run main.go | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| // Copyright (c) 2026 IOTA Stiftung | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package main | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "log" | ||
|
|
||
| "github.com/iotaledger/iota-sdk-go" | ||
| ) | ||
|
|
||
| func main() { | ||
| client := iota_sdk.GraphQlClientNewDevnet() | ||
|
|
||
| chainID, err := client.ChainId() | ||
| if err.(*iota_sdk.SdkFfiError) != nil { | ||
| log.Fatalf("Failed to get chain ID: %v", err) | ||
| } | ||
| fmt.Println("Chain ID:", chainID) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Full project example using the released package. | ||
|
|
||
| ```bash | ||
| gradle run | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| plugins { | ||
| kotlin("jvm") version "2.2.20" | ||
| application | ||
| } | ||
|
|
||
| group = "com.example" | ||
|
|
||
| version = "1.0-SNAPSHOT" | ||
|
|
||
| repositories { mavenCentral() } | ||
|
|
||
| dependencies { | ||
| implementation("org.iota:iota-sdk:latest.release") | ||
| implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0") | ||
| } | ||
|
|
||
| kotlin { jvmToolchain(21) } | ||
|
|
||
| application { mainClass.set("MainKt") } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| rootProject.name = "kotlintest" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // Copyright (c) 2026 IOTA Stiftung | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import iota_sdk.GraphQlClient | ||
| import kotlinx.coroutines.runBlocking | ||
|
|
||
| fun main() = runBlocking { | ||
| try { | ||
| val client = GraphQlClient.newDevnet() | ||
| val chainId = client.chainId() | ||
| println("Chain ID: $chainId") | ||
| } catch (e: Exception) { | ||
| e.printStackTrace() | ||
| kotlin.system.exitProcess(1) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| Full project example using the released package. | ||
|
|
||
| To set up the environment: | ||
|
|
||
| ```bash | ||
| python -m venv .venv | ||
| source .venv/bin/activate | ||
| pip install --pre --upgrade -r requirements.txt | ||
| ``` | ||
|
|
||
| Then run: | ||
|
|
||
| ```bash | ||
| python example.py | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Copyright (c) 2025 IOTA Stiftung | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| from iota_sdk import * | ||
|
|
||
| import asyncio | ||
|
|
||
|
|
||
| async def main(): | ||
| client = GraphQlClient.new_devnet() | ||
|
|
||
| chain_id = await client.chain_id() | ||
| print("Chain ID:", chain_id) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| asyncio.run(main()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| iota-sdk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| [workspace] | ||
| [package] | ||
| name = "release" | ||
| version = "0.1.0" | ||
| edition = "2024" | ||
|
|
||
| [dependencies] | ||
| iota-sdk = "^3.0.0-alpha" | ||
| tokio = "1.40.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // Copyright (c) 2026 IOTA Stiftung | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use iota_sdk::graphql_client::{Client, error::Result}; | ||
|
|
||
| #[tokio::main] | ||
| async fn main() -> Result<()> { | ||
| let client = Client::new_devnet(); | ||
|
|
||
| let chain_id = client.chain_id().await?; | ||
| println!("Chain ID: {chain_id}"); | ||
|
|
||
| Ok(()) | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.