Skip to content
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

The hydra node can publish hydra scripts via blockfrost using --blockfrost #1668

Open
4 tasks
Tracked by #1305
noonio opened this issue Sep 30, 2024 · 0 comments
Open
4 tasks
Tracked by #1305
Assignees
Labels
amber ⚠️ Medium complexity or partly unclear feature 💬 feature A feature on our roadmap

Comments

@noonio
Copy link
Contributor

noonio commented Sep 30, 2024

Why

As Hydra moves towards using Blockfrost as a chain layer, we need to extend the functionality to publish Hydra scripts via the Blockfrost API. This follows up on #1305 and builds upon our initial exploration on #1631.

What

Introduce the capability to publish Hydra scripts using Blockfrost as follows:

mkdir -p blockfrost-demo/
curl localhost:4001/protocol-parameters > blockfrost-demo/protocol-parameters.json

function publishScripts() {
  nix run .#hydra-node -- publish-scripts \
    --blockfrost 0.0.0.0:4001 \
    --project-path "file_path_project_token_hash" \
    --cardano-signing-key blockfrost-demo/wallet.sk
}

export HYDRA_SCRIPTS_TX_ID_ON_BLOCKFROST="$(publishScripts)"

How

Taking the inception spike as inspiration, we need to:

  • Refactor PublishOptions to support Blockfrost options:
    newtype PublishOptions = PublishOptions
      { publishChainConfig :: ChainConfig }
      deriving stock (Show, Eq)
    
    data ChainConfig
      = Offline OfflineChainConfig
      | Direct DirectChainConfig
      | Blockfrost BlockfrostChainConfig
      deriving stock (Eq, Show, Generic)

The path to the Blockfrost project token hash will be passed as part of these new options.

  • Add Hydra/Chain/Blockfrost/Client.hs to handle transaction building using the Blockfrost API.

  • Add Hydra/Chain/Blockfrost/ScriptRegistry.hs to manage Hydra script publishing via Blockfrost.

  • Extend hydra-node/Main.hs to support publishing scripts using the modules above.

@noonio noonio mentioned this issue Sep 30, 2024
7 tasks
@noonio noonio added amber ⚠️ Medium complexity or partly unclear feature 💬 feature A feature on our roadmap labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amber ⚠️ Medium complexity or partly unclear feature 💬 feature A feature on our roadmap
Projects
Status: No status
Development

No branches or pull requests

2 participants