Skip to content
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
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ NODE_INP_URL_ACTIVE=
NODE_DEX_URL_ACTIVE=
NODE_OUT_URL_ACTIVE=
NODE_REF_URL_ACTIVE=
NODE_BTC_INP_URL_ACTIVE=
NODE_BTC_OUT_URL_ACTIVE=
NODE_WALLET_PASSWORD=
DEX_WALLET_ADDRESS=
OUT_WALLET_ADDRESS=
Expand Down
13 changes: 10 additions & 3 deletions infrastructure/Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Infrastructure Deployment
1. Update parameter files (stash)
1. Update parameter files
1. Temp: Update JWT secret
1. Do deployment: `az deployment group create -g rg-dfx-api-{env} -f infrastructure/bicep/dfx-api.bicep -p infrastructure/bicep/parameters/{env}.json`
1. Loc: remove unused resources (API app service, app insights)
1. Dev: remove unused resources (INT node), node url app configuration
1. Loc: remove unused resources (API app service + plan, app insights)
1. Dev: remove unused resources (INT node), node url app configuration

# BTC Node Setup
1. Connect to BTC node: `ssh dfx@vm-dfx-btc-{type}-{env}.westeurope.cloudapp.azure.com`
1. Create scripts (`setup.sh` and `start.sh` from `infrastructure/scripts/btc`) and make them executable (`chmod +x {file}`)
1. Execute setup script: `sudo ./setup.sh`
1. Copy content of config file (`infrastructure/config/{env}.conf`) to virtual machine (`.bitcoin/bitcoin.conf`)
1. Start the node: `./start.sh`
96 changes: 96 additions & 0 deletions infrastructure/bicep/btc-node.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// --- PARAMETERS --- //
param location string

param pipName string
param vmName string
param vmDiskName string
param nicName string

param vmUser string
@secure()
param vmPassword string

param subnetId string


// --- RESOURCES --- //
resource pip 'Microsoft.Network/publicIPAddresses@2020-11-01' = {
name: pipName
location: location
sku: {
name: 'Standard'
}
properties: {
publicIPAllocationMethod: 'Static'
dnsSettings: {
domainNameLabel: vmName
}
}
}

resource nic 'Microsoft.Network/networkInterfaces@2020-11-01' = {
name: nicName
location: location
properties: {
ipConfigurations: [
{
name: 'ipconfig1'
properties: {
privateIPAllocationMethod: 'Dynamic'
publicIPAddress: {
id: pip.id
}
subnet: {
id: subnetId
}
}
}
]
}
}

resource vm 'Microsoft.Compute/virtualMachines@2022-03-01' = {
name: vmName
location: location
properties: {
hardwareProfile: {
vmSize: 'Standard_B2s'
}
storageProfile: {
imageReference: {
publisher: 'canonical'
offer: '0001-com-ubuntu-server-focal'
sku: '20_04-lts-gen2'
version: 'latest'
}
osDisk: {
name: vmDiskName
createOption: 'FromImage'
caching: 'ReadWrite'
managedDisk: {
storageAccountType: 'StandardSSD_LRS'
}
diskSizeGB: 1023
Comment thread
Krysh90 marked this conversation as resolved.
}
}
osProfile: {
computerName: vmName
adminUsername: vmUser
adminPassword: vmPassword
}
networkProfile: {
networkInterfaces: [
{
id: nic.id
}
]
}
diagnosticsProfile: {
bootDiagnostics: {
enabled: true
}
}
}
}

output url string = 'http://${nic.properties.ipConfigurations[0].properties.privateIPAddress}:8332'
8 changes: 8 additions & 0 deletions infrastructure/bicep/defi-node.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ param hasBackup bool


// --- RESOURCES --- //
resource fileShareA 'Microsoft.Storage/storageAccounts/fileServices/shares@2021-04-01' = {
name: '${storageAccountName}/default/${fileShareNameA}'
}

resource fileShareB 'Microsoft.Storage/storageAccounts/fileServices/shares@2021-04-01' = {
name: '${storageAccountName}/default/${fileShareNameB}'
}

resource appServicePlan 'Microsoft.Web/serverfarms@2018-02-01' = {
name: servicePlanName
location: location
Expand Down
Loading