def main():

    print("Storage Name: %s" % (storage_name))
    print("Block Count: %s" % (block_count))
    print("Block Size: %s" % (MemorySize(block_size)))
    print("Total Memory: %s"
          % (MemorySize(block_size*block_count)))
    print("Actual Storage Required: %s"
          % (MemorySize(
              EncryptedBlockStorage.compute_storage_size(
                  block_size,
                  block_count,
                  storage_type='sftp'))))
    print("")

    # Start an SSH client using paramiko
    print("Starting SSH Client")
    with paramiko.SSHClient() as ssh:
        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        ssh.load_system_host_keys()
        ssh.connect(ssh_host,
                    username=ssh_username,
                    password=ssh_password)

        print("Setting Up Encrypted Block Storage")
        setup_start = time.time()
        with EncryptedBlockStorage.setup(storage_name,
                                         block_size,
                                         block_count,
                                         storage_type='sftp',
                                         sshclient=ssh,
                                         ignore_existing=True) as f:
            print("Total Setup Time: %2.f s"
                  % (time.time()-setup_start))
            print("Total Data Transmission: %s"
                  % (MemorySize(f.bytes_sent + f.bytes_received)))
            print("")

        # We close the device and reopen it after
        # setup to reset the bytes sent and bytes
        # received stats.
        with EncryptedBlockStorage(storage_name,
                                   key=f.key,
                                   storage_type='sftp',
                                   sshclient=ssh) as f:

            test_count = 1000
            start_time = time.time()
            for t in tqdm.tqdm(list(range(test_count)),
                               desc="Running I/O Performance Test"):
                f.read_block(random.randint(0,f.block_count-1))
            stop_time = time.time()
            print("Access Block Avg. Data Transmitted: %s (%.3fx)"
                  % (MemorySize((f.bytes_sent + f.bytes_received)/float(test_count)),
                     (f.bytes_sent + f.bytes_received)/float(test_count)/float(block_size)))
            print("Access Block Avg. Latency: %.2f ms"
                  % ((stop_time-start_time)/float(test_count)*1000))
            print("")