Crates.io | naumachia |
lib.rs | naumachia |
version | 0.2.0 |
source | src |
created_at | 2022-08-09 06:36:54.514513 |
updated_at | 2022-12-01 04:16:49.385646 |
description | Cardano Smart-Contract Framework |
homepage | |
repository | https://github.com/MitchTurner/naumachia |
max_upload_size | |
id | 641583 |
size | 278,095 |
Naumachia is a framework for writing Smart Contracts on the Cardano Blockchain using Rust!
Work in Progress :)
Checkout the feature progress roadmap
The Cardano Smart Contract scheme pushes a lot of the code off-chain. Naumachia is designed to make the development of off-chain code as easy as possible, but also give you an environment to test your on-chain code.
Included in the library are the tools for declaratively orchestrating interactions with validator scripts, minting policies, and wallets; building and checking your transaction against your on-chain code; testing all of this code at multiple abstraction layers; deploying, managing, and interacting with your Smart Contract in production.
Intended to be used as the off-chain backend for Aiken or any other on-chain script (UPLC) source :)
Naumachia is meant as an alternative for the Plutus Application Backend (PAB).
Trireme is a CLI for managing all of your dApps and secrets.
For now, it is just an MVP to allow your Naumachia dApps to interact with the blockchain. Eventually, it will be a full CLI wallet, a package manager for you dApps, and more.
Not stable.
To install locally, run
cargo install --path ./trireme
or install via crates.io
cargo install trireme
Setup with
trireme init
and follow instructions.
⚠️⚠️Your config files will be stored in plain text on your local file system under ~/.trireme
. Please use test
wallets only while trireme
is still new.
While features are still quite limited, I'm happy to say that Naumachia is working now! You can build, deploy, and interact with your smart contracts on the Testnet. Over time, we'll add more sample dApps that will illustrate more features.
The /sample-dApps
directory includes the always-succeeds-contract
which you can use as long as you have
Trireme
soon, but in the meantime you'll need to build it elsewhere)I've only tested on Linux.
⚠️⚠️Be very careful to not use your HODL keys! Please only use a secret phrase from a TESTNET wallet with funds you are willing to lose. ⚠️⚠️Naumachia and the Trireme CLI are still under development!
To interact with your contract, you will need to install the trireme
cli:
cargo install --path ./trireme
Trireme allows you to manage your secrets for all your Naumachia dApps.
To add your api key and your secret phrase, run:
trireme init
Which will prompt you to enter your information.
⚠️⚠️Your config files will be stored in plain text on your local file system under ~/.trireme
.
Use Trireme
to check your initial balance!
trireme balance
Now that Trireme is set up, you are ready to interact with the blockchain!
First, install the dApp CLI:
cargo install --path ./sample-dApps/always-succeeds-contract
and try locking 10 ADA at the contract address:
always-cli lock 10
It can take a few minutes for your transaction to show up on chain.
You can trireme balance
again to check your balance. Or, use the returned TxId to track
on the testnet explorer or
in your wallet interface (Yoroi, Nami, etc). Your balance should have decreased by 10 + fees.
Once it has gone through, you can run
always-cli list 5
Which will show the 5 newest locked UTxOs at the script address (feel free to look at more). You will probably see a bunch of other UTxOs locked at the script address. You can try and claim those, but many of them aren't claimable for a number of reasons.
You will need to find yours and include the Output Id info in your claim
command. It will look something like:
always-cli claim <tx_hash> <index>
Again, this might take a few minutes to execute. But check trireme balance
or your wallet interface
to see that your balance has returned to your original balance minus fees for the two txs.
Fin!
Excited to accept PRs and general feedback. There is a lot of work to be done to make this the best framework it can be, so I'll try to help onboard anyone interested in contributing.
Big fan of modern programming techniques. I want to prioritize
Feel free to start issues/discussions if there are things you feel are missing or whatever. I love feedback as I'm figuring out a lot of this as I go. I want to get the design right. Questions also welcome.
Check out our architecture diagram.
FYI, CI requires these commands to pass. So, try to run them locally to save yourself some time.
cargo build --workspace
cargo test --workspace
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings