Skip to main content



Our Java SDK, blockfrost-java is tested to work with JDK 18.


$> git clone
$> ./gradlew clean build

Publish to Local Maven Repository

$> ./gradlew publishToMavenLocal

Run Integration tests

To run integration tests, you need Blockfrost Project Id for Cardano Testnet.

export BF_PROJECT_ID=<Blockfrost Cardano Testnet Project Id>
export BF_IPFS_PROJECT_ID=<Blockfrost Ipfs Project Id>


How to use ?

Add dependency

  • For Maven, add the following dependency to project's pom.xml
  • For Gradle, add the following dependency to build.gradle
compile 'com.bloxbean.cardano:cardano-client-lib:$version'

Note: Replace '$version' with the correct version number

For example: $version = 0.1.0-SNAPSHOT (If you have published snapshot jar to your local maven repository)


Following services are available

  • Cardano
    • AccountService
    • AddressService
    • AssetService
    • BlockService
    • EpochService
    • HealthService
    • LedgerService
    • MetadataService
    • NetworkService
    • PoolService
    • TransactionService
    • NutLinkService
  • IPFS
    • IPFSService

Cardano Api Usage

  • Create a BlockService instance
BlockService blockService = new BlockServiceImpl(Constants.BLOCKFROST_TESTNET_URL, PROJECT_ID);
  • Get Latest Block Details
Block block = blockService.getLatestBlock();

IPFS Api Usage

  • Create IPFSService instance
IPFSService ipfsService = new IPFSServiceImpl(Constants.BLOCKFROST_IPFS_URL, IPFS_PROJECT_ID);
  • Add to IPFS, Pin the content and Get content by CID
File file = new File(<path to file>);
IPFSObject ipfsObject = ipfsService.add(file);

PinResponse pinResponse = ipfsService.pinAdd(ipfsObject.getIpfsHash());

byte[] bytes = ipfsService.get(ipfsObject.getIpfsHash());

Release resources when program exits

To release OkHttpClient's thread pool and other resources when the program exits, invoke the following api.



A supported configuration property can be set through system property or environment variable. You can also directly set a config property using ConfigHelper.



List of supported config properties

Property NameDescription
BF_API_MAX_THREADSNo of threads to use while fetching multiple pages of data in a single request. Default Value: 10 (Example: getAllAddressUtxos, getAddressTransactions ...)
BF_RATE_LIMIT_FOR_PERIODThe permission limit for refresh period. This property is used in rate limit implementation. Default Value: 10
BF_RATE_LIMIT_REFRESH_PERIOD_IN_SECThe period of limit refresh in sec. Default Value: 1 After each period rate limiter sets its permission count to value set for BF_RATE_LIMIT_FOR_PERIOD.
BF_RATE_LIMIT_TIMEOUT_DURATION_IN_MILLISThe default wait for permission duration in milliseconds. Default Value: 5000
BF_CONNECTION_TIMEOUTThe connect timeout (connection/read/write) for new connections in seconds. Default Value: 90