-
Notifications
You must be signed in to change notification settings - Fork 1
/
SETUP.txt
71 lines (46 loc) · 2.87 KB
/
SETUP.txt
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
NOTE: For readability purposes, this document will only talk about Bitcoin,
but know that everything applies to Dogecoin as well.
1. Installation
Get the bitcoind and/or dogecoind server programs. This can be done by
compiling by source (which is trickier than you would expect), or by
downloading a pre-compiled version. In either case, if you are working with
Bitcoin specifically, use Bitcoin Classic instead of Bitcoin Core (because
reasons).
2. Setup For Publication
Once bitcoind and/or dogecoind is installed, you must configure its RPC service
and download the entire blockchain. This takes 1-2 days of time, and 100GB of
free space for Bitcoin and/or 20GB of free space for Dogecoin.
To set up the RPC service, edit the ~/.bitcoin/bitcoin.conf (or Dogecoin
equivalent) and set the rpcuser, rpcpassword, rpcport values. The password
will not need to be typed in or remembered by a human, so this should be very
long and complex (i.e.: 25 alphanumeric characters OR MORE). To auto-generate
a good password, run:
echo `cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
Bitclamp requires the server to maintain a transaction index. This is NOT the
default mode. If you've never run bitcoind on this machine before, then start
it with:
$ bitcoind -daemon -txindex
Otherwise, if you have part (or all) of the blockchain already downloaded, you
will need to run it with the following arguments (this will re-build the
transaction index from scratch, which may take 24-48 hours!):
$ bitcoind -daemon -txindex -rescan
Verify that you can query the RPC service with (this should return a number
greater than 0):
$ bitcoin-cli getblockcount
Now wait patiently until the entire blockchain is downloaded and synchronized.
This can take 1-2 days to complete (you'll know its complete when the
getblockcount query above returns the same number after waiting a few minutes
in between).
Initial setup is now complete. Be sure to ALWAYS run bitcoind and/or the
GUI client with the "-txindex" option. Otherwise, it will prompt you to
destroy the index, which would take 24-48 hours to rebuild!
Refer to README.txt for examples on how to publish files.
3. Setup For Passive Monitoring Of New Content
You can monitor all new content published in the blockchain in realtime.
Simply run bitcoind with the following options:
$ bitcoind -daemon -txindex -blocknotify="python3 /path/to/blockchain_watcher.py btc /path/where/sqlite_db/should/go/sqlite.db /path/to/empty/folder/where/content/should/be/written/ /path/where/log/should/be/written/log.txt %s -d"
If you run this before any blockchain data is downloaded, it will extract ALL
content. If its run after, say, 1000 blocks are obtained, then only content
in blocks 1001 and onwards will be extracted.
To extract specific content, use bitclamp_extracterizer.py, as documented in
Section 2: "Explicit Extraction of Content" of README.txt.