diff --git a/sdk-lib/build.gradle.kts b/sdk-lib/build.gradle.kts index 891f8f2..b9af5f2 100644 --- a/sdk-lib/build.gradle.kts +++ b/sdk-lib/build.gradle.kts @@ -74,6 +74,7 @@ android { sourceSets.getByName("main") { java.srcDir("build/generated/source/grpc") proto { srcDir("src/main/proto") } + jniLibs.srcDir("build/rustJniLibs/android") } kotlinOptions { @@ -293,6 +294,8 @@ project.afterEvaluate { val cargoTask = tasks.getByName("cargoBuild") tasks.getByName("javaPreCompileDebug").dependsOn(cargoTask) tasks.getByName("javaPreCompileRelease").dependsOn(cargoTask) + tasks.getByName("mergeDebugJniLibFolders").dependsOn(cargoTask) + tasks.getByName("mergeReleaseJniLibFolders").dependsOn(cargoTask) } fun MinimalExternalModuleDependency.asCoordinateString() = diff --git a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/ext/ZcashSdk.kt b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/ext/ZcashSdk.kt index 9b59ced..c500cd8 100644 --- a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/ext/ZcashSdk.kt +++ b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/ext/ZcashSdk.kt @@ -35,9 +35,9 @@ object ZcashSdk { * 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 - // above which OutOfMemoryError is thrown. Experimentally, this value is below 50 blocks. - // Back of the envelope calculation says the maximum block size is ~100kb. - const val DOWNLOAD_BATCH_SIZE = 50 + // above which OutOfMemoryError is thrown. DragonX compact blocks are small (~1-2kb each), + // so a larger batch size significantly reduces gRPC call overhead during initial sync. + const val DOWNLOAD_BATCH_SIZE = 500 /** * Default size of batches of blocks to scan via librustzcash. The smaller this number the more granular information diff --git a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/service/LightWalletGrpcService.kt b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/service/LightWalletGrpcService.kt index ec9e0c3..035b180 100644 --- a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/service/LightWalletGrpcService.kt +++ b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/internal/service/LightWalletGrpcService.kt @@ -164,14 +164,6 @@ class LightWalletGrpcService private constructor( .enableFullStreamDecompression() .apply { useTransportSecurity() - /* - if (lightWalletEndpoint.isSecure) { - useTransportSecurity() - } else { - twig("WARNING: Using insecure channel") - usePlaintext() - } - */ } .build() } diff --git a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/model/LightWalletEndpointExt.kt b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/model/LightWalletEndpointExt.kt index fd9d540..162d781 100644 --- a/sdk-lib/src/main/java/cash/z/ecc/android/sdk/model/LightWalletEndpointExt.kt +++ b/sdk-lib/src/main/java/cash/z/ecc/android/sdk/model/LightWalletEndpointExt.kt @@ -24,14 +24,14 @@ private const val DEFAULT_PORT = 443 val LightWalletEndpoint.Companion.Mainnet get() = LightWalletEndpoint( - "dragonlite.printogre.com", + "lite.dragonx.is", DEFAULT_PORT, isSecure = true ) val LightWalletEndpoint.Companion.Testnet get() = LightWalletEndpoint( - "dragonlite.printogre.com", + "lite.dragonx.is", DEFAULT_PORT, isSecure = true )