#!/usr/bin/env bash ## When in doubt just write a shell script ## new transaction curl --request POST \ --header 'Content-Type: application/json' \ --data '{ "source": "old_transaction_hash_1", "target": "target_account", "amount": 20, "timestamp": "2021-04-09T01:30:30" }' \ http://localhost:8080/transaction ## new transaction curl --request POST \ --header 'Content-Type: application/json' \ --data '{ "source": "old_transaction_hash_2", "target": "target_account", "amount": 20, "timestamp": "2021-04-09T01:31:30" }' \ http://localhost:8080/transaction ## new transaction curl --request POST \ --header 'Content-Type: application/json' \ --data '{ "source": "old_transaction_hash_3", "target": "target_account", "amount": 20, "timestamp": "2021-04-09T01:32:30" }' \ http://localhost:8080/transaction printf "\n\nList of current transactions\n\n" ## list transactions curl localhost:8080/transaction curl --header "Content-Type: application/json" \ --request POST \ --data '{ "transaction_list": [ "old_transaction_hash_1", "old_transaction_hash_2", "old_transaction_hash_3" ], "nonce": "not_a_thing_yet", "timestamp": "2021-04-08T12:30:30", "hash": "not_a_thing_yet" }' \ http://localhost:8080/block printf "\n\nShould be scooped up by the block\n\n" ## list transactions curl localhost:8080/transaction curl --request POST \ --header 'Content-Type: application/json' \ --data '{ "source": "source_account", "target": "target_account", "amount": 20, "timestamp": "2021-04-09T01:30:30" }' \ http://localhost:8080/transaction printf "\n\nShould have only one transaction\n\n" curl localhost:8080/transaction printf "\n\nShould have only one block\n\n" curl localhost:8080/block