Browse Source

Rename NETWORK envvar to NET

For consistency with lib/coins.py

SegWit testnet needs its own NET
master
Neil Booth 8 years ago
parent
commit
dcc2c92bd6
  1. 10
      docs/ENVIRONMENT.rst
  2. 2
      lib/coins.py
  3. 2
      samples/systemd/electrumx.conf
  4. 4
      server/env.py

10
docs/ENVIRONMENT.rst

@ -31,7 +31,7 @@ These environment variables are always required:
The leading `http://` is optional, as is the trailing slash. The The leading `http://` is optional, as is the trailing slash. The
`:port` part is also optional and will default to the standard RPC `:port` part is also optional and will default to the standard RPC
port for **COIN** and **NETWORK** if omitted. port for **COIN** and **NET** if omitted.
For the `run` script For the `run` script
@ -58,7 +58,7 @@ These environment variables are optional:
Must be a *NAME* from one of the **Coin** classes in Must be a *NAME* from one of the **Coin** classes in
`lib/coins.py`_. Defaults to `Bitcoin`. `lib/coins.py`_. Defaults to `Bitcoin`.
* **NETWORK** * **NET**
Must be a *NET* from one of the **Coin** classes in `lib/coins.py`_. Must be a *NET* from one of the **Coin** classes in `lib/coins.py`_.
Defaults to `mainnet`. Defaults to `mainnet`.
@ -77,7 +77,7 @@ These environment variables are optional:
The maximum number of blocks to be able to handle in a chain The maximum number of blocks to be able to handle in a chain
reorganisation. ElectrumX retains some fairly compact undo reorganisation. ElectrumX retains some fairly compact undo
information for this many blocks in levelDB. The default is a information for this many blocks in levelDB. The default is a
function of **COIN** and **NETWORK**; for Bitcoin mainnet it is 200. function of **COIN** and **NET**; for Bitcoin mainnet it is 200.
* **HOST** * **HOST**
@ -98,7 +98,7 @@ These environment variables are optional:
ElectrumX will listen on this port for local RPC connections. ElectrumX will listen on this port for local RPC connections.
ElectrumX listens for RPC connections unless this is explicitly set ElectrumX listens for RPC connections unless this is explicitly set
to blank. The default is appropriate for **COIN** and **NETWORK** to blank. The default is appropriate for **COIN** and **NET**
(e.g., 8000 for Bitcoin mainnet) if not set. (e.g., 8000 for Bitcoin mainnet) if not set.
* **DONATION_ADDRESS** * **DONATION_ADDRESS**
@ -223,7 +223,7 @@ connectivity on IRC:
The nick to use when connecting to IRC. The default is a hash of The nick to use when connecting to IRC. The default is a hash of
**REPORT_HOST**. Either way a prefix will be prepended depending on **REPORT_HOST**. Either way a prefix will be prepended depending on
**COIN** and **NETWORK**. **COIN** and **NET**.
* **REPORT_HOST** * **REPORT_HOST**

2
lib/coins.py

@ -301,6 +301,8 @@ class BitcoinTestnetSegWit(BitcoinTestnet):
differently than with earlier versions. If you are using such a differently than with earlier versions. If you are using such a
bitcoind on testnet, you must use this class as your "COIN". bitcoind on testnet, you must use this class as your "COIN".
''' '''
NET = "testnet-segwit"
@classmethod @classmethod
def deserializer(cls): def deserializer(cls):
return DeserializerSegWit return DeserializerSegWit

2
samples/systemd/electrumx.conf

@ -42,7 +42,7 @@
#MISC #MISC
# #
#COIN = Bitcoin # lib/coins.py #COIN = Bitcoin # lib/coins.py
#NETWORK = mainnet # lib/coins.py #NET = mainnet # lib/coins.py
#DB_ENGINE = leveldb #DB_ENGINE = leveldb
#leveldb, rocksdb, lmdb (You'll need to install appropriate python packages) #leveldb, rocksdb, lmdb (You'll need to install appropriate python packages)

4
server/env.py

@ -22,9 +22,9 @@ class Env(LoggedClass):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.obsolete(['UTXO_MB', 'HIST_MB']) self.obsolete(['UTXO_MB', 'HIST_MB', 'NETWORK'])
coin_name = self.default('COIN', 'Bitcoin') coin_name = self.default('COIN', 'Bitcoin')
network = self.default('NETWORK', 'mainnet') network = self.default('NET', 'mainnet')
self.coin = Coin.lookup_coin_class(coin_name, network) self.coin = Coin.lookup_coin_class(coin_name, network)
self.db_dir = self.required('DB_DIRECTORY') self.db_dir = self.required('DB_DIRECTORY')
self.cache_MB = self.integer('CACHE_MB', 1200) self.cache_MB = self.integer('CACHE_MB', 1200)

Loading…
Cancel
Save