-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial testnet support. #164
base: master
Are you sure you want to change the base?
Conversation
This looks great. I do have some suggested changes but there are semi-major updates incoming shortly (this week). Will circle back ASAP. |
Yep, makes sense. Thanks for taking a peek. |
I think maybe my previous problem had to do with ephemeral ports. When I launch docker with I think the remaining issue I'm seeing is because my testnet has no price feeds. At initial sync, I see:
I need to make sure price feeds are working in tintoy. In the meantime, I patched with this and initial sync works: diff --git a/hive/indexer/sync.py b/hive/indexer/sync.py
index 0ff873e..776e025 100644
--- a/hive/indexer/sync.py
+++ b/hive/indexer/sync.py
@@ -212,12 +212,18 @@ class Sync:
sps=state['sbd_per_steem'],
dgpo=json.dumps(state['dgpo']))
elif chain == 'testnet':
- self._db.query("""UPDATE hive_state SET block_num = :block_num,
- tests_per_mvest = :tpm, usd_per_steem = :ups,
- tbd_per_steem = :tps, dgpo = :dgpo""",
- block_num=state['dgpo']['head_block_number'],
- tpm=state['tests_per_mvest'],
- ups=state['usd_per_steem'],
- tps=state['tbd_per_steem'],
- dgpo=json.dumps(state['dgpo']))
+ if state['usd_per_steem'] == '0.000' or state['tbd_per_steem'] == '0.000':
+ self._db.query("""UPDATE hive_state SET block_num = :block_num,
+ dgpo = :dgpo""",
+ block_num=state['dgpo']['head_block_number'],
+ dgpo=json.dumps(state['dgpo']))
+ else:
+ self._db.query("""UPDATE hive_state SET block_num = :block_num,
+ tests_per_mvest = :tpm, usd_per_steem = :ups,
+ tbd_per_steem = :tps, dgpo = :dgpo""",
+ block_num=state['dgpo']['head_block_number'],
+ tpm=state['tests_per_mvest'],
+ ups=state['usd_per_steem'],
+ tps=state['tbd_per_steem'],
+ dgpo=json.dumps(state['dgpo']))
return state['dgpo']['head_block_number'] |
Let's try avoid testnet branching as much as possible. Testnet support should be achievable with very minimal LOC added. For instance with
|
This is my initial stab at adding testnet support to hivemind. In order to try it out, you have to run a stable testnet. Unfortunately, at the moment, the official testnet responds with
Unable to acquire database lock
.So, I am testing with tintoy instead, which allows me to launch a tiny testnet with ~2,000 accounts. To run:
docker run -d -p 8091:8091 inertia/tintoy:latest # wait for it to load after < 10 minutes or so hive sync --steemd_url http://localhost:8091
At this point, the problem appears to be some kind of "timeout" situation when trying to connect to
localhost:8091
. I believe it's expecting SSL, but I don't see where it's getting that.I'm using ephemeral ports in this example:
Any suggestions?