This is the 3rd time I am commenting on this.
I am using dsteem like this:
<html>
<script src="https://unpkg.com/dsteem@^0.8.0/dist/dsteem.js"></script>
<script type="text/javascript">
var client = new dsteem.Client('http://api.steemit.com');
client.blockchain.getCurrentBlockNum().then(function (err, response) {
console.log(err, response);
});
var client2 = new dsteem.Client('http://testnet.steemdev.com');
client2.blockchain.getCurrentBlockNum().then(function (err, response) {
console.log(err, response);
});
</script>
</html>
This is the same code twice, just with different nodes.
api.steemit.com works, testnet.steemdev.com does not work. ( also when I add the port :2001 )
I also tried beem in a similar way (set_shared_steem_instance), actually but also got an error.
.
Well thanks. That works.
crossorigin = "" does not seem to do anything, and this works with either http and https.
<html> <script src="https://unpkg.com/dsteem@^0.8.0/dist/dsteem.js"></script> <script type="text/javascript"> var client2 = new dsteem.Client('http://testnet.steemitdev.com'); client2.call('condenser_api', 'get_dynamic_global_properties' ).then(function(err, response){ console.log(err, response); }); </script> </html>
The above works fine.
So I assume condenser works, but app base does not ?
.
that
@0.8.0
is just an artifact - I copied those lines from somewhere.I am not very familiar with dsteem or JS in general, either.
How do you get beem to work, then ?
from beem.blockchain import Blockchain from beem import Steem from beem.instance import set_shared_steem_instance blockchain = Blockchain() print(blockchain.get_current_block_num()) testnet = Steem(node=["https://testnet.steemdev.com:2001"]) set_shared_steem_instance(testnet) blockchain2 = Blockchain() print(blockchain2.get_current_block_num())
This does not work either, I tried variations of the url with port and without and http https ...
.