-
Notifications
You must be signed in to change notification settings - Fork 62
Add support for spinning up a cardano stack #338
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5b8b79d
Start generating cardano stacks
SupernaviX a53f0e7
Start up and connect to cardano connector
SupernaviX cd22d27
Support running against local nodes/testnets
SupernaviX fca6e00
Support newer firefly-cardano images
SupernaviX 5471acc
fix: fix linter issues
SupernaviX 0519637
feat: set up contracts
SupernaviX 79fed77
fix: fix copyright notices
SupernaviX 1cd9511
feat: remove hard-coded image names
SupernaviX 15d5a2b
fix: fix issues from code review
SupernaviX 2811f8b
fix: don't require passing a member count of 1
SupernaviX 2090fc6
Merge branch 'main' into cardano
SupernaviX c5e41c9
Empty commit to trigger CI
SupernaviX b41b3e0
Update config
SupernaviX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // Copyright © 2025 IOG Singapore and SundaeSwap, Inc. | ||
| // | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| package cmd | ||
|
|
||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "path/filepath" | ||
|
|
||
| "github.com/hyperledger/firefly-cli/internal/log" | ||
| "github.com/hyperledger/firefly-cli/internal/stacks" | ||
| "github.com/hyperledger/firefly-cli/pkg/types" | ||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| var initCardanoCmd = &cobra.Command{ | ||
| Use: "cardano [stack_name]", | ||
| Short: "Create a new FireFly local dev stack using a Cardano blockchain", | ||
| Long: "Create a new FireFly local dev stack using a Cardano blockchain", | ||
| Args: cobra.MaximumNArgs(1), | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| ctx := log.WithVerbosity(context.Background(), verbose) | ||
| ctx = log.WithLogger(ctx, logger) | ||
| stackManager := stacks.NewStackManager(ctx) | ||
| initOptions.BlockchainProvider = types.BlockchainProviderCardano.String() | ||
| initOptions.BlockchainConnector = types.BlockchainConnectorCardanoConnect.String() | ||
| initOptions.BlockchainNodeProvider = types.BlockchainNodeProviderRemoteRPC.String() | ||
| initOptions.TokenProviders = []string{} | ||
| initOptions.MultipartyEnabled = false | ||
| if len(args) == 1 { | ||
| // stacks are enforced to have 1 member | ||
| args = append(args, "1") | ||
| } | ||
| if err := initCommon(args); err != nil { | ||
| return err | ||
| } | ||
| if err := stackManager.InitStack(&initOptions); err != nil { | ||
| if err := stackManager.RemoveStack(); err != nil { | ||
| return err | ||
| } | ||
| return err | ||
| } | ||
| fmt.Printf("Stack '%s' created!\nTo start your new stack run:\n\n%s start %s\n", initOptions.StackName, rootCmd.Use, initOptions.StackName) | ||
| fmt.Printf("\nYour docker compose file for this stack can be found at: %s\n\n", filepath.Join(stackManager.Stack.StackDir, "docker-compose.yml")) | ||
| return nil | ||
| }, | ||
| } | ||
|
|
||
| func init() { | ||
| initCardanoCmd.Flags().StringVar(&initOptions.Network, "network", "mainnet", "The name of the network to connect to") | ||
| initCardanoCmd.Flags().StringVar(&initOptions.Socket, "socket", "", "Socket to mount for the cardano node to connect to") | ||
| initCardanoCmd.Flags().StringVar(&initOptions.BlockfrostKey, "blockfrost-key", "", "Blockfrost key") | ||
|
|
||
| initCmd.AddCommand(initCardanoCmd) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.