Jeiwan / blockchain_go

A simplified blockchain implementation in Golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to send amount?

wufeiafei opened this issue · comments

commented

when I send amount on mac os:
$ ./blockchain_go send -from 18LzaPoMWzHb4fozkp1AJeiomjQBSTMshY -to 15qAH88JWPzv7D1cKz4xj63NXse4WDZiGU -amount 1

I received the error:
2018/02/09 15:52:57 sendTx to addr (localhost:3000)
localhost:3000 is not available,err = dial tcp [::1]:3000: getsockopt: connection refused
Success!

what can I do?

You need to start other nodes, specifically one with NODE_ID=3000. This point is described in: https://jeiwan.cc/posts/building-blockchain-in-go-part-7/

I have similar problem with this scenario. After this line:
NODE 3002
Quickly! Switch to the miner node and see it mining a new block! Also, check the output of the central node.

I have good (perhaps) output for NODE 3002 (MINER node):
Received inv command
Recevied inventory with 1 tx
Received tx command

But NODE 3000 (CENTRAL node) had no output, just error:
Received tx command
localhost:3001 is not available
Received getdata command

After this I had started WALLET node:
Starting node 3001

and it didn't download mined block! So I got old balances.