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

Use HydraBuildList to provide latest release binaries (with fallback) #300

Merged
merged 4 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions docs/get-started/installing-cardano-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ sidebar_label: Installing cardano-node
description: This guide shows how to build and install the cardano-node and cardano-cli from the source-code for all major Operating Systems
image: ./img/og-developer-portal.png
---
import HydraBuildList from '@site/src/components/docs/HydraBuildList';

### Overview
### Overview

This guide will show you how to compile and install the `cardano-node` and `cardano-cli` into your operating system of choice, directly from the source-code. It will enable you to interact with the **Cardano** blockchain, including but not limited to sending/receiving **transactions**, creating **NFTs**, posting transaction **metadata** into the blockchain, minting/burning **native tokens**, creating a **stake pool**, executing **smart contracts**, and so much more!

:::note
If you want to avoid compiling the binaries yourself, You can download the latest pre-built binaries of `cardano-node` and `cardano-cli` from the links below.
If you want to avoid compiling the binaries yourself, you can download the latest versions of `cardano-node` and `cardano-cli` from the links below.

- [Linux](https://hydra.iohk.io/build/6263009)
- [MacOS](https://hydra.iohk.io/build/6263000)
- [Windows](https://hydra.iohk.io/build/6263143)
<HydraBuildList
latest="7408469"
linux="7408438"
macos="7408630"
win64="7408538"/>

The components can be built and run on **Windows** and **MacOS**, but we recommend that stake pool operators use **Linux** in production to take advantage of the associated performance advantages.
:::
Expand Down Expand Up @@ -411,4 +414,4 @@ Next, we will talk about how to [run cardano-node](running-cardano.md).

:::important
Currently, the **Windows** installation guide is still in progress. In the meantime, we recommend using [WSL (Windows Subsystem for Linux)](https://docs.microsoft.com/en-us/windows/wsl/) to get a Linux environment on top of Windows. Once installed, you can use the [Linux](#linux) guide to install and run `cardano-node` within **WSL**.
:::
:::
56 changes: 56 additions & 0 deletions src/components/docs/HydraBuildList/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React from "react";

export const BuildLink = ({ children, id }) => (
<a href={"https://hydra.iohk.io/build/" + id}>{children}</a>
);

export const BuildListItem = ({ children, id }) => (
<li><BuildLink id={id}>{children}</BuildLink></li>
);

class HydraBuildList extends React.Component {
constructor({ latest, linux, macos, win64 }) {
super()
this.state = {
isCurrent: false,
hasErrors: false,
latest: latest,
linux: linux,
macos: macos,
win64: win64
};
}
componentDidMount() {
fetch('https://api.github.com/repos/input-output-hk/cardano-node/releases/latest')
.then(resp => resp.json())
.then(json => json.body.match(/.*Hydra binaries]\((.*)#tabs-constituents\).*/)[1])
.then(link => {
let isCurrent = link.match(/\d+/) == this.state.latest
this.setState({ ...this.state.isCurrent, isCurrent })
return link
})
.then(link => {
let latest = link.match(/\d+.*/) + "#tabs-constituents"
this.setState({ ...this.state.latest, latest })
})
.catch(err => {
this.setState({err, hasErrors: true})
})
}
render() {
return (
<>
<ul>
<BuildListItem id={this.state.linux}>Linux</BuildListItem>
<BuildListItem id={this.state.macos}>MacOS</BuildListItem>
<BuildListItem id={this.state.win64}>Windows</BuildListItem>
</ul>
{!this.state.isCurrent
? (<p>There are newer binaries available: <ul><BuildListItem id={this.state.latest}>latest release</BuildListItem></ul></p>) : (<></>)
}
tweakch marked this conversation as resolved.
Show resolved Hide resolved
</>
);
}
}

export default HydraBuildList;