Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ bdk.kt
libbdkffi.dylib
/.idea
.DS_Store
/examples/data/
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ sdk install java 17.0.2-tem
```sh
bash ./scripts/build-<your-local-architecture>.sh
```
## Run example files
Copy link
Member

Choose a reason for hiding this comment

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

Markdown is very flexible, but just for consistency I try to follow the Google Style Guide for Markdown. In this case, you'd add blank spaces between your headings and text (one blank line before and one after).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks


The `examples` module show different samples of how some of the APIs can be used. You can run the examples after building as stated above. The gradle task to run is by convention the file name of the example file.

```shell
cd bdk-jvm
./gradlew MultisigTransaction
```

You can also list the application tasks. (All examples grouped under application)
```shell
cd bdk-jvm
./gradlew tasks --group application
```

## How to publish to your local Maven repo

Expand Down
17 changes: 16 additions & 1 deletion examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
kotlin("jvm") version "2.1.10"
id("org.jetbrains.kotlin.jvm") version "2.1.10"
id("application")
}

group = "org.bitcoindevkit"
Expand Down Expand Up @@ -32,3 +33,17 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
jvmTarget.set(JvmTarget.JVM_11)
}
}

tasks.register<JavaExec>("WalletSetupBip32") {
group = "application"
description = "Runs the main function in the WalletSetupBip32 example"
mainClass.set("org.bitcoindevkit.WalletSetupBip32Kt")
classpath = sourceSets["main"].runtimeClasspath
}

tasks.register<JavaExec>("MultisigTransaction") {
group = "application"
description = "Runs the main function in the MultisigTransaction example"
mainClass.set("org.bitcoindevkit.MultisigTransactionKt")
classpath = sourceSets["main"].runtimeClasspath
}