-
Notifications
You must be signed in to change notification settings - Fork 178
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
Support for Mithril Signer deployment. #1693
Support for Mithril Signer deployment. #1693
Conversation
8331eeb
to
4722705
Compare
d77aef0
to
5d4a746
Compare
5d4a746
to
1c8ad58
Compare
I opened #1694 to address the pre-merge check failures observed in this PR. |
With commit 9b82d64 the environment file contains each variable required for the cnode-mithril-signer.service to start once the node is up. I was hoping to just source In the end, it seemed simplest that since
|
I believe the final check failures are due to opening the PR from my forked branch (origin), instead of my push being to cardanocommunity (upstream), leading to the premerge expecting the branch/commit to come from upstream but not existing. |
I pushed the branch from my fork upstream and ran a manual premerge workflow which was completed successfully. |
@rdlrt @Scitz0 The mithril signer service.env takes a single RELAY_ENDPOINT and For Production an HA option exists with Would you like this added to this PR for review or make a new PR after this branch reaches approval and merges? |
Up to you, happy to use this PR itself so they're merged together |
Commit cherry-picked into this branch, I think the trunk (flake8) formatting adjusted the layout so it may not match indenting etc. for existing scripts. I'll fix that, and other general linter suggestions, prior to merge. |
Improve status updates about installation and service starts.
The one thing that is important to add to the scripts themselves is docs addition. Describe how the scripts should be used and how it all ties together. Doesn't have to explain Mithril itself except for one or two high-level sentences. Can then link to https://mithril.network/doc/ for more information. As I have mentioned before I have yet to take the time to read up on Mithril so my knowledge isn't extensive yet. |
Agreed. Once the logic and script functionality is approved I'll include a commit for Documentation before merge.
mithril-signer and mithril-relay in this instance. For a naive deployment (testnets) the Mithril signer can be directly on a Cardano relay node, using For a production deployment the Mithril signer should be on the block producer node using
Potentially, if that's something the guild would like. Automating the download of snapshots and extracting them could be done. I could see this as a It could be directly at the cnode.sh level, using a flag like ENABLE_MITHRIL_CLIENT. When true cnode.sh calls mithril-client.sh which either gets the needed snapshots and exits or decides no snapshots are needed and exits, returning to cnode.sh Otherwise to not touch cnode.sh it could be a Systemd only option which |
I'm a bit split on the best deployment for this. But I'm leaning towards the second option to add an ExecStartPre override. This would be a cleaner option keeping it totally separate from normal deployment. |
Mithril client is responsible for restoring the Cardano blockchain on an empty node from a certified snapshot. this was the logic I intended to have the script follow. @Scitz0 Unless you think the script should attempt to determine how far out of sync a node is, when it already has content in the DB folder, and whether to rely on block synchronization or get a new Mithril snapshot? To be honest I've not spent much time thinking about how to determine this when |
My idea was only as an initial fresh deployment, not to keep track of sync state. I think we can keep it easy like this. I'm also in theory fine with just adding it to cnode.sh if priyank feels this is ok as well. |
@rdlrt What do you think?
The latter definitely gives the most coverage with identical behavior. The only question, if we go with the latter, is should the check for an empty |
I think everything related to mithril, ie if db is empty or not should be a job for Other than this I think the cnode.sh route is preferred as you mention, else manual execution of cnode.sh wouldn't work the same way as systemd deployed version of cnode.sh. |
Great, thats what I did in my local branch. I'll do some more tests this evening and get it pushed. |
@Scitz0 @rdlrt I've pushed the commit with
While it is somewhat cyclical it should result in essentially an identical NETWORK variable as already used by the container |
consistent usage menu and getopts handling between scripts
The successfull pre-merge check (manually run) summary is available in this job https://github.com/cardano-community/guild-operators/actions/runs/6708797371 |
Adds support to download, install, and set up a mithril-signer for the appropriate network. Includes changes to
deploy-as-systemd.sh
to provide an option to run it as a Systemd service.New scripts
mithril-client.sh
-d
downloads the latest mithril snapshot-u
creates or updates the environment file.deploy-as-systemd.sh
, ormithril-signer.sh -u
directly, to define a complex mithril environment with a mithril relay (or the sidecar)mithril-signer.sh
ogmios.sh
format such that it can be used to start the mithril signer.-d
sets up the Systemd service unit.-u
creates or updates the environment file.mithril-relay.sh
-d
-l
Additional Details
mithril_release
set to 2337.0.The mithril relay and squid configuration comes from Mithril docs. The HA setup via an nginx sidecar is a Proof of Concept at the moment. I have tested with a single relay, but not yet with the sidecar and multiple relays.