forked from bitcoin-abe/bitcoin-abe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
abe.conf
353 lines (305 loc) · 13.9 KB
/
abe.conf
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# Config file for Abe.
# dbtype and connect-args are required.
# If not configured to run under FastCGI, host OR port is required.
# "NAME=VALUE" and "NAME VALUE" are equivalent. Just "NAME" sets
# value to True. Values of the form "..." or [...] or {...} are
# parsed as extended JSON, as are the values true, false, and null.
# Abe extends JSON syntax to allow strings to contain control
# characters (tab, LF, and CR) and to allow comments (from # to end of
# line) between tokens.
# "NAME += VALUE" appends VALUE to an array or updates an object
# defined by NAME. Hyphen in NAME is read as underscore, so
# "connect_args" and "connect-args" are synonymous. Later values
# override earlier ones (unless using "+=").
# All values may be passed as command-line arguments by preceding NAME
# with "--". Example: "python -m Abe.abe --upgrade --dbtype=sqlite3
# --connect-args=abe.sqlite --port 2750".
# dbtype is the name of a Python module. connect-args are arguments
# to pass to the module's "connect" function. Consult the module's
# documentation for values. The user needs permission to create
# tables. Consult your database documentation on how to configure a
# database. See also README.txt.
# PostgreSQL example; see also README-POSTGRES.txt:
#dbtype = psycopg2
#connect-args = { "database": "abe" }
# MySQL example; see also README-MYSQL.txt:
#dbtype MySQLdb
#connect-args {"user":"root","db":"abe"}
# SQLite3 example:
#dbtype = sqlite3
#connect-args = abe.sqlite
# Oracle example:
#dbtype=cx_Oracle
#connect-args=user/pass@SID
# ODBC examples. Don't use the same schema via ODBC and non-ODBC!
#dbtype = pyodbc
#connect-args = DSN=Abe;PWD=B!tc0iN;
#connect-args = DRIVER={ORACLE};DB=ORCL;UID=abe;PWD=Bitcoin;
#connect-args = DRIVER={PostgreSQL ANSI};Database=abe;
# Workaround for ODBC drivers that begin in autocommit mode:
#connect-args {"":"DRIVER={PostgreSQL ANSI};Database=abe;","autocommit":false}
# IBM DB2 example:
#dbtype = ibm_db_dbi
#connect-args {"dsn":"DATABASE=abe;UID=db2inst1;PWD=B!tCo1N","conn_options":{"102":0}}
# Specify port and/or host to serve HTTP instead of FastCGI:
#port 2750
#host localhost
# Specify no-serve to exit immediately after importing block files:
#no-serve
# Specify no-load to start abe server without ever loading the
# blockchain - this is useful if you have a dedicated instance loading
# blocks into your Abe database.
#no-load
# "upgrade" tells Abe to upgrade database objects automatically after
# code updates:
#upgrade
#
# Sometimes upgrades fail and leave the database unusable. Sometimes
# upgrades take several minutes or longer. You may get an idea of the
# time required by looking at comments near the bottom of
# Abe/upgrade.py. For example, if your schema version is Abe18 and
# you are upgrading to schema version Abe19, the relevant lines are:
#
# ('Abe18', add_block_num_tx), # Seconds
# ('Abe18.1', add_block_ss_destroyed), # Seconds
# ('Abe18.2', init_block_tx_sums), # 5 minutes
# ('Abe18.3', replace_chain_summary), # Fast
#
# In this case, you could expect a 5-minute upgrade. The following
# SQL shows the current schema version, provided that it is at least
# Abe13:
#
# SELECT configvar_value FROM configvar
# WHERE configvar_name = 'schema_version'
#
# "python -m Abe.abe -v" shows the schema version that the software
# requires. Sometimes you can upgrade a live database by running
# "python -m Abe.abe --config YOUR_ABE_CONFIG --no-serve --upgrade"
# but this often results in server errors and may sometimes corrupt
# the data. It is best if the upgrade process has exclusive access to
# the database.
# Include another configuration file, relative to this one's directory.
#config ../secret/abe.conf
# Add or replace object fields. This example assumes connect-args
# previously held an object such as { "user": "abe" }.
#connect-args += { "password": "B!tc0iN" }
# datadir tells Abe where and how to find block data. datadir is
# structured as a JSON array of objects: [ { ... }, ... ] You can add
# to the list of sources with datadir+=[...] or replace it by using
# datadir=[...]. Each object { ... } specifies a data source using
# named parameters, so the general form of datadir is:
# datadir+=[{"dir1name1":"dir1param1","dir1name2":"dir1param2",...},
# {"dir2name1":"dir2param1","dir2name2":"dir2param2",...},
# ...]
# The most important parameter is "dirname" and is the filesystem
# directory containing your bitcoin.conf file. (Bitcoind can use a
# non-default directory if you pass it -datadir=<dirname>.)
# Besides "dirname", most coins need the "chain" parameter, which is
# the chain name as shown in web pages. Also, each datadir needs a
# "policy" to define the block and transaction format, since this
# information is not encoded in the blockfiles.
# If "policy" is not given in datadir, it defaults to the chain name,
# but for new coins, a "policy" parameter is required. Run
# "python -m Abe.abe --list-policies" to see the possibilities, and
# "python -m Abe.abe --show-policy POLICY" for information about
# POLICY. When in doubt, look for the name of a coin on which the new
# coin is based, or a name suggestive of its distinctive features such
# as proof-of-work hash algorithm. If no policy works, see the
# modules in Abe/Chain for examples. Each module there implements a
# policy.
# New coins typically need a new "address_version", see doc/FAQ.html.
#datadir += [{
# "dirname": "/home/bitcoin/.bitcoin",
# "loader": "rpc", # See the comments for default-loader below.
# "chain": "Bitcoin"
# }]
#datadir += [{
# "dirname": "/home/jtobey/.novacoin",
# "chain": "NewCoin", # Display as "NewCoin" ...
# "policy": "NovaCoin" # ... but use the "NovaCoin" loader.
# }]
# datadir can supply information about new currencies.
# Note that "address_version" is a byte string: the byte (or, perhaps
# someday, several bytes) preceding the public key hash before base-58
# conversion. Example:
#
#datadir += [{
# "dirname": "/home/weeds/testnet",
# "chain": "Weeds",
# "code3": "WDS",
# "address_version": "\u00f3" }]
#datadir += [{
# "dirname":"/home/namecoin/.namecoin/testnet",
# "chain":"NCTestnet",
# "code3":"NC0",
# "address_version":"\u006f",
# "decimals": 8,
# "conf": "namecoin.conf" }]
# ignore-bit8-chains: list of chains for which block version bit 8 does
# NOT indicate a Namecoin-style merge-mined auxiliary proof-of-work.
#ignore-bit8-chains = ["Bitcoin", "Testnet"]
# Set binary-type=hex if you want to store binary data (hashes,
# scripts, keys, etc.) as hexadecimal strings regardless of the
# database's binary data support.
#
# To use experimental support for PostgreSQL BYTEA storage, set
# binary-type=pg-bytea. This may become the default on databases that
# support it.
#
# To use MySQL binary types, set binary-type=binary. This is now the
# default.
#
# The binary-type setting affects only the first run, where Abe
# creates its tables.
#binary-type hex
# Some databases have trouble with the large integers that Abe uses
# for statistics. Setting int-type=str causes Abe to pass certain
# integers to the database as strings and cast them to floating point
# in SQL expressions that calculate statistics. Try this if SQLite
# complains "OverflowError: long too big to convert".
#int-type str
# Timezone for displaying block times. This is the same as setting
# the TZ environment variable. Starting from Abe 0.8, times default
# to local time instead of UTC. The setting usually match files in
# /usr/share/zoneinfo/ or /usr/lib/zoneinfo/.
# To get pre-0.8 time behavior:
#timezone UTC
# New-York time:
#timezone America/New_York
# London time:
#timezone Europe/London
# URL component for static content: logos, style sheets.
#static-path =
# Filesystem location of static content, if served by Abe.
#document-root = Abe/htdocs
# Uncomment "auto-agpl" to add a "Source" link to each page pointing
# to a "/download" URL that streams the directory containing abe.py
# and all subdirectories as a compressed TAR archive. This exposes
# files outside of the htdocs directory to the client, so use it with
# caution.
#auto-agpl
# Directory name and tarfile name prefix for auto-agpl source
# download.
#download-name = abe
# Primitive template system until I separate view from controller.
#template_vars += {
# "CONTENT_TYPE": "text/html; charset=utf-8",
# "APPNAME": "Abe",
# "DONATIONS_BTC": "1PWC7PNHL1SgvZaN7xEtygenKjWobWsCuf",
# "DONATIONS_NMC": "NJ3MSELK1cWnqUa6xhF2wUYAnz3RSrWXcK"
#}
#template_vars += { "DONATIONS_BTC": "1YourBitcoinAddressHere" }
#template_vars += { "HOMEPAGE": "chain/Bitcoin" }
#template = "
#<!DOCTYPE html>
#<html lang=\"en\">
#<head>
# <link rel=\"stylesheet\" type=\"text/css\"
# href=\"%(dotdot)s%(STATIC_PATH)sabe.css\" />
# <link rel=\"shortcut icon\" href=\"%(dotdot)s%(STATIC_PATH)sfavicon.ico\" />
# <title>%(title)s</title>
#</head>
#<body>
# <h1><a href=\"%(dotdot)s%(HOMEPAGE)s\"><img
# src=\"%(dotdot)s%(STATIC_PATH)slogo32.png\" alt=\"Abe logo\" /></a> %(h1)s
# </h1>
# %(body)s
# <p style=\"font-size: smaller\">
# <span style=\"font-style: italic\">
# Powered by <a href=\"%(ABE_URL)s\">%(APPNAME)s</a>
# </span>
# Tips appreciated!
# <a href=\"%(dotdot)saddress/%(DONATIONS_BTC)s\">BTC</a>
# <a href=\"%(dotdot)saddress/%(DONATIONS_NMC)s\">NMC</a>
# </p>
#</body>
#</html>
#"
# Save blocks to the database after reading this many bytes from a
# file. Abe may run faster with a higher value, for example 10000,
# while loading lots of data with a single process. Non-zero values
# can lead to errors when two processes load transaction data
# simultaneously.
#commit-bytes = 0
# "rescan" causes Abe to search all block files for new blocks. This
# can take several minutes on a large chain, longer if many of the
# blocks are not already in Abe's database. You might want to do this
# if Abe becomes stuck at an old block number: new blocks are loaded
# but not attached to the chain. You must run once with "rescan"
# after switching to another copy of the block files.
#rescan
# For displaying short links, base-url overrides the first part of the
# URL. This does not affect the link target, only the visible text.
# The value must include the trailing slash (/) if applicable.
#base-url = http://abe.example.org/
# History pages of addresses with more than this many receipts will be
# not be shown. This protects against denial of service. Use -1 for
# no limit. This also limits the total inputs shown by
# /unspent/ADDR|ADDR|...
#address-history-rows-max 1000
# Argument to logging.config.dictConfig. Requires Python 2.7 or later.
# http://docs.python.org/library/logging.config.html#logging-config-dictschema
#logging = {
# "version":1,
# "handlers": {
# "console": {
# "class": "logging.StreamHandler",
# "formatter": "full",
# "level": "DEBUG"}},
# "formatters": {
# "full": {
# "format": "%(asctime)s [%(process)d:%(threadName)s] %(name)s %(levelname)s - %(message)s"}},
# "root": {
# "handlers": ["console"],
# "level": "DEBUG"}}
# --log-sql logs all queries. This is quite verbose, so it is disabled
# by default.
#log-sql
# Create and use the abe_firstbits table. This affects only the first
# run, where Abe creates its tables, or the first run after an upgrade
# to firstbits-enabled Abe. This is disabled by default.
#use-firstbits
# shortlink-type=firstbits constructs address short links using
# firstbits. This is the default when use-firstbits is true.
# Otherwise, shortlink-type is a number of address characters to use.
# Fewer characters result in more collisions, where the page shows a
# list of matches instead of redirecting to the address history.
#shortlink-type 10
# keep-scriptsig=false prevents storage and display of transaction
# input signature scripts (scriptSig) and sequence numbers. This
# reduces the database size by about 20%.
#keep-scriptsig
# Add transactions to the database. The genesis transaction is
# unavailable via RPC and must be specified to enable full loading
# over RPC. See Abe/genesis_tx.py.
#import-tx += 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000
# Use default-loader=blkfile to force Abe to load data by scanning
# blockfiles. Use default-loader=rpc to force the use of RPC
# with a running bitcoind (or *coin daemon). This requires:
#
# * A readable bitcoin.conf with the RPC username and password
#
# * HTTP access to bitcoind (SSL is not yet supported.)
#
# * A "datadir" option with "chain":"Bitcoin" (or other chain
# name)
#
# * The "import-tx" option specifying the genesis transaction, if
# "bitcoid getrawtransaction" does not return it and it is not
# in Abe/genesis_tx.py. (Bitcoin's genesis transaction is in
# Abe/genesis_tx.py. Otherwise, it requires manually parsing
# the first blockfile or running once in blkfile mode and
# finding the "genesis tx" in Abe's output.)
#
# By default, Abe tries RPC and falls back to blkfile if that fails.
# Use "rpc,blkfile" to specify this behaviour across upgrades, or
# "default" to let Abe choose. The "loader" specified in a "datadir"
# entry takes precedence over "default-loader".
#
#default-loader = default
# Should we load bitcoind's mempool using RPC? This can speed up
# significantly loading of new blocks as most transactions should be
# stored already, OTOH the loading process will never stop. This option
# requires --no-serve and will fail without it. It has no effect on the
# blkfile loader or when --no-load is used.
#rpc-load-mempool