Skip to content

provenance-io/loan-package-contracts

Repository files navigation

loan-package-contracts

Defines a loan package scope specification and p8e smart contracts that can be executed against it.

Status

Build stability-beta Code Coverage LOC

Artifacts

Latest Release

Contracts JAR

Contracts Artifact

Protobuf JAR

Proto Artifact

Development

Commands

Cloning the Repository

git clone https://github.com/provenance-io/loan-package-contracts.git
cd loan-package-contracts/

Building the project

./gradlew clean build --refresh-dependencies

Bootstrapping the contracts

See here for more details on the p8e tasks.

The following command will put the contracts into an object store:

./gradlew p8eClean p8eCheck p8eBootstrap

In order for the bootstrapping to succeed, the following environment variables will need to be defined:

OS_GRPC_URL             # The URL to your object store that will store the contracts
PROVENANCE_GRPC_URL     # The URL to the Provenance instance the contracts will run against
ENCRYPTION_PRIVATE_KEY
SIGNING_PRIVATE_KEY
CHAIN_ID                # The ID of the chain - use chain-local locally and pio-testnet-1 for the test environment

For local development, you can quickly get necessary Docker containers running and said environment values populated by using p8e-scope-sdk/dev-tools:

git clone https://github.com/provenance-io/p8e-scope-sdk.git
cd p8e-scope-sdk/dev-tools/compose/
docker compose up -d
source ./host.env
cd /PathToYour/loan-package-contracts
./gradlew p8eBootstrap

Publishing local artifacts

To publish to your machine's local Maven repository, use

./gradlew publishToMavenLocal -xsignMavenPublication

Linting

This project uses Ktlint.

To immediately view linting errors, use

./gradlew clean ktlintCheck

To generate linting reports, use

./gradlew ktlintCheck

To have the linter try to update your code to fit the linting rules, use

./gradlew ktlintFormat