-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from solana-mobile/rpc-solana
Solana RPC Client
- Loading branch information
Showing
11 changed files
with
564 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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,39 @@ | ||
name: Install Solana | ||
|
||
inputs: | ||
solana_version: | ||
description: Version of Solana to install | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Cache Solana Install | ||
if: ${{ !env.ACT }} | ||
id: cache-solana-install | ||
uses: actions/cache@v2 | ||
with: | ||
path: "$HOME/.local/share/solana/install/releases/${{ inputs.solana_version }}" | ||
key: ${{ runner.os }}-Solana-v${{ inputs.solana_version }} | ||
|
||
- name: Install Solana | ||
if: ${{ !env.ACT }} && steps.cache-solana-install.cache-hit != 'true' | ||
run: | | ||
sh -c "$(curl -sSfL https://release.solana.com/v${{ inputs.solana_version }}/install)" | ||
shell: bash | ||
|
||
- name: Set Active Solana Version | ||
run: | | ||
rm -f "$HOME/.local/share/solana/install/active_release" | ||
ln -s "$HOME/.local/share/solana/install/releases/${{ inputs.solana_version }}/solana-release" "$HOME/.local/share/solana/install/active_release" | ||
shell: bash | ||
|
||
- name: Add Solana bin to Path | ||
run: | | ||
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | ||
shell: bash | ||
|
||
- name: Verify Solana install | ||
run: | | ||
solana --version | ||
shell: bash |
This file contains 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 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 |
---|---|---|
|
@@ -30,3 +30,8 @@ POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/solana-mobile/rpc-core.git | |
POM_DEVELOPER_NAME=Solana Mobile Engineering | ||
POM_DEVELOPER_URL=https://solanamobile.com | ||
POM_DEVELOPER_EMAIL=[email protected] | ||
|
||
# RPC URLs used for testing | ||
testing.rpc.defaultUrl=https://api.devnet.solana.com | ||
testing.rpc.localUrl=http://127.0.0.1:8899 | ||
localValidator=false |
This file contains 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 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 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 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,76 @@ | ||
plugins { | ||
alias(libs.plugins.kotlin.multiplatform) | ||
alias(libs.plugins.kotlin.serialization) | ||
alias(libs.plugins.publish) | ||
} | ||
|
||
val artifactIdPrefix: String by project | ||
val moduleArtifactId = "$artifactIdPrefix-solana" | ||
|
||
kotlin { | ||
jvm { | ||
jvmToolchain(11) | ||
withJava() | ||
testRuns["test"].executionTask.configure { | ||
useJUnitPlatform() | ||
} | ||
} | ||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64(), | ||
macosX64(), | ||
macosArm64() | ||
).forEach { | ||
it.binaries.framework { | ||
baseName = moduleArtifactId | ||
} | ||
} | ||
|
||
sourceSets { | ||
val commonMain by getting { | ||
dependencies { | ||
implementation(project(mapOf("path" to ":rpccore"))) | ||
implementation(libs.kotlinx.coroutines.core) | ||
implementation(libs.kotlinx.serialization.json) | ||
implementation(libs.web3.solana) | ||
implementation(libs.multimult) | ||
} | ||
} | ||
val commonTest by getting { | ||
kotlin.srcDir(File("${buildDir}/generated/src/commonTest/kotlin")) | ||
dependencies { | ||
implementation(project(mapOf("path" to ":ktordriver"))) | ||
implementation(libs.kotlin.test) | ||
implementation(libs.kotlinx.coroutines.test) | ||
implementation(libs.kotlinx.serialization.json) | ||
implementation(libs.crypto) | ||
} | ||
} | ||
} | ||
} | ||
|
||
mavenPublishing { | ||
coordinates(group as String, moduleArtifactId, version as String) | ||
} | ||
|
||
afterEvaluate { | ||
val defaultRpcUrl = properties["testing.rpc.defaultUrl"] | ||
var rpcUrl = properties["rpcUrl"] ?: defaultRpcUrl | ||
|
||
val useLocalValidator = project.properties["localValidator"] == "true" | ||
val localRpcUrl = project.properties["testing.rpc.localUrl"] | ||
if (useLocalValidator && localRpcUrl != null) rpcUrl = localRpcUrl | ||
|
||
val dir = "${buildDir}/generated/src/commonTest/kotlin/com/solana/config" | ||
mkdir(dir) | ||
File(dir, "TestConfig.kt").writeText( | ||
""" | ||
package com.solana.config | ||
internal object TestConfig { | ||
const val RPC_URL = "$rpcUrl" | ||
} | ||
""".trimIndent() | ||
) | ||
} |
Oops, something went wrong.