Reviewing Some Examples
Over the last few Cardano Go Live Coding sessions, we have been talking about building transactions. At this week's session, we reviewed some on-going examples to set the stage for our next few weeks of work.
In case you missed it, here is the recording on YouTube
Getting Started with Cardano Go Development
A few of us had the chance to attend last week's Cardano Buidler Fest #1. At the event, Chris hosted a workshop on Cardano Go development, and he provided a Buidler Fest Workshop repo that is helpful for anyone learning how to build Cardano applications with Go.
At our live coding session, we reviewed some examples:
- /internal/txbuilder.go: here is a simple transaction built using Apollo and Bursa. it can be extended to include metadata. As we've discussed in earlier sessions, the end result is we get the raw bytes. After building a transaction, we can submit it with gOuroboros.
- /internal/txsubmit.go shows how gOuroboros can be used to submit transactions to a Cardano Node.
Notes:
- gOuroboros doesn't build transactions, it handles network interactions
- Bursa is a wrapper for Apollo, where a lot of great work is already done
Remember that transactions can be built anywhere and by any method! Once you have transaction bytes, then you can use those "on the wire" with gOuroboros.
Transaction Metadata Use Case
Last week, Manuel outlined a diagnostic tool that he is building. Read this blog post to learn more about the use case.
This week, Manuel answered some clarifying questions and we discussed how some of the examples listed above will support his work. The goal is to build a tool that sends simple transctions back and forth between a set of wallets.
He said that the Buidlerfest Workshop code "covers 70% of what I want to do". Regarding what timestamp to write into the metadata, Manuel described how metadata can include "some time in the future" when we plan on submitting the transaction. Then, transactions can be scheduled to be submitted at those corresponding times. This will create a record of data that serves all users of Cardano.
Mix's Example 1: Metadata
Next, Mix shared an example of how metadata can be added to a simple transaciton.
- Andamio CLI walletToWallet includes a simple transaction builder
- It includes an example of a programatic wallet built with Bursa
- We can use
SetShelleyMetadata
from Apollo - We can craft custom metadata using these structures and can follow up with a deeper dive into metadata in an upcoming session.
Mix's Example 2
In a previous live coding session, we discussed some of the challenges of building serialized transactions. This week, we took a deeper dive into the same issues.
In this case, we are looking at a transaction that unlocks UTxOs from more than one validator address.
Mix gave an overview of the bug he's currently exploring. To understand what's happening, we must distinguish between the Transaction Body and the Witness Set of a transaction. "The Witness Set is where we have issues," Mix explained. When we are spending a UTxO from a validator, we need to the redeemer indexes to match the order of the input UTxOs. The redeemers are included in the witness set, but for some reason, the indexes of these redeemers are sometimes not matching the appropriate input indexes.
What's confusing about the result is that the transaction is being built correctly and evaluated, which means that it's valid. Mix shows how the transaction build correctly, but strangely, how the order of these indexes is changing at the evaluateTx
step! We are trying to figure out why.
Once we understand it, we'll be able to implement some administrator transactions in Andamio CLI.
Next Steps:
- Documenting the Buidler Fest Workshop examples
- Outline how Starter Kits will be used in Cardano Go PBL
- Complete the Andamio CLI roadmap for the next 3 months
- Deeper dive into the zero withdrawal trick - Mix teased it at the end of the session - we can get a little deeper into it!
- Build transactions in Andamio CLI
Andamio CLI
Andamio consists of a set of inter-dependent validators that work together to deliver application functionality. End users of the application will interact with Andamio through a Web app, so any transaction that depend upon user input are being build in the front-end.
There are also some transactions that Andamio administrators will want to automate. These transactions are being built into Andamio CLI. Here are some examples:
- Creating a new Course on the Andamio Platform
- Creating new Learners Policy IDs for a specific Course on Andamio
About this Session
App developers and the libraries they use are growing up side by side. It's both thrilling and daunting to be a Cardano developer right now, and we find that getting together is helpful along the journey! That's why we meet on Mondays at 1300 for Cardano Go Live Coding.
Everyone is welcome. For links to Live Coding sessions visit: https://www.andamio.io/calendar