Vanitygen doesn't accept pool url as parameter , Basically I want to join vanity pool vanitypool.appspot.com using cpu mining
You'd need a build of oclvanityminer64(.exe) without the OpenCL requirement - or see if your CPU shows up as an OpenCL device and select it specifically with the -D parameter.
In lieu of that, you can always set it up manually with vanitygen(.exe) or with some dirty bits of code - it's just http get/post to the pool anyway. Edit: actually, I seem to recall that they're both http get.
Edit 2: Just to show how simple it could be done (no error checking/optimization/etc.), a bit of AutoIt code that polls the most popular vanitypool server for work, selects either the most lavish or the shortest entry, and attempts to mine it. A tiny GUI shows what's being mined, and feedback from vanitygen. Consider it BSD-style licensed, so do with it what you will; try not to quote the entire post if you just want to point out corrections/etc. though, saves legacy code popping up for people from the future.
; ==================================================
; Vanitygen simpleton mining front-end v0.01
; https://bitcointalk.org/index.php?topic=25804.msg11084323#msg11084323
;
; v0.01 - 2015/04/14
; Initial version. Largely untested, mostly because there's no server to test against for matches.
; Matches are always saved, however - see configuration below - so you can always try to manually submit.
; ~ TheRealSteve
;
; Requires: AutoIt - https://www.autoitscript.com/site/autoit/
; ==================================================
; ========== Configuration ==========
; SET YOUR ADDRESS HERE
$xsPayAddress = "1BitcoinEaterAddressDontSendf59kuE"
; Do you want to mine 1. the most lavish (best payout over average time taken)
; Or do you want to mine 2. the shortest (faster solves)
; NOTE: Unlike oclvanityminer, this script does not take into account searching for multiple vanities under the same keypart!
$xiMineTarget = 2
; Check for work every how many minutes?
$xiWorkInterval = 15
; Where's vanitygen stored? No dir = same dir as script.
; You can also use this to specify oclvanitygen with OpenCL parameters
$xfVanitygen = "vanitygen64.exe"
; $xfVanitygen = "oclvanitygen64.exe -p 1"
; Where to store the server's getWork result? No dir = same dir as script.
$xfGetWork = "getwork.lst"
; Where to store list of submitted results and server responses? No dir = same dir as script.
; File format:
; URL submitted
; first line of server response - OK! = accepted, supposedly.
$xfPostWork = "postwork.lst"
; Temporary file name? No dir = same dir as script.
$xfTempFile = "vanity.tmp"
; ========== Script ==========
; Don't modify anything here unless you know what you're doing
#include
#include
; Set up a little GUI
Opt("GUIOnEventMode", 1)
GUICreate("Vanitygen simpleton mining front-end v0.01", 400, 50)
Global $guiMiningLabel = GUICtrlCreateLabel("Now mining: ", 30, 10, 350)
Global $guiVanitygenLabel = GUICtrlCreateLabel("- waiting for vanitygen output -", 30, 24, 350)
Global $guiVanitygenLabel = GUICtrlCreateLabel("Payment to: " & $xsPayAddress, 30, 24, 350)
GUISetOnEvent($GUI_EVENT_CLOSE, "fnCloseButton")
GUISetState(@SW_SHOW)
Global $iVanitygenPid
OnAutoItExitRegister("fnCleanup")
While (1) ; Infinite loops are awesome.
; some variables
Local $sLavishVanity
Local $sLavishKey
Local $iLavishByte
Local $fLavishValue = 0
Local $sShortVanity
Local $iShortVanityLen = 32
Local $sShortKey
local $iShortByte
Local $fShortValue
Local $sWorkVanity
Local $iWorkByte
Local $sWorkKey
; Get work from the server
If (FileExists($xfGetWork)) Then
FileDelete($xfGetWork)
EndIf
InetGet ("https://vanitypool.appspot.com/getWork", $xfGetWork)
$hGetwork = FileOpen($xfGetWork)
; Parse the work to find the most lavish single entry, and the shortest single entry
$aWorkEntries = FileReadToArray($hGetwork)
For $sWorkEntry In $aWorkEntries
Local $aEntryElements = StringSplit($sWorkEntry,":") ; Split work entry into constituent parts
Local $_sVanity = $aEntryElements[1]
Local $_sKey = $aEntryElements[2]
Local $_iByte = $aEntryElements[3]
Local $_fLavishness = $aEntryElements[4]
If (StringRight($_fLavishness,1) == ";") Then
$_fLavishness = StringTrimRight($_fLavishness,1) ; remove trailing semicolon if there was no comment following (optional at this time anyway)
EndIf
; Check for shortest work entry
Local $iVanityLen = StringLen($_sVanity)
If (StringLeft($_sVanity,3) <> "111") Then ; None of that repeating ones stuff that throws off calculations.
If (($iVanityLen < $iShortVanityLen) Or (($iVanityLen == $iShortVanityLen) And ($_fLavishness > $fShortValue))) Then
$sShortVanity = $_sVanity
$iShortVanityLen = $iVanityLen
$sShortKey = $_sKey
$iShortByte = $_iByte
$fShortValue = $_fLavishness
EndIf
EndIf
; Check for most lavish work entry
If ($_fLavishness > $fLavishValue) Then
$fLavishValue = $_fLavishness
$sLavishVanity = $_sVanity
$iLavishByte = $_iByte
$sLavishKey = $_sKey
EndIf
Next
FileCLose($hGetwork)
; Decide which vanity to mine for
; Why isn't this optimized into the above? Because this way the GUI can be extended with some radiobuttons to switch modes, if desired, without re-polling.
If ($xiMineTarget == 1) Then
$sWorkVanity = $sLavishVanity
$sWorkKey = $sLavishKey
$iWorkByte = $iLavishByte
ELseif ($xiMineTarget == 2) Then
$sWorkVanity = $sShortVanity
$sWorkKey = $sShortKey
$iWorkByte = $iShortByte
EndIf
; overrides for testing
; $sWorkVanity = "1abc"
; $sWorkKey = "NotAKey"
; $iWorkByte = 0
; Begin mining
If (FileExists($xfTempFile)) Then
FileDelete($xfTempFile)
EndIf
GuiCtrlSetData($guiMiningLabel,"Now mining: " & $sWorkVanity)
$iVanitygenPid = Run($xfVanitygen & " -F compressed -P "&$sWorkKey&" -X "&$iWorkByte&" -o "&$xfTempFile&" "&$sWorkVanity,@ScriptDir,@SW_HIDE,$STDOUT_CHILD)
$iDelayProcessCheck = 250 ; Check for the process every 0.25s
$iDelayWorkPoll = $xiWorkInterval*60*1000 ; Check for work every $xiWorkInterval minutes
For $iDelayCounter = 0 To $iDelayWorkPoll Step $iDelayProcessCheck
; Inaccurate, but it'll do.
sleep($iDelayProcessCheck)
; Let's see what vanitygen has to say...
$sStdOut = StdoutRead($iVanitygenPid)
$aStdOut = StringSplit($sStdOut,@CRLF)
If ($aStdOut[0] >= 2) Then
GuiCtrlSetData($guiVanitygenLabel,$aStdOut[$aStdOut[0]])
EndIf
; If vanitygen exited early
If (Not ProcessExists($iVanitygenPid)) Then
; Maybe it found something!
If (FileExists($xfTempFile)) Then
$sPrivKey = StringTrimLeft(FileReadLine($xfTempFile,3),13) ; This is what we need, the generator part private key
FileDelete($xfTempFile)
Local $url = "https://vanitypool.appspot.com/solve?key=" &$sWorkVanity&":"&$sWorkKey&"&privateKey="&$sPrivKey&"&bitcoinAddress=" & $xsPayAddress
FileWriteLine($xfPostWork,"Input : " & $url)
InetGet($url,$xfTempFile,1)
FileWriteLine($xfPostWork,"Output: " & FileReadLine($xfTempFile,1))
FileDelete($xfTempFile)
EndIf
; Otherwise the user probably killed the process, or it crashed, or something.
; Either way, let's exit the process check loop
ExitLoop
EndIf
Next
; We've waited $xiWorkInterval minutes, kill vanitygen (if running)
fnCleanup()
; And start anew!
WEnd
; Called when getting new work, and when exiting the script - makes sure vanitygen is closed, files are cleaned up
Func fnCleanup()
If (ProcessExists($iVanitygenPid)) Then
ProcessClose($iVanitygenPid)
EndIf
If (FileExists($xfTempFile)) Then
FileDelete($xfTempFile)
EndIf
EndFunc
; Closed the GUI? Then we better exit (the exit handler already takes care of cleanup)
Func fnCloseButton()
Exit
EndFunc