Author Topic: Yet Another Price Feed Mod  (Read 17102 times)

0 Members and 1 Guest are viewing this topic.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Ok, so I guess there's not much point to running blocks and script on different machines then... it's more a question of protecting the delegate block production environment by not revealing owner keys?

I'm gonna take the opportunity to read up on owner keys, active keys and sign keys. I found a couple of your guides on the subject, i will follow these.
https://bitsharestalk.org/index.php?topic=14344.0
https://bitsharestalk.org/index.php?topic=14360.0

Thanks for the help! :)

The most important thing is the OWNER KEY ..

I recommend you read this:
http://wiki.bitshares.org/index.php/Delegate/Security

Offline Spectral

I'm trying to run the script connecting to a wallet that is not the wallet of the delegate. The wallet has a 50BTS balance right now, so that should be enough.
So it seem your delegate is "running" on a different machine then?

Yes. The delegate with block production enabled is running on a different machine.

Quote
Quote
Does it mean that the script must connect to the delegate wallet itself and draw funds from that? If so, how can I do that without providing the delegate wallet password in cleartext in 'config.py'?
If you want to provide continuous updates for the feed, then you can only put the password in cleartext into the config. BUT, you should create a wallet that only contains the most recent active key and signing key of the delegate in it .. and no other account ...
Then you can do a rescan of the blockchain to catch up with the balance and run the script again

Ok, so I guess there's not much point to running blocks and script on different machines then... it's more a question of protecting the delegate block production environment by not revealing owner keys?

I'm gonna take the opportunity to read up on owner keys, active keys and sign keys. I found a couple of your guides on the subject, i will follow these.
https://bitsharestalk.org/index.php?topic=14344.0
https://bitsharestalk.org/index.php?topic=14360.0

Thanks for the help! :)
Vote for BTS-2 witness: spectral (1.6.30)
0.9 DVS delegate: dvs1.bitspace
Stay tuned for bitspace-clains worker!

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I'm trying to run the script connecting to a wallet that is not the wallet of the delegate. The wallet has a 50BTS balance right now, so that should be enough.
So it seem your delegate is "running" on a different machine then?

Quote
Does it mean that the script must connect to the delegate wallet itself and draw funds from that? If so, how can I do that without providing the delegate wallet password in cleartext in 'config.py'?
If you want to provide continuous updates for the feed, then you can only put the password in cleartext into the config. BUT, you should create a wallet that only contains the most recent active key and signing key of the delegate in it .. and no other account ...
Then you can do a rescan of the blockchain to catch up with the balance and run the script again

Offline Spectral

I'm trying to run the script connecting to a wallet that is not the wallet of the delegate. The wallet has a 50BTS balance right now, so that should be enough.

Does it mean that the script must connect to the delegate wallet itself and draw funds from that? If so, how can I do that without providing the delegate wallet password in cleartext in 'config.py'?
Vote for BTS-2 witness: spectral (1.6.30)
0.9 DVS delegate: dvs1.bitspace
Stay tuned for bitspace-clains worker!

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
It says:

20010 insufficient_funds: insufficient funds

So you delegate does not have funds (either in his active balance or in his delegates pay) that can be used to pay for the transaction fee. Each publishing transaction costs 0.5 BTS

Offline Spectral

Hi guys, I have a few questions about price feeds that I was hoping to get help with...

I'm using a wallet with some funds (not the delegate wallet) to try to post feeds for the 'bitspace-clains' delegate.

I'm using xeroc's bitshares-pytools, and think I managed to get the dependencies right. At first run, I would always get the message 'no update required' and -1% change on all assets in the table, so I edited 'main.py' to remove the required update test (is that ok for first time running feed script?). Now it runs, and I get the following output:

Code: [Select]
Update required! Forcing now!
Unlocking wallet
publishing feeds for delegate: bitspace-clains
Traceback (most recent call last):
  File "main.py", line 473, in <module>
    update_feed(rpc,asset_list_final)
  File "main.py", line 273, in update_feed
    result = rpc.wallet_publish_feeds(delegate, assets)
  File "/home/manuel/.local/lib/python3.4/site-packages/bitsharesrpc/client.py", line 135, in method
    "id": 0
  File "/home/manuel/.local/lib/python3.4/site-packages/bitsharesrpc/client.py", line 78, in rpcexec
    raise RPCError(ret['error']['detail'])
bitsharesrpc.client.RPCError: 20010 insufficient_funds: insufficient funds
    {"from_account_name":"bitspace-clains","amount_to_withdraw":{"amount":50000,"asset_id":0},"balance_records":[]}
    th_a  wallet.cpp:68 withdraw_to_transaction

Do I understand correctly that the script is trying to draw funds from the delegate account? I'm guessing that means that a feed must be published from the delegate account itself...?

If so, how do you avoid inserting the wallet password into 'config.py' in cleartext?

Also, how much funds is required to post the delegate feeds?
Vote for BTS-2 witness: spectral (1.6.30)
0.9 DVS delegate: dvs1.bitspace
Stay tuned for bitspace-clains worker!

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
You've started a rewrite. Good.
However without test network for bitshares 2.0 it looks impractical, doesn't it ?
Yes ... that's why it mostly only contains the Base58 and Address stuff only ..
I will work alot more on this when we have a testnet/client

Offline emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
You've started a rewrite. Good.
However without test network for bitshares 2.0 it looks impractical, doesn't it ?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Most of the changes I've made in this script modification are now merged in xeroc's script.
There is no need to support this mod anymore.
Maybe you want to join python development?
I can definitely need your help!

I'll be happy to help whenever I can.
I have started a complete rewrite for BitShares 2.0 and published it over here:
https://github.com/xeroc/python-bitshareslib

I plan to update most scripts to use the new library with BitShares 2.0 once released but have to do more work on the the transactions module (lots of changes under the hood)
Feel free to read into the existing code and send pull request ..

However, note that I am unavailable for the next three weeks ... HOLIDAY!!! :D

Offline emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
Most of the changes I've made in this script modification are now merged in xeroc's script.
There is no need to support this mod anymore.
Maybe you want to join python development?
I can definitely need your help!

I'll be happy to help whenever I can.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Most of the changes I've made in this script modification are now merged in xeroc's script.
There is no need to support this mod anymore.
Maybe you want to join python development?
I can definitely need your help!

Offline emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
Most of the changes I've made in this script modification are now merged in xeroc's script.
There is no need to support this mod anymore.


Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I've pushed an update fixing the issue with yahoo.

Thanks xeroc for the support.
I was away snowboarding in the alps without reliable internet access.

I'll post some more updates when I'm able to catch up with all the events.
Dang .. I was in the alps snowboarding too, this weekend 8)
got sun burned .. though the snow was awesome :)

Offline emski

  • Hero Member
  • *****
  • Posts: 1282
    • View Profile
    • http://lnkd.in/nPbhxG
I've pushed an update fixing the issue with yahoo.

Thanks xeroc for the support.
I was away snowboarding in the alps without reliable internet access.

I'll post some more updates when I'm able to catch up with all the events.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
xeroc, why does your script lock the wallet after updating feed? the delegate needs an unlocked wallet to run?
Thats because my feed scripts are not run on the delegate machine ..

just remove the
rpc.lock()
.. it is either at the end of thw script or in the update routine ... cant check atm

... gonna add a switch to the config soon (tm)