You are viewing a single comment's thread from:

RE: New Testnet Deployed

in #testnet5 years ago

Still can not use the API @ testnet.steemdev.com

I understand that's not what it says in the post, but I don't have the ressources to set up my own node just to look at the testnet.

Access to fetch at 'http://testnet.steemdev.com/' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

I was told this should be easy to fix on your end.

Sort:  

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 ...