@@ -0,0 +1,1742 @@
+/*%0A * Copyright 2011 Google Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.google.bitcoin.examples;%0A%0Aimport com.google.bitcoin.core.*;%0Aimport com.google.bitcoin.store.BlockStore;%0Aimport com.google.bitcoin.store.MemoryBlockStore;%0A%0Aimport java.net.InetAddress;%0Aimport java.util.concurrent.Future;%0A%0A/**%0A * Downloads the block given a block hash from the localhost node and prints it out.%0A */%0Apublic class FetchBlock %7B%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        System.out.println(%22Connecting to node%22);%0A        final NetworkParameters params = NetworkParameters.prodNet();%0A        NetworkConnection conn = new NetworkConnection(InetAddress.getLocalHost(), params, 0, 60000);%0A        BlockStore blockStore = new MemoryBlockStore(params);%0A        BlockChain chain = new BlockChain(params, blockStore);%0A        Peer peer = new Peer(params, conn, chain);%0A        peer.start();%0A%0A        Sha256Hash blockHash = new Sha256Hash(args%5B0%5D);%0A        Future%3CBlock%3E future = peer.getBlock(blockHash);%0A        System.out.println(%22Waiting for node to send us the requested block: %22 + blockHash);%0A        Block block = future.get();%0A        System.out.println(block);%0A        peer.disconnect();%0A    %7D%0A%7D%0A

Add a tool that prints out an arbitrary block given its hash.