{"id":13780165,"url":"https://github.com/bloxbean/yaci-cardano-test","last_synced_at":"2026-06-06T11:31:49.482Z","repository":{"id":215841403,"uuid":"615123101","full_name":"bloxbean/yaci-cardano-test","owner":"bloxbean","description":"Make Java app testing on Cardano blockchain a breeze with Yaci Cardano Test Java library.","archived":false,"fork":false,"pushed_at":"2024-04-13T12:39:07.000Z","size":153,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-03T18:14:48.604Z","etag":null,"topics":["cardano","java","testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bloxbean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-17T02:01:41.000Z","updated_at":"2023-04-02T11:01:57.000Z","dependencies_parsed_at":"2024-04-13T12:28:31.331Z","dependency_job_id":"b751eefd-54da-4ce3-ab99-6cf6840dd2ce","html_url":"https://github.com/bloxbean/yaci-cardano-test","commit_stats":null,"previous_names":["bloxbean/yaci-cardano-test"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloxbean%2Fyaci-cardano-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloxbean%2Fyaci-cardano-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloxbean%2Fyaci-cardano-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bloxbean%2Fyaci-cardano-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bloxbean","download_url":"https://codeload.github.com/bloxbean/yaci-cardano-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225056773,"owners_count":17414206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cardano","java","testing"],"created_at":"2024-08-03T18:01:12.975Z","updated_at":"2026-06-06T11:31:49.474Z","avatar_url":"https://github.com/bloxbean.png","language":"Java","funding_links":[],"categories":["Yaci Cardano Test"],"sub_categories":[],"readme":"# Yaci Cardano Test\nMake Java app testing on Cardano blockchain a breeze with Yaci Cardano Test Java library.\n\n## What is Yaci Cardano Test?\n\nYaci Cardano Test is a Java library that provides a simple way to test your Java Cardano application. It uses [testcontainers](https://www.testcontainers.org/) \nto start a dev Cardano node in a docker container programmatically. It also provides a simple way to interact with the container\nin your test code through a Test Helper class and use Cardano specific assertions to verify the results.\n\n## Pre-requisites\n\n- Docker - [please see General Docker requirements](https://www.testcontainers.org/supported_docker_environment/)\n\n## Dependencies\n\n### Maven dependencies\n\n```xml\n  \u003cdependency\u003e\n     \u003cgroupId\u003ecom.bloxbean.cardano\u003c/groupId\u003e\n     \u003cartifactId\u003eyaci-cardano-test\u003c/artifactId\u003e\n     \u003cversion\u003e0.1.0\u003c/version\u003e\n     \u003cscope\u003etest\u003c/scope\u003e\n  \u003c/dependency\u003e\n```\nYou also need to add following cardano-client-lib dependencies and also junit 5.\n\n```\n\u003cdependency\u003e\n     \u003cgroupId\u003ecom.bloxbean.cardano\u003c/groupId\u003e\n     \u003cartifactId\u003ecardano-client-lib\u003c/artifactId\u003e\n     \u003cversion\u003e0.6.2\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n     \u003cgroupId\u003ecom.bloxbean.cardano\u003c/groupId\u003e\n     \u003cartifactId\u003ecardano-client-backend\u003c/artifactId\u003e\n     \u003cversion\u003e0.6.2\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n     \u003cgroupId\u003ecom.bloxbean.cardano\u003c/groupId\u003e\n     \u003cartifactId\u003ecardano-client-backend-ogmios\u003c/artifactId\u003e\n     \u003cversion\u003e0.6.2\u003c/version\u003e\n\u003c/dependency\u003e\n\u003cdependency\u003e\n     \u003cgroupId\u003ecom.bloxbean.cardano\u003c/groupId\u003e\n     \u003cartifactId\u003ecardano-client-backend-blockfrost\u003c/artifactId\u003e\n     \u003cversion\u003e0.6.2\u003c/version\u003e\n \u003c/dependency\u003e\n \u003cdependency\u003e\n     \u003cgroupId\u003eorg.junit.jupiter\u003c/groupId\u003e\n     \u003cartifactId\u003ejunit-jupiter-engine\u003c/artifactId\u003e\n     \u003cversion\u003e5.9.2\u003c/version\u003e\n     \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n\n```\n\n### Gradle Dependencies\n\n```\ntestImplementation \"com.bloxbean.cardano:yaci-cardano-test:0.1.0\"\n```\n\nOther dependencies\n\n```\nimplementation \"com.bloxbean.cardano:cardano-client-lib:0.6.2\"\nimplementation \"com.bloxbean.cardano:cardano-client-backend:0.6.2\"\nimplementation \"com.bloxbean.cardano:cardano-client-backend-ogmios:0.6.2\"\nimplementation \"com.bloxbean.cardano:cardano-client-backend-blockfrost:0.6.2\"\n\ntestImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'\ntestRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'\n```\n\n## Quick Start\n\n### Start a Cardano Node with Yaci Store API (Blockfrost Compatible API) support\n\nThe following code snippet demonstrates how to launch a Cardano node in a Docker container and fund an account with 20,000 ADA. \nBy default, the Yaci Store API is enabled, which can be used to query and submit transactions to the running node. \nThe Yaci Store API is compatible with the Blockfrost API.\n\n```java\nYaciCardanoContainer yaciCardanoContainer = new YaciCardanoContainer()\n                .withInitialFunding(new Funding(account.baseAddress(), 20000))\n                .withLogConsumer(outputFrame -\u003e System.out.println(outputFrame.getUtf8String()));\n\nyaciCardanoContainer.start();\n```\n\n### Start a Cardano Node with Ogmios \u0026 Kupo Api Support\n\n```java\n YaciCardanoContainer yaciCardanoContainer = new YaciCardanoContainer()\n                .withApiMode(ApiMode.OGMIOS)\n                .withInitialFunding(new Funding(account.baseAddress(), 20000))\n                .withLogConsumer(outputFrame -\u003e System.out.println(outputFrame.getUtf8String()));\n\nyaciCardanoContainer.start();\n```\n\n### Build and Submit a Transaction\n\nGet Cardano Client Lib Suppliers required to build and submit transactions\n\n```java\nvar backendService = yaciCardanoContainer.getBackendService();\n\nvar utxoSupplier = yaciCardanoContainer.getUtxoSupplier();\nvar protocolParamsSupplier = yaciCardanoContainer.getProtocolParamsSupplier();\nvar transactionProcessor = yaciCardanoContainer.getTransactionProcessor();\n```\n\nUsing the above suppliers, you can build and submit transactions using one of the transaction builders in the Cardano Client Library.\n\n### Assertion Library\n\nYaci Cardano Test provides a set of Cardano specific assertions to verify the results of your tests. \nFor example, you can verify the ada or asset balance of an address, verify utxo size, etc.\n\n```java\n  Assertions.assertMe(cardanoContainer).hasLovelaceBalance(receiverAddress, adaToLovelace(2.1));\n  Assertions.assertMe(cardanoContainer).hasAssetBalance(receiverAddress, policy.getPolicyId(), \"abc\", BigInteger.valueOf(300));\n  Assertions.assertMe(cardanoContainer).utxos(receiverAddress).hasSize(1);\n  Assertions.assertMe(cardanoContainer).utxos(receiverAddress).hasLovelaceBalance(adaToLovelace(2.1));\n```\n\n## Examples\n\nCheck this sample project https://github.com/bloxbean/yaci-cardano-test-sample\n\nFor more tests check the [test](https://github.com/bloxbean/yaci-cardano-test/tree/main/src/test/java/com/bloxbean/cardano/yaci/test) pacakage in this project.\n\n# Any questions, ideas or issues?\n\n- Create a Github [Discussion](https://github.com/bloxbean/yaci-cardano-test/discussions)\n- Create a Github [Issue](https://github.com/bloxbean/yaci-cardano-test/issues)\n- [Discord Server](https://discord.gg/JtQ54MSw6p)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloxbean%2Fyaci-cardano-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbloxbean%2Fyaci-cardano-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloxbean%2Fyaci-cardano-test/lists"}