DragonX SDK: increase batch size and update server endpoints

- Increase DOWNLOAD_BATCH_SIZE from 50 to 500 for faster sync
- Update default server endpoints to dragonx.is (mainnet and testnet)
- Add jniLibs source dir for Rust native libraries in build config
This commit is contained in:
2026-03-21 03:53:53 -05:00
parent 3a66f165a4
commit 74155fd1bd
4 changed files with 8 additions and 13 deletions

View File

@@ -74,6 +74,7 @@ android {
sourceSets.getByName("main") { sourceSets.getByName("main") {
java.srcDir("build/generated/source/grpc") java.srcDir("build/generated/source/grpc")
proto { srcDir("src/main/proto") } proto { srcDir("src/main/proto") }
jniLibs.srcDir("build/rustJniLibs/android")
} }
kotlinOptions { kotlinOptions {
@@ -293,6 +294,8 @@ project.afterEvaluate {
val cargoTask = tasks.getByName("cargoBuild") val cargoTask = tasks.getByName("cargoBuild")
tasks.getByName("javaPreCompileDebug").dependsOn(cargoTask) tasks.getByName("javaPreCompileDebug").dependsOn(cargoTask)
tasks.getByName("javaPreCompileRelease").dependsOn(cargoTask) tasks.getByName("javaPreCompileRelease").dependsOn(cargoTask)
tasks.getByName("mergeDebugJniLibFolders").dependsOn(cargoTask)
tasks.getByName("mergeReleaseJniLibFolders").dependsOn(cargoTask)
} }
fun MinimalExternalModuleDependency.asCoordinateString() = fun MinimalExternalModuleDependency.asCoordinateString() =

View File

@@ -35,9 +35,9 @@ object ZcashSdk {
* Default size of batches of blocks to request from the compact block service. * Default size of batches of blocks to request from the compact block service.
*/ */
// Because blocks are buffered in memory upon download and storage into SQLite, there is an upper bound // Because blocks are buffered in memory upon download and storage into SQLite, there is an upper bound
// above which OutOfMemoryError is thrown. Experimentally, this value is below 50 blocks. // above which OutOfMemoryError is thrown. DragonX compact blocks are small (~1-2kb each),
// Back of the envelope calculation says the maximum block size is ~100kb. // so a larger batch size significantly reduces gRPC call overhead during initial sync.
const val DOWNLOAD_BATCH_SIZE = 50 const val DOWNLOAD_BATCH_SIZE = 500
/** /**
* Default size of batches of blocks to scan via librustzcash. The smaller this number the more granular information * Default size of batches of blocks to scan via librustzcash. The smaller this number the more granular information

View File

@@ -164,14 +164,6 @@ class LightWalletGrpcService private constructor(
.enableFullStreamDecompression() .enableFullStreamDecompression()
.apply { .apply {
useTransportSecurity() useTransportSecurity()
/*
if (lightWalletEndpoint.isSecure) {
useTransportSecurity()
} else {
twig("WARNING: Using insecure channel")
usePlaintext()
}
*/
} }
.build() .build()
} }

View File

@@ -24,14 +24,14 @@ private const val DEFAULT_PORT = 443
val LightWalletEndpoint.Companion.Mainnet val LightWalletEndpoint.Companion.Mainnet
get() = LightWalletEndpoint( get() = LightWalletEndpoint(
"dragonlite.printogre.com", "lite.dragonx.is",
DEFAULT_PORT, DEFAULT_PORT,
isSecure = true isSecure = true
) )
val LightWalletEndpoint.Companion.Testnet val LightWalletEndpoint.Companion.Testnet
get() = LightWalletEndpoint( get() = LightWalletEndpoint(
"dragonlite.printogre.com", "lite.dragonx.is",
DEFAULT_PORT, DEFAULT_PORT,
isSecure = true isSecure = true
) )