The Corda Solana notary is an
on-chain Solana program that tracks consumed
StateRefs.
An appropriately configured Corda notary can delegate the tracking of spent states to this program.
The program is on both mainnet and
devnet with the program ID
notary95bwkGXj74HV2CXeCn4CgBzRVv5nmEVfqonVY.
This repository is a multi-module Gradle project. Each module has a group ID of net.corda.solana.notary and an
artifact ID prefixed withsolana-notary-. For example, the Maven coordinates for testing is
net.corda.solana.notary:solana-notary-testing.
The artifacts are available at the following Maven repo:
repositories {
maven {
url = uri("https://download.corda.net/maven/corda-dependencies")
}
}The on-chain Solana program written using Anchor. It has its own Gradle build file which hooks into the Anchor build process.
The published Maven artifact is a Jar file containing the program .so binary and Anchor IDL file.
Generated Kotlin client for the program targeting a forked version of Sava.
In terms of source code, this module only contains an Anchor IDL code generator. It is invoked before the Kotlin compilation phase, generating the client source code.
Testing library for writing JUnit tests which need the Solana notary. In contains
SolanaNotaryExtension which
will automatically spin up a solana-test-validator configured with the notary program and ready to use.
solana-notary-admin CLI for managing the notary program.
To run all the tests, including the Anchor tests in program:
./gradlew checkTo clean everything, including Rust/Anchor build artifacts:
./gradlew cleanTo (re)generate the Kotlin client:
./gradlew kotlin-client:compileKotlinTo build the solana-notary-admin CLI:
./gradlew admin-cli:nativeCompile
cd admin-cli/build/native/nativeCompile
./solana-notary-admin --helpThe axion-release-plugin is used for managing the version via git tags. Run the following to get the current SNAPSHOT version:
./gradlew -q currentVersionNote
The version is included in the Anchor IDL of the notary program. This is done by
dynamically setting the CARGO_PKG_VERSION environment variable.
Assuming the version is 0.1.9-SNAPSHOT. Add a v prefix and remove the -SNAPSHOT suffix for the next version tag:
git tag v0.1.9
git push origin v0.1.9Running ./gradlew -q currentVersion again will now print
Project version: 0.1.9
This is because the current commit is now on a version tag. The CI pipeline will publish this version when run.
The next SNAPSHOT version (0.1.10-SNAPSHOT going with our example) will occur automatically when the main branch
advances past this tag.
Each module is released under difference licenses.