Skip to content

Commit

Permalink
Merge pull request #155 from AlexV525/feat/dotenv
Browse files Browse the repository at this point in the history
🚸 Add `python-dotenv` to automatically load environments
  • Loading branch information
atomicals authored Mar 26, 2024
2 parents c736e9c + c44d8e7 commit 87eb9fa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions electrumx_compact_history
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ import sys
import traceback
from os import environ

from dotenv import load_dotenv
from electrumx import Env
from electrumx.server.db import DB

load_dotenv()


async def compact_history():
if sys.version_info < (3, 8):
Expand Down
3 changes: 3 additions & 0 deletions electrumx_rpc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ import json
import sys
from os import environ

from dotenv import load_dotenv
from aiorpcx import timeout_after, connect_rs
import electrumx.lib.text as text

load_dotenv()


simple_commands = {
'getinfo': 'Print a summary of server state',
Expand Down
3 changes: 3 additions & 0 deletions electrumx_server
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ import os
import sys
import logging.handlers

from dotenv import load_dotenv
from electrumx import Controller, Env
from electrumx.lib.util import CompactFormatter, make_logger

load_dotenv()


def main():
'''Set up logging and run the server.'''
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ regex
krock32
merkletools @ git+https://github.com/tierion/pymerkletools.git@f10d71e2cd529a833728e836dc301f9af502d0b0
requests==2.31.0
python-dotenv

# For LevelDB
plyvel
Expand Down

0 comments on commit 87eb9fa

Please sign in to comment.