# Run a Zebra sync starting at the cached tip, and syncing to the latest tip.
#
# List directory used by test
ls -lh "$ZEBRA_CACHED_STATE_DIR"/*/* ||(echo"No $ZEBRA_CACHED_STATE_DIR/*/*"; ls -lhR "$ZEBRA_CACHED_STATE_DIR"| head -50 ||echo"No $ZEBRA_CACHED_STATE_DIR directory")
# Generate checkpoints after syncing Zebra from a cached state on mainnet.
#
# TODO: disable or filter out logs like:
# test generate_checkpoints_mainnet has been running for over 60 seconds
#
# List directory used by test
ls -lh "$ZEBRA_CACHED_STATE_DIR"/*/* ||(echo"No $ZEBRA_CACHED_STATE_DIR/*/*"; ls -lhR "$ZEBRA_CACHED_STATE_DIR"| head -50 ||echo"No $ZEBRA_CACHED_STATE_DIR directory")
# Generate checkpoints after syncing Zebra on testnet.
#
# This test might fail if testnet is unstable.
#
# List directory used by test
ls -lh "$ZEBRA_CACHED_STATE_DIR"/*/* ||(echo"No $ZEBRA_CACHED_STATE_DIR/*/*"; ls -lhR "$ZEBRA_CACHED_STATE_DIR"| head -50 ||echo"No $ZEBRA_CACHED_STATE_DIR directory")
ls -lh "$ZEBRA_CACHED_STATE_DIR"/*/* ||(echo"No $ZEBRA_CACHED_STATE_DIR/*/*"; ls -lhR "$ZEBRA_CACHED_STATE_DIR"| head -50 ||echo"No $ZEBRA_CACHED_STATE_DIR directory")
ls -lh "$ZEBRA_CACHED_STATE_DIR"/*/* ||(echo"No $ZEBRA_CACHED_STATE_DIR/*/*"; ls -lhR "$ZEBRA_CACHED_STATE_DIR"| head -50 ||echo"No $ZEBRA_CACHED_STATE_DIR directory")
ls -lhR "$LIGHTWALLETD_DATA_DIR/db"||(echo"No $LIGHTWALLETD_DATA_DIR/db"; ls -lhR "$LIGHTWALLETD_DATA_DIR"| head -50 ||echo"No $LIGHTWALLETD_DATA_DIR directory")
ls -lh "$ZEBRA_CACHED_STATE_DIR"/*/* ||(echo"No $ZEBRA_CACHED_STATE_DIR/*/*"; ls -lhR "$ZEBRA_CACHED_STATE_DIR"| head -50 ||echo"No $ZEBRA_CACHED_STATE_DIR directory")
ls -lhR "$LIGHTWALLETD_DATA_DIR/db"||(echo"No $LIGHTWALLETD_DATA_DIR/db"; ls -lhR "$LIGHTWALLETD_DATA_DIR"| head -50 ||echo"No $LIGHTWALLETD_DATA_DIR directory")
# Starting with a cached Zebra and lightwalletd tip, test all gRPC calls to lightwalletd, which calls Zebra.
ls -lh "$ZEBRA_CACHED_STATE_DIR"/*/* ||(echo"No $ZEBRA_CACHED_STATE_DIR/*/*"; ls -lhR "$ZEBRA_CACHED_STATE_DIR"| head -50 ||echo"No $ZEBRA_CACHED_STATE_DIR directory")
ls -lhR "$LIGHTWALLETD_DATA_DIR/db"||(echo"No $LIGHTWALLETD_DATA_DIR/db"; ls -lhR "$LIGHTWALLETD_DATA_DIR"| head -50 ||echo"No $LIGHTWALLETD_DATA_DIR directory")
ls -lh "$ZEBRA_CACHED_STATE_DIR"/*/* ||(echo"No $ZEBRA_CACHED_STATE_DIR/*/*"; ls -lhR "$ZEBRA_CACHED_STATE_DIR"| head -50 ||echo"No $ZEBRA_CACHED_STATE_DIR directory")
ls -lhR "$LIGHTWALLETD_DATA_DIR/db"||(echo"No $LIGHTWALLETD_DATA_DIR/db"; ls -lhR "$LIGHTWALLETD_DATA_DIR"| head -50 ||echo"No $LIGHTWALLETD_DATA_DIR directory")
# Starting with a cached Zebra tip, test getting a block template from Zebra's RPC server.
ls -lh "$ZEBRA_CACHED_STATE_DIR"/*/* ||(echo"No $ZEBRA_CACHED_STATE_DIR/*/*"; ls -lhR "$ZEBRA_CACHED_STATE_DIR"| head -50 ||echo"No $ZEBRA_CACHED_STATE_DIR directory")
# Starting with a cached Zebra tip, test sending a block to Zebra's RPC port.
ls -lh "$ZEBRA_CACHED_STATE_DIR"/*/* ||(echo"No $ZEBRA_CACHED_STATE_DIR/*/*"; ls -lhR "$ZEBRA_CACHED_STATE_DIR"| head -50 ||echo"No $ZEBRA_CACHED_STATE_DIR directory")