-
Notifications
You must be signed in to change notification settings - Fork 26
Add cardano-rpc package #885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
825e7a0 to
6c7069d
Compare
6c7069d to
0d02419
Compare
| unicode: never | ||
| respectful: false | ||
| fixities: [] | ||
| fixities: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think missing fixity information was causing weird formatting issues with lenses in your PRs, @palas . I think this should help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nice!
0d02419 to
44c2834
Compare
5ddf6a4 to
f5e18c6
Compare
.github/workflows/haskell.yml
Outdated
| - name: Setup tmate session | ||
| if: ${{ failure() }} | ||
| uses: mxschmitt/action-tmate@v3 | ||
| with: | ||
| limit-access-to-actor: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - name: Setup tmate session | |
| if: ${{ failure() }} | |
| uses: mxschmitt/action-tmate@v3 | |
| with: | |
| limit-access-to-actor: true | |
| # - name: Setup tmate session | |
| # if: ${{ failure() }} | |
| # uses: mxschmitt/action-tmate@v3 | |
| # with: | |
| # limit-access-to-actor: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, how were you using this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You uncomment this, and then the CI action waits infinitely printing a ssh command, which allows you to interactively log in and troubleshoot on the GHA runner.
https://github.com/IntersectMBO/cardano-api/actions/runs/16048917967/job/45286704820#step:18:48
388ba81 to
9a2fb9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR needs to be broken up into smaller pieces. I suggest:
- Open a PR with the dummy example.
- Open a PR per mini-protocol along with their protobuf files.
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| ghc: ["9.6", "9.12"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You weren't able to get it to build with 9.12?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, unfortunately no. I suspect the situation will improve once there will be stackage snapshot with 9.12, which means more of haskell packages will work with 9.12. Do we need 9.12 at this moment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nop we don't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @erikd
|
|
||
| - name: "[Windows] Install grpc dependencies" | ||
| if: runner.os == 'Windows' | ||
| run: /usr/bin/pacman --noconfirm -S mingw-w64-x86_64-snappy mingw-w64-x86_64-protobuf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
.github/workflows/haskell.yml
Outdated
| - name: Setup tmate session | ||
| if: ${{ failure() }} | ||
| uses: mxschmitt/action-tmate@v3 | ||
| with: | ||
| limit-access-to-actor: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, how were you using this?
| // Represents a set of witnesses that validate a transaction | ||
| message WitnessSet { | ||
| repeated VKeyWitness vkeywitness = 1; // List of VKey witnesses. | ||
| repeated Script script = 2; // List of scripts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redeemers and bootstrap witnesses should also be here.
|
|
||
| // Represents a transaction in the Cardano blockchain. | ||
| message Tx { | ||
| repeated TxInput inputs = 1; // List of transaction inputs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment with the currently outstanding fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't want to do that. I can mark them in haskell code, but I would like to keep the proto files identical to source files in UTxO RPC spec.
| NewConstitutionAction new_constitution_action = 6; // Replace the Constitution | ||
|
|
||
| // TODO: revisit if there's a better way to handle this option because it doesn't actually need a value but proto syntax needs to require it | ||
| uint32 info_action = 7; // Info action should just be the integer number 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not:
diff --git a/cardano-rpc/proto/utxorpc/v1alpha/cardano/cardano.proto b/cardano-rpc/proto/utxorpc/v1alpha/cardano/cardano.proto
index e15f60eff..c96103366 100644
--- a/cardano-rpc/proto/utxorpc/v1alpha/cardano/cardano.proto
+++ b/cardano-rpc/proto/utxorpc/v1alpha/cardano/cardano.proto
@@ -129,7 +129,7 @@ message GovernanceAction {
NewConstitutionAction new_constitution_action = 6; // Replace the Constitution
// TODO: revisit if there's a better way to handle this option because it doesn't actually need a value but proto syntax needs to require it
- uint32 info_action = 7; // Info action should just be the integer number 6
+ InfoAction info_action = 7; // Info action should just be the integer number 6
}
}
@@ -163,6 +163,8 @@ message NoConfidenceAction {
GovernanceActionId gov_action_id = 1;
}
+message InfoAction {}
+
message UpdateCommitteeAction {
GovernanceActionId gov_action_id = 1;
repeated StakeCredential remove_committee_credentials = 2; // Committee members to remove (if any)
| } | ||
|
|
||
| message TreasuryWithdrawalsAction { | ||
| repeated WithdrawalAmount withdrawals = 1; // A map of the withdrawals to make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would make a list
| // Represents a native script in Cardano. | ||
| message NativeScript { | ||
| oneof native_script { | ||
| bytes script_pubkey = 1; // Script based on an address key hash. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
script_pubkey_hash?
d1c9c89 to
99bd26b
Compare
4b5d1b8 to
9ad6d49
Compare
Jimbo4350
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
| } = do | ||
| let isEnabled = fromMaybe False mIsEnabled | ||
| -- default to a some non-existing path. Does not matter if the gRPC endpoint is disabled | ||
| nodeSocketPath = fromMaybe "./node.socket" mNodeSocketPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Abstracting this as a separate value (as we do for the node configuration) would be clearer IMO.
37851af to
e77348c
Compare
e77348c to
e5a011d
Compare
e5a011d to
30b9187
Compare
Changelog
Context
This PR adds new
cardano-rpccabal module.It is not buildable with GHC 9.12 yet, so in GHA GHC 9.10 is used instead.
Tested in: IntersectMBO/cardano-node#6205
Checklist