-
Notifications
You must be signed in to change notification settings - Fork 0
/
txTimes.sh
executable file
·36 lines (32 loc) · 1.32 KB
/
txTimes.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Source used for this script:
# (1) https://github.com/dkondor/join-utils
#
# This scripts creates the Bitcoin transactions' timestamps. The output file contains rows of the following form
#
# transactionId timeStamp.
#
# The script requires the following 3 parameters (appearing in that order):
#
# (1) txPath - the path to the tx.dat file (not compressed) as specified at https://github.com/dkondor/bitcoin, Usage (dump mode),
# (2) bhPath - the path to the bh.dat file (not compressed) as specifed at https://github.com/dkondor/bitcoin, Usage (dump mode),
# (3) tx_timesPath - the path to the output file (whose form has been specified at the beginning - lines 6 - 8).
#
# Sample usage (assuming you are in the same directory as the txTimes.sh script file):
# ./txTimes.sh path_to_tx.dat path_to_bh.dat path_to_output
txPath=$1
bhPath=$2
tx_timesPath=$3
# Some of the commands below taken from https://github.com/dkondor/join-utils
if [[ ! -f "./necessary_programs/numjoin" ]]
then
rm -rf necessary_programs/join-utils
cd ./necessary_programs
git clone https://github.com/dkondor/join-utils.git
cd join-utils
g++ -o ../numjoin numeric_join.cpp -std=gnu++11 -O3
cd ..
cd ..
rm -rf necessary_programs/join-utils
fi
./necessary_programs/numjoin -1 2 -o1 1 -2 1 -o2 3 $txPath $bhPath > $tx_timesPath