Thenodejs-poolisbuiltaroundasmallseriesofcoredaemonsthatshareaccesstoasingleLMDBtablefortrackingofshares,withMySQLbeingusedtocentralizeconfigurationsandensuresimpleaccessfromlocal/remotenodes.Thecoredaemonsfollow:
api-MainAPIforthefrontendtouseandpulldatafrom.Expectstobehostedat/remoteShare-MainAPIforconsumingsharesfromremote/localpools.Expectstobehostedat/leafApipool-Wheretheminersconnectto.longRunner-Databasesharecleanup.payments-Handlesallpaymentstoworkers.blockManager-UnlocksblocksanddistributespaymentsintoMySQLworker-Doesregularprocessingofstatisticsandsendsstatuse-mailsfornon-activeminers.APIlistensonport8001,remoteSharelistenson8000
moneroocean.stream(Thereferenceimplementation)usesthefollowingsetup:
https://moneroocean.streamishostedonitsownserver,asthemainwebsiteisastaticfrontendhttps://api.moneroocean.streamhostsapi,remoteShare,longRunner,payments,blockManager,worker,asthesemustallbehostedwithaccesstothesameLMDBdatabase.SampleCaddyfileforAPI:
https://api.moneroocean.stream{proxy/leafApi127.0.0.1:8000proxy/127.0.0.1:8001corsgzip}Itiscriticallyimportantthatyourwebserverdoesnottruncatethe/leafApiportionoftheURLfortheremoteSharedaemon,oritwillnotfunction!LocalpoolserversDOusetheremoteSharedaemon,asthisprovidesabufferincaseofanerrorwithLMDBoranotherbugwithinthesystem,allowingsharesandblockstoqueueforsubmissionassoonastheleafApi/remoteSharedaemonsarebackupandrespondingwith200's.
SetupInstructionsServerRequirements4GbRam2CPUCores(withAES_NI)60GbSSD-BackedStorage-Ifyou'redoingamulti-serverinstall,theleafnodesdonotneedthismuchstorage.Theyjustneedenoughstoragetoholdtheblockchainforyournode.Thepoolcomesconfiguredtouseupto24GbofstorageforLMDB.AssumingyouhavethelongRunnerworkerrunning,itshouldnevergetnearthissize,butbeawarethatit/can/bloatreadilyifthingserror,sobereadyforthis!Notably,thishappenstobeapproximatelythesizeofa4Gblinodeinstance,whichiswherethemajorityofautomateddeploymenttestinghappened!Pre-DeployIfyou'replanningonusinge-mail,you'llwanttosetupanaccountathttps://mailgun.com(It'sfreefor10ke-mails/month!),soyoucannotifyminers.Thisalsoservesasthebackendforpasswordresetemails,alongwithothersortsofe-mailsfromthepool,includingpoolstartup,poolMoneroddaemonlags,etcsoit'shighlysuggested!Pre-Generatethewallets,ordon't,it'suptoyou!You'llneedtheaddressesaftertheinstalliscomplete,soI'dsuggestmakingsureyouhavethemavailable.Informationonsuggestedsetupsarefoundbelow.Ifyou'regoingtobeofferingPPS,PLEASEmakesureyouloadthepoolwalletwithXMRbeforeyougettoofaralong.YourpoolwilltriggerPPSpaymentsonitsown,andfairlyreadily,soyouneedsomefloatinthere!Makeanon-rootuser,andruntheinstallerfromthere!DeploymentviaInstallerAddyouruserto/etc/sudoers,thismustbedonesothescriptcansudoupanddoit'sjob.Wesuggestpasswordlesssudo.Suggestedline:<USER>ALL=(ALL)NOPASSWD:ALL.Oursamplebuildsuse:pooldaemonALL=(ALL)NOPASSWD:ALLRunthedeployscriptasaNON-ROOTUSER.Thisisveryimportant!Thisscriptwillinstallthepooltowhateveruserit'srunningunder!Also.Gogetacoffee,thissuckerbootstrapsthemoneroinstallation.Onceit'scomplete,changeasconfig.jsonappropriate.Itispre-loadedforalocalinstallofeverything,runningon127.0.0.1.Thiswillworkperfectlyfineifyou'reusingasinglenodesetup.You'llalsowanttosetbind_iptotheexternalIPofthepoolserver,andhostnametotheresolvablehostnameforthepoolserver.pool_idismostlyusedformulti-serverinstallationstoprovideuniqueidentifiersinthebackend.Youwillalsowanttorun:source~/.bashrcThiswillactivateNVMandgetthingsworkingforthefollowingpm2steps.You'llneedtochangetheAPIendpointforthefrontendcodeinthepoolui/build/globals.jsandpoolui/build/globals.default.js--Thiswillusuallybehttp(s)://<yourserverFQDN>/apiunlessyoutweakcaddy!Thedefaultdatabasedirectory/home/<username>/pool_db/isalreadybeencreatedduringstartup.Ifyouchangethedb_storage_pathjustmakesureyouruserhaswritepermissionsfornewpath.Run:pm2restartapitoreloadtheAPIforusage.Hopintothewebinterface(Shouldbeathttps://<yourserverIP>/admin.html),thenloginwithAdministrator/Password123,MAKESURETOCHANGETHISPASSWORDONCEYOULOGIN.<-Thisstepiscurrentlynotactive,we'rewaitingforthefrontendtocatchup!HeaddowntotheManualSQLConfigurationtotakealookatwhatneedstobedonebyhandfornow.Fromtheadminpanel,youcanconfigureallofyourpool'ssettingsforaddresses,paymentthresholds,etc.Onceyou'rehappywiththesettings,goaheadandstartallthepooldaemons,commandsfollow.
评论