Skip to content
Snippets Groups Projects
Commit efea2094 authored by Gandalf's avatar Gandalf
Browse files

Merge branch 'change-default-endpoint' into 'autoclave'

Change default endpoint

See merge request hive-group/hivemind!9
parents cd5d84c8 315137b5
Branches
Tags
1 merge request!9Change default endpoint
......@@ -16,7 +16,7 @@ services:
environment:
DATABASE_URL: postgresql://testuser:testuserpass@db:5432/testdb
LOG_LEVEL: INFO
STEEMD_URL: '{"default" : "https://api.steemit.com"}'
STEEMD_URL: '{"default" : "https://api.hive.blog"}'
links:
- db:db
ports:
......
......@@ -60,9 +60,9 @@ http -j post http://localhost:8080 jsonrpc=2.0 id=1 method=hive.search params:='
# steemd.legacy (deprecated)
```
http -j post https://api.steemit.com jsonrpc=2.0 id=1 method=call params:='["follow_api","get_follow_count",["test-safari"]]'
http -j post https://api.steemit.com jsonrpc=2.0 id=1 method=call params:='["follow_api","get_followers",["test-safari","", "blog", 5]]'
http -j post https://api.steemit.com jsonrpc=2.0 id=1 method=call params:='["follow_api","get_following",["test-safari","", "ignore", 2]]'
http -j post https://api.hive.blog jsonrpc=2.0 id=1 method=call params:='["follow_api","get_follow_count",["test-safari"]]'
http -j post https://api.hive.blog jsonrpc=2.0 id=1 method=call params:='["follow_api","get_followers",["test-safari","", "blog", 5]]'
http -j post https://api.hive.blog jsonrpc=2.0 id=1 method=call params:='["follow_api","get_following",["test-safari","", "ignore", 2]]'
http -j post https://api.steemit.com jsonrpc=2.0 id=1 method=call params:='["database_api","get_content",["test-safari", "34gfex-december-spam"]]'
http -j post https://api.hive.blog jsonrpc=2.0 id=1 method=call params:='["database_api","get_content",["test-safari", "34gfex-december-spam"]]'
```
......@@ -32,7 +32,7 @@ class Conf():
# common
add('--database-url', env_var='DATABASE_URL', required=False, help='database connection url', default='')
add('--steemd-url', env_var='STEEMD_URL', required=False, help='steemd/jussi endpoint', default='{"default" : "https://api.steemit.com"}')
add('--steemd-url', env_var='STEEMD_URL', required=False, help='steemd/jussi endpoint', default='{"default" : "https://api.hive.blog"}')
add('--muted-accounts-url', env_var='MUTED_ACCOUNTS_URL', required=False, help='url to flat list of muted accounts', default='https://raw.githubusercontent.com/hivevectordefense/irredeemables/master/full.txt')
# server
......
......@@ -11,7 +11,7 @@ from hive.steem.block.stream import BlockStream
class SteemClient:
"""Handles upstream calls to jussi/steemd, with batching and retrying."""
# dangerous default value of url but it should be fine since we are not writting to it
def __init__(self, url={"default" : 'https://api.steemit.com'}, max_batch=50, max_workers=1):
def __init__(self, url={"default" : 'https://api.hive.blog'}, max_batch=50, max_workers=1):
assert url, 'steem-API endpoints undefined'
assert "default" in url, "Url should have default endpoint defined"
assert max_batch > 0 and max_batch <= 5000
......
......@@ -8,7 +8,7 @@ from hive.steem.client import SteemClient
@pytest.fixture
def client():
return SteemClient(url='https://api.steemit.com')
return SteemClient(url='https://api.hive.blog')
def test_instance(client):
assert isinstance(client, SteemClient)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment