GitHub Repository

Dependencies

Features With Examples

Instructions

Defined Types

Generate Source

Configuration

GitHub Access Token: Generate a classic token with the read:packages scope to access dependencies hosted on GitHub Package Repository.

Create a gradle.properties file in the project directory root or under $HOME/.gradle/.

gpr.user=GITHUB_USERNAME
gpr.token=GITHUB_TOKEN

Compile & Run

Generated code will be placed under the basePackageName in the sourceDirectory. Export declarations will be added to module-info.java.

The IDL for programs configured in the programs JSON file will be fetched concurrently in numThreads with a baseDelayMillis between requests.

Program Configuration

[
  {
    "name": "Jupiter Swap",
    "program": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
    "package": "jupiter.swap"
  }
]
./genSrc.sh \
 --tabLength=2 \
 --sourceDirectory="src/main/java" \
 --moduleName="org.your.module" \
 --basePackageName="org.your.package.anchor.gen" \
 --programs="./main_net_programs.json" \
 --rpc="https://rpc.com" \
 --baseDelayMillis=200 \
 --numThreads=5