ThepurposeofthisprojectistosimplifythecreationandmaintenanceofpublicMoneronodes;speciallyonvirtualprivateservers,butingeneralonanylinuxmachinewhereyouhaveaccess.Wheremaintenanceinvolvesthefollowingtasks:
UpgradingMoneroversion.Enabling,disablingandupdatingflagspassedtomonerod.Extendingdiskspaceallocatedtostoretheblockchain.Theprojectaimsto:
Beassimpleaspossible.Bydefault,produceanodethatseedstheblockchain(publicnode).Produceasecureandstablesetup.Produceaninexpensivesetupbydefault.Makemaintenanceaseasyasposible.Allowcreatingmainnet,stagenetortestnetnodes.Theprojectdoesn'tintendtoproduceasetupoptimizedformining.
RequirementsPythonAnsibleAnsiblecollectionsdefinedinrequirements.yml.Installwiththefollowingcommand:ansible-galaxyinstall-rrequirements.ymlYoualsoneedtheappropriateAPIKeysfortheVPSprovider(Hetzner,DigitalOceanandVultronly,forthetimebeing),andpublicSSHkeytosetupintheserver.
LongtermgoalsExtendtobeabletosetupnodesinotherVPSproviders,besidesHetzner,DigitalOceanandVultrTorsetup.MaybeincludeautomatedCIsetup.UsageSetupthefollowingenvironmentvariables
HETZNER_API_KEY,ifyouintendtocreate/managenodesonHetznercloud(bydefault,thisprojectattemptstocreate1nodeonHetzner)DO_API_KEY,ifyouintendtocreate/managenodesonDigitalOceanVULTR_API_KEY,ifyouintendtocreate/managenodesonVultrPUBLIC_SSH_KEY_NAMEPUBLIC_SSH_KEYRun
ansible-playbook-ihosts.ymlsetup-nodes.ymltosetupyourconfigurednodesThatshouldcreate:
1publicMoneromainnetnode,onHetznercloud.Runningonthesmallestservertype(cx11:1vcpu,2gbram)Witha50GBvolumeattachedKeepingaprunedblockchainIt'dexposeport22forssh,port18080forp2p,andport18089forrestrictedRPCTheestimatedcostofthissetupislessthan6€/month
Furtherconfigurationcanbeachievedviaotherenvironmentvariables(they'relistedbelow),andthroughhosts.ymlfile(seeEXAMPLES.mdforreference)
EnvironmentvariablesreferenceHETZNER_API_KEY:YourAPIkeyforHetzner.It'snecessaryifyouconfiguredthecreation/maintenanceofnodesonHetznercloud(whichisthecase,bydefault).ItshouldbeanAPIkeywithreadandwritepermissions.
DO_API_KEY:YourAPIkeyforDigitalOcean.It'snecessaryifyouconfiguredthecreation/maintenanceofnodesonDigitalOceancloud.ItshouldbeanAPIkeywithreadandwritepermissions.
VULTR_API_KEY:YourAPIkeyforVultr.It'snecessaryifyouconfiguredthecreation/maintenanceofnodesonVultrcloud.
PUBLIC_SSH_KEY_NAME:AnameforyourpublicSSHkeyinHetzner
PUBLIC_SSH_KEY:YourpublicSSHkey.It'dbecreatedinHetznerandembeddedinyournode;tobeabletosetupthenode,andaccessitingeneral.
NETWORK_FLAG:
Emptybydefault,whichindicatesmainnet--stagenet--testnetHETZNER_REGION:TheHetznerdatacenterwherethenodeshouldbecreated.Defaultstofsn1.Seethisforcontext
HETZNER_SERVER_TYPE:ThetypeofHetznerservertocreateforthenode.Defaultstocx11,whichisthesmallestavailable.SeePricesSectionhere
HETZNER_IMAGE:TheHetznermachineimagetouseontheserver.Defaultstoubuntu-20.04.
HETZNER_VOLUME_GB_SIZE:Thesizeofhevolumethatwillholdtheblochain,expressedingb.Defaultsto50
DO_REGION:TheDigitalOceandatacenterwherethenodeshouldbecreated.Defaultstonyc1.Seethisforcontext
DO_SERVER_TYPE:ThetypeofDigitalOceandroplettocreateforthenode.Defaultstos-1vcpu-2gb,whichisthesmallestavailablewith2gbRAM.Seepricessectionhere
DO_IMAGE:TheDigitalOceanmachineimagetouseontheserver.Defaultstoubuntu-20-04-x64
DO_VOLUME_GB_SIZE:Thesizeofthevolumethatwillholdtheblockchain,expressedingb.Defaultsto50
VULTR_REGION:TheVultrregionwherethenodeshouldbecreated.DefaultstoNewJersey,becausethat'stheonlyVultrregionthatsupportsvolumes.
VULTR_SERVER_TYPE:ThetypeofVultrservertocreateforthenode.Defaultsto2048MBRAM,55GBSSD,2.00TBBW.ChecktheservertypesofferedbyVultrhere
VULTR_IMAGE:TheVultrmachineimagetouseontheserver.DefaultstoUbuntu20.04x64.Othersavailablelistedhere
VULTR_VOLUME_GB_SIZE:Thesizeofthevolumethatwillholdtheblockchain,expressedingb.Defaultsto50
MONERO_DESIRED_VERSION:TheversionofMonerothatthenodeshouldberunning.Defaultstov0.17.1.9atthemoment.
MONERO_DOWNLOAD_URL:TheURLwhereMoneroshouldbedownloadedfrom.Defaultstohttps://downloads.getmonero.org/cli/linux64
MONERO_DOWNLOAD_CHECKSUM:ThechecksumoftheMonerodownload,toverifyitsintegrity.DefaultstothechecksumofMonerov0.17.1.9atthemoment:sha256:0fb6f53b7b9b3b205151c652b6c9ca7e735f80bfe78427d1061f042723ee6381
PRUNED_NODE:Whetherthenodeshouldrunaprunedblockchain,tosavediskspace.DefaultstoTrue
ENABLE_DNS_BLOCKLIST:Whetherthenodeshouldrunwith--enabled-dns-blocklist.DefaultstoTrue.Seethisforcontext
LIMIT_RATE_UPandLIMIT_RATE_DOWN:LimittheuploadspeedavailabletotheMoneronode.Defaultstoempty,whichmeansthatthedefaultlimitsconfiguredbyMoneroapply.
OUT_PEERSandIN_PEERS:Limitthenumberofp2pconnections.Defaultstoempty,whichappliesthedefaultlimitsconfiguredbyMonero.
MEMORY_MAX:PreventsthenodefromusingmorethanthisamountofRAM.Otherwiseitgetsrestarted.Defaultsto1536M.Seesystemd'sdocsforcontext
MONERO_BAN_LIST_URL:Ifprovided,downloadsalistofIPsofMoneronodestoban.Defaultstoempty.
ANSIBLE_HOST_KEY_CHECKING:SettoFalsetoavoidhavingtomanuallyconfirmtheauthenticityofhostsshkeys.SeethisStackOverflowthreadforcontext
UpgradingMoneroVersionTheenvvarMONERO_DESIRED_VERSIONgovernstheversionofMonerowewantinstalledonthenode.Iftheversiondoesn'tmatch,thisprojectdownloadsMoneroagainfromMONERO_DOWNLOAD_URL.So,theprocessofupgradingyournodetothelatestversionwouldlooklike:
SetMONERO_DESIRED_VERSIONtothelatestversionSetMONERO_DOWNLOAD_CHECKSUMtothechecksumoftheversionyou'redownloading.ThisisprovidedonMonero'swebsiteRunthisprojectExtendingthevolumeallocatedtostoretheblockchainSimplyincreasingHETZNER_VOLUME_GB_SIZE,VULTR_VOLUME_GB_SIZEorDO_VOLUME_GB_SIZEshouldtakecareofextendingthevolumeandthefilesystem,fornodeshostedonHetzner,VultrandDigitalOcean,respectively.
AllocatingmorenetworkresourcesThisRedditthreadsuggeststhatincreasingOUT_PEERS,IN_PEERS,LIMIT_RATE_UP,LIMIT_RATE_DOWNwouldincreasethenode'scontributiontothenetwork,byconnectingtomorepeers,acceptingconcurrentconnectionsfrommorepeers,andallocatingmoreup/downbandwithtothenode.
Thesetupsuggestedinthatthreadcanbeachivedwith:
OUT_PEERS=512IN_PEERS=512LIMIT_RATE_UP=92160LIMIT_RATE_DOWN=92160Theextratrafficmightgenerateadditionalcoststhough.CheckPricingsectionof:
https://www.hetzner.com/cloudhttps://www.digitalocean.com/docs/billing/bandwidth/https://www.vultr.com/resources/faq/#bandwidthoveragerate
评论