Provision a SSH'able dev box in the cloud that is ready for Cardano development. This is one of the approaches as described in the guide Lovelace Academy - Getting Started - Running a Full Cardano Node.
Azure CLI and Terraform are cross-platform tools so you can run the same commands across different CPU architectures and OS's.
- Login with
az login
- If required, set your relevant subscription
az account set --subscription ${YOUR_SUBSCRIPTION}
(verify usingaz account show
) - Create
rg-vars.tfvars
variable assignment file with your variables (see rg-vars.tf for reference). Example:
ssh-allowlist = ["20.86.228.51"] # Your local IP address
location = "northeurope"
resource-prefix = "lla-tn-eun-dev"
storage-prefix = "llatneuncdb"
cdbvm-username = "sa"
cdbvm-size = "Standard_D4as_v4"
cdbvm-nic-accelerated-networking = true
cdbvm-comp-name = "cdb"
# Tags
tag-stage = "testnet"
- Run
terraform init
- Run
terraform plan -var-file rg-vars.tfvars
- If the output looks good, run
terraform apply -var-file rg-vars.tfvars -auto-approve
- This will take about 2 minutes to provision the whole infrastructure and spit out the output parameters
sshpvk
andcdbpip
. - Save the SSH private key to a file using
terraform output sshpvk > ssh.pem
for Linux orterraform output sshpvk | Set-Content ssh.pem
for Windows (powershell required)
Using the SSH key output from Terraform, ensure the relevant security rules are applied with the key prep scripts below.
chmod 400 ssh.pem
$path = "ssh.pem";
icacls.exe $path /reset;
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)";
icacls.exe $path /inheritance:r;
ssh -i ssh.pem sa@20.54.24.228
where 20.54.24.228 should be replaced by the output from terraform output cdbpip
and sa should be replaced by the value of variable cdbvm-username
in rg-vars.tfvars
.
Note: If you are using Windows, ensure you have OpenSSH
It is easy using the Remote - SSH extension in Visual Studio Code because it has both an integrated terminal and a full IDE for code manipulation.
If you are unable to SSH to the newly created VM please check the SSH NSG ("${var.resource-prefix}-dev-nsg"
) rule in the Azure Portal and ensure your current IP is included. Don't forget to follow the steps in SSH key prep
above too.
You can simply run init.sh to set the VM up with all the required dependencies and the files required to run a full Cardano node. You can choose to switch between testnet (default) and mainnet networks by commenting/uncommenting the relevant segments. This file can also be used locally in a fresh Linux environment.
git clone https://github.com/LovelaceAcademy/CardanoDevBox.git
cd CardanoDevBox
bash init.sh