Command line interface

AcysbibAcysbib Member Posts: 54
So.... How exactly do I run commands on geth? Nothing seems to work at all.... Geth itself doesn't allow for keystrokes.... And command doesn't recognize "geth"

Comments

  • AcysbibAcysbib Member Posts: 54
    Running on Windows ten, crappy laptop, and zero skill with command... So... No idea what I am doing, I just want geth to sync properly so I can create a desktop wallet.....

    Also, does anyone know for to force my computer to try a different node? It loads blocks super slow... 3-20 at a time most of the time... And then it kicks off saying sync failed: no peers
  • AcysbibAcysbib Member Posts: 54
    Not trying to mine ETH on this laptop, that's what I've got the rig for.... But if I cannot get it working on my laptop.....
  • o0ragman0oo0ragman0o Member, Moderator Posts: 1,291 mod
    @Acysbib if you run geth --help from the commandline, you'll see alot more options.

    One of those is geth console

    That will allow you to interact with Ethereum directly using web3.js API commands

    Ethereum in its current Homestead phase is intended more for DAPP developers rather than end users. So it still takes quite a bit of prior technical experience and knowledge in order to work with it.
  • AcysbibAcysbib Member Posts: 54
    Which command line? Because opening a cmd terminal and trying to do anything it responds with " 'geth' is not recognized as an internal or external command, operable program or batch file...

    Cannot get passed that
  • o0ragman0oo0ragman0o Member, Moderator Posts: 1,291 mod
    edited April 2016
    @Acysbib
    win+e to open Windows Explorer. Find your Ethereum installation folder, something like
    C:\Program Files\Ethereum-Wallet-win64-0-5-2\resources\node\geth
    Open the folder tree in the left of Explorer and shift + right-click on it

    In the context menu open command window here

    You should then have a command prompt running in the geth directory.
  • AcysbibAcysbib Member Posts: 54
    So... I do that while geth is running? It's been syncing for the entire weekend.... It's on!block 300,000.... Still need to be able to check number of peers/switch nodes if need be... I'll try that as soon as I get inside.
  • o0ragman0oo0ragman0o Member, Moderator Posts: 1,291 mod
    If geth is already running, open another cmd and attach a console geth attach

    But given your still sync'ing I suggest you first stop it and restart with geth --fast to sync in a few hours rather than days.

    But I do have to ask, if you're not that comfortable with a command line, why do you want to interact with geth at such a low level? Are you aware of the Ethereum Wallet which provides a GUI front end?
  • AcysbibAcysbib Member Posts: 54
    Well... Yes... Sorta... But the one I was looking at using, 'etherwall' requires geth to be synced up.... And I wanted to run a full node anyway on my laptop as a prestep for POS.

    I want to run through the hard parts myself, if possible, without easy GUIs, just to see if I can do it.

    I am also planning on mining with Ubuntu geth/ethminer on a box I am building.... If I cannot make it work here... I have no hope on Linux....
  • AcysbibAcysbib Member Posts: 54
    Besides... I'm 29, it's high time I learn windows
  • AcysbibAcysbib Member Posts: 54
    Okay... I can open another cmd window... But since the first one is still syncing it won't let me do.... Anything... At all.

    So I closed the first one, opened a new one, tried to do... Anything... And it starts syncing again.... Even tried geth --fast and it spit out some error saying that because it is still building the block chain the first time, fast is disabled.

    Tried opening another console window, won't attach. So I open another in the spot, try something like geth peercount and it spits out an answer... Ish... Then complains the temp file is in use elsewhere....


    Windows is frustrating... I miss UNIX...
  • AcysbibAcysbib Member Posts: 54
    Also... Is there any way to actually check peers? And is there a way to switch bootstrap nodes? Because I cannot seem to get this stupid thing to work.... It's still loading blocks abysmally slow... 2-30 at a time... Or 256 at 30 sec to 30 minutes...
  • o0ragman0oo0ragman0o Member, Moderator Posts: 1,291 mod
    edited April 2016
    Acysbib said:


    Tried opening another console window, won't attach. So I open another in the spot, try something like geth peercount and it spits out an answer... Ish... Then complains the temp file is in use elsewhere....

    @Acysbib Sorry, forgot about the ipcpath thing (Been a while since I've played with these switches). In a second console, try ...

    geth --ipcpath "\\.\pipe\geth.ipc" attach
  • AcysbibAcysbib Member Posts: 54
    Enode://dce0d7ab9e41f327369704a089ed6d3d939158ec4edac4d327c311f16f0d094e3[email protected][ : : ] :30303

    Transcribed that from my laptop... Unto my tablet... Without having to scroll up... That's how slow my syncing is going.... It doesn't let me do fast sync. Don't know why... But that's the node I'm using... Every time I log in I notice the same three opening digits and closing digits... Assuming those would change between nodes... I'm using the same node every time geth is launched... And it always has super slow syncing/kicking me off because of lack of peers... And since it still doesn't spit out proper data for peer lists or anything, I cannot check anything... Any help to forcably push it to!a different enode?
  • o0ragman0oo0ragman0o Member, Moderator Posts: 1,291 mod
    @Acysbib, You transcribed a whole enode addr???? hahaha

    Little hint, in cmd, right-click-> mark then drag across the test you need and right-click again to copy into clip-board.

    Try renaming your chaindata folder (C:\Users\\AppData\Roaming\Ethereum\chaindata) and then try --fast.
  • AcysbibAcysbib Member Posts: 54
    If I hadn't been playing world of tanks... I might have thought to open a window to the forum on my computer... But I had one on my tablet, so I used it... I would have run into that issue anyway, so thank you, I will see how it goes... And be able to post data from geth if I run into more problems. Thanks.
  • AcysbibAcysbib Member Posts: 54
    My chain data folder is named that... With my username in the //... And it still refuses to --fast
  • AcysbibAcysbib Member Posts: 54
    Well... It says block chain not empty... Fastsync disabled... Should I delete the block chain I have so far (move it somewhere else and empty the folder... I'm not stupid...) And try again? Of course... Let ya know how it turns out.
  • AcysbibAcysbib Member Posts: 54
    I suppose I should also mention... If this is a source of stupidity for the bottlenecking... My laptop's hard drive can only write max 5megabytes per second... But even so copying the files I have so far at half that (split read/write) will take 35 minutes... And it's taken days to get this far... (~680000)
  • o0ragman0oo0ragman0o Member, Moderator Posts: 1,291 mod
    @Acysbib, no I meant rename the folder (to something like ...\chaindata.bak) so Geth is forced to start another blockchain. The --fast switch should work then.
  • AcysbibAcysbib Member Posts: 54
    I assume fast sync is in progress... Because it's showing headers and transactions instead of blocks imported... Can I sync full after fast is finished? Or does it compile in the background?

    Since its not a complete chain... I don't know what it going to do... I assume --fast is relatively new...
  • AcysbibAcysbib Member Posts: 54
    Ahhhh I think I should stop smoking weed before working on ethereum....
  • o0ragman0oo0ragman0o Member, Moderator Posts: 1,291 mod
    Ithink --fast implements 'state tree pruning' and once it's synch'd, i think it validates full blocks thereafter.
  • AcysbibAcysbib Member Posts: 54
    Well... It's failing now.... Spitting out some error like leveldb invalid... And its trying to do some kind of confirmation... But my computer keeps spitting out the same wrong answer.... If you need I'll copy paste the error its spitting
  • AcysbibAcysbib Member Posts: 54
    I0407 10:49:41.795348 15236 blockchain.go:160] WARNING: Wrote default ethereum genesis block
    I0407 10:49:41.802349 15236 blockchain.go:214] Last header: #0 [d4e56740…] TD=17179869184
    I0407 10:49:41.808349 15236 blockchain.go:215] Last block: #0 [d4e56740…] TD=17179869184
    I0407 10:49:41.814349 15236 blockchain.go:216] Fast block: #0 [d4e56740…] TD=17179869184
    I0407 10:49:41.888356 15236 cmd.go:114] Starting Geth/v1.3.5/windows/go1.5.1
    I0407 10:49:41.894354 15236 server.go:311] Starting Server
    I0407 10:49:45.059461 15236 udp.go:212] Listening, enode://dce0d7ab9e41f327369704a089ed6d3d939158ec4edac4d327c311f16f0d094e3[email protected][::]:30303
    I0407 10:49:45.074461 15236 backend.go:526] Server started
    I0407 10:49:45.074461 15236 server.go:552] Listening on [::]:30303
    I0407 10:49:45.077971 15236 ipc.go:112] IPC service started (\\.\pipe\geth.ipc)

    So... I saw the warning for default genesis block... And that might be causing the problem when it's "Synced" trying to testhash against the chain and it's expecting a certain result, and my computer keeps spitting out errors... Deleted the fast sync, trying again... It was going last night, and the errors did spit out something like "Block 689302 invalid" or something like that... I assumed it would correct errors on it's own... but it kept spitting out the same crap... Trying again.
  • AcysbibAcysbib Member Posts: 54
    Okay... Assuming fast worked correctly.. It's now only ever importing one header at a time now.

    I wonder if --fast is minable... Or if I'd have to wait a day or two once my rig gets here....
  • atvkingatvking Member Posts: 9
    I'm having all the same problems as you when it comes to syncing. I feel like I've tried everything, including starting over with a new blockchain 3-4 times. It looks like I have more than enough peers to maintain a steady connection/download speed (33 atm) and I have a fast machine and internet connection, yet I still get only a few blocks at a time, sometimes waiting up to an hour between. At this rate I'll never have the whole BC sync'd.

    Let me know if you find something that works for you. I must be missing something.

    > net.peerCount
    33
    > eth.syncing
    {
    currentBlock: 267717,
    highestBlock: 1299966,
    startingBlock: 266373
    }
    >


    I0408 11:30:57.212197 13168 blockchain.go:1251] imported 10 block(s) (0 queued 0 ignored) including 3 txs in 43.0286ms. #266731 [8e9fd2f1 / 51f85bc0]
    I0408 11:30:59.316723 13168 blockchain.go:1251] imported 26 block(s) (0 queued 0 ignored) including 18 txs in 144.0962ms. #266757 [3934b176 / 7b448094]
    I0408 11:43:01.417529 13168 blockchain.go:1251] imported 1 block(s) (0 queued 0 ignored) including 0 txs in 5.0016ms. #266758 [3d0baf2c / 3d0baf2c]
    I0408 11:43:01.674701 13168 blockchain.go:1251] imported 3 block(s) (0 queued 0 ignored) including 2 txs in 14.0075ms. #266761 [0bbd122a / 92ef428e]
    I0408 11:43:07.335564 13168 blockchain.go:1251] imported 47 block(s) (0 queued 0 ignored) including 52 txs in 290.1953ms. #266808 [d9b066d1 / 4feeb7b8]
    I0408 11:43:08.080062 13168 blockchain.go:1251] imported 141 block(s) (0 queued 0 ignored) including 115 txs in 587.3944ms. #266949 [204131b2 / e673b62b]
    I0408 12:16:06.368659 13168 blockchain.go:1251] imported 6 block(s) (0 queued 0 ignored) including 0 txs in 16.01ms. #266955 [adc9c206 / 9f726197]
    I0408 12:16:06.581802 13168 blockchain.go:1251] imported 1 block(s) (0 queued 0 ignored) including 1 txs in 6.004ms. #266956 [04a5eb81 / 04a5eb81]
    I0408 12:16:08.694213 13168 blockchain.go:1251] imported 3 block(s) (0 queued 0 ignored) including 9 txs in 28.0199ms. #266959 [92e8ff58 / 14c37fc9]
    I0408 12:16:11.159858 13168 blockchain.go:1251] imported 17 block(s) (0 queued 0 ignored) including 35 txs in 116.0775ms. #266976 [b7d261a6 / 115e006a]
    I0408 12:16:11.513094 13168 blockchain.go:1251] imported 15 block(s) (0 queued 0 ignored) including 90 txs in 327.2189ms. #266991 [7adcfac0 / e8a862f0]
    I0408 12:16:12.828099 13168 blockchain.go:1251] imported 256 block(s) (0 queued 0 ignored) including 300 txs in 1.3120032s. #267247 [d5eb2b8d / 40daa5f4]
    I0408 12:16:15.938174 13168 blockchain.go:1251] imported 65 block(s) (0 queued 0 ignored) including 868 txs in 3.1090746s. #267312 [eeaadd6a / 8011a3fc]
    I0408 12:16:16.314426 13168 blockchain.go:1251] imported 36 block(s) (0 queued 0 ignored) including 146 txs in 375.251ms. #267348 [0288b663 / 2f5fb9fa]
    I0408 12:16:20.165997 13168 blockchain.go:1251] imported 256 block(s) (0 queued 0 ignored) including 167 txs in 1.0286871s. #267604 [a13a3023 / 9007c709]
  • AcysbibAcysbib Member Posts: 54
    Try what I did to get --fast working. Rename or relocate your chain data to save your current effort in case this fails... And with an empty chaindata folder open geth again and first command should be

    geth --fast

    And it "should" be capable of syncing in a day.
  • AcysbibAcysbib Member Posts: 54
    Keep checking on it though... Mine failed the first time it synced.. So I deleted the data and tried again... Worked perfectly on its own second time around.
  • atvkingatvking Member Posts: 9
    Thanks for the tip, but I had tried that already with no success. I managed to get it to work with geth --nat "none" although not right away. It just picked up out of nowhere and imported the last 1,000,000+ blocks. Not sure what happened other than I restarted my modem for the first time after setting up port forwarding, so maybe it required a restart even though it said the settings were applied when I did the initial port forwarding setup?
  • AcysbibAcysbib Member Posts: 54
    That could have been it... A lot of routers require a reboot to apply setting changes
Sign In or Register to comment.