Skip to content

Commit

Permalink
Migrate project to HIVE blockchain
Browse files Browse the repository at this point in the history
  • Loading branch information
emre committed Mar 21, 2020
1 parent 091ac7a commit f33aebe
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__pycache__/
*.py[cod]
*$py.class

.idea
config.json

# C extensions
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#### transmitter

Transmitter is a CLI tool for STEEM blockchain witnesses. It quickly
Transmitter is a CLI tool for HIVE blockchain witnesses. It quickly
allows you to enable/disable your witness or set some properties for the new
*witness_set_properties* call introduced in Hard Fork 20.

Expand All @@ -24,7 +24,7 @@ Fill it with the corresponding values:
```javascript
{
"NODES": [
"https://api.steemit.com"
"https://api.hivekings.com"
],
"WITNESS_ACCOUNT": "<your_witness_account>",
"SIGNING_KEY": "<signing_key>",
Expand All @@ -34,7 +34,7 @@ Fill it with the corresponding values:
"maximum_block_size": 65536,
"sbd_interest_rate": 0
},
"URL": "https://steemit.com/@emrebeyler"
"URL": "https://hive.blog/@emrebeyler"
}
```

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='transmitter',
version='0.2.2',
version='0.2.3',
packages=[
'transmitter',
'transmitter.pricefeed',
Expand Down
20 changes: 18 additions & 2 deletions transmitter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@
logging.basicConfig()


# HIVE chain config
custom_chains = {
'HIVE': dict(
chain_assets=[
dict(asset='@@000000013', id=0, precision=3, symbol='HBD'),
dict(asset='@@000000021', id=1, precision=3, symbol='HIVE'),
dict(asset='@@000000037', id=2, precision=6, symbol='VESTS')
],
chain_id="0" * int(256 / 4), min_version='0.23.0', prefix='STM'
)
}


class Transmitter:

def __init__(self, config_file, action=None, signing_key=None,
Expand Down Expand Up @@ -91,8 +104,11 @@ def get_steem_instance(self, config, keys=None):
keys = []

logger.info("Connecting to the blockchain using mainnet.")
nodes = config.get("NODES") or ["https://api.steemit.com"]
steem = Steem(node=nodes, keys=keys)
nodes = config.get("NODES") or [
"https://api.hive.blog",
"https://api.hivekings.com",
"https://anyx.io"]
steem = Steem(node=nodes, keys=keys, custom_chains=custom_chains)

return steem

Expand Down
2 changes: 1 addition & 1 deletion transmitter/pricefeed/adapters/bittrex.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class BittrexAdapter(BaseAdapter):

def get_price(self):
btc_steem_response = requests.get(
self.BASE_URL, params={"market": "BTC-STEEM"})
self.BASE_URL, params={"market": "BTC-HIVE"})
btc_steem_response_json = self.validate_response(btc_steem_response)

usd_btc_response = requests.get(
Expand Down
14 changes: 7 additions & 7 deletions transmitter/pricefeed/markets.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import numpy as np

from .adapters.binance import BinanceAdapter
# from .adapters.binance import BinanceAdapter # disabled temporarily
from .adapters.bittrex import BittrexAdapter
from .adapters.huobi import HuobiAdapter
from .adapters.upbit import UpbitAdapter
# from .adapters.huobi import HuobiAdapter # disabled temporarily
# from .adapters.upbit import UpbitAdapter # disabled temporarily

AVAILABLE_MARKETS = {
"binance": BinanceAdapter,
"bittrex": BittrexAdapter,
"huobi": HuobiAdapter,
"upbit": UpbitAdapter,
# "binance": BinanceAdapter,
"bittrex": BittrexAdapter, # disabled temporarily
# "huobi": HuobiAdapter, # disabled temporarily
# "upbit": UpbitAdapter, # disabled temporarily
}

DEFAULT_MARKETS = list(AVAILABLE_MARKETS.keys())
Expand Down

0 comments on commit f33aebe

Please sign in to comment.