com.google.bitcoin.examples
Class PingService
java.lang.Object
com.google.bitcoin.examples.PingService
public class PingService
- extends Object
PingService demonstrates basic usage of the library. It sits on the network and when it receives coins, simply
sends them right back to the previous owner, determined rather arbitrarily by the address of the first input.
If running on TestNet (slow but better than using real coins on prodnet) do the following:
- Backup your current wallet.dat in case of unforeseen problems
- Start your bitcoin client in test mode
bitcoin -testnet
. This will create a new sub-directory called testnet and should not interfere with normal wallets or operations.
- (Optional) Choose a fresh address
- (Optional) Visit the Testnet faucet (https://testnet.freebitcoins.appspot.com/) to load your client with test coins
- Run
PingService -testnet
- Wait for the block chain to download
- Send some coins from your bitcoin client to the address provided in the PingService console
- Leave it running until you get the coins back again
The testnet can be slow or flaky as it's a shared resource. You can use the testnet in a box to do everything purely locally.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PingService
public PingService()
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
Copyright © 2011. All Rights Reserved.