You are viewing a single comment's thread from:

RE: Steem Tutorials Are Severely Lacking (Where is Hello World?)

in #tutorial6 years ago

The most annoying thing about all of this is that I don't even know if what I'm trying to do is impossible. Just trying to broadcast an action on the blockchain using nothing but JavaScript... doesn't seem like it should be an issue... yet here I am.

Sort:  

Its not difficult. Its literally one line of code to vote on a post:

steem.broadcast.vote(private_posting_key, voter, author, permlink, weight, callback);

Nice, so can you tell me why:

var key = dsteem.PrivateKey.fromLogin('edicted', MY_POSTING_KEY, 'posting')

client.broadcast.vote({
    voter: 'edicted',
    author: 'edicted',
    permlink: 're-edicted-steem-tutorials-are-severely-lacking-where-is-hello-world-20180829t190313889z',
    weight: 100
}, key).then(function(result){
   console.log('Included in block: ' + result.block_num)
}, function(error) {
   console.error(error)
})

Doesn't work?

var key = dsteem.PrivateKey.fromLogin('edicted', MY_POSTING_KEY, 'posting')

Try printing out key here. I think that would be wrong.

Got it working with the master key... seems like a really foolish thing to require.

Since you passed posting as third argument, it should have worked. Are you sure you weren't passing public posting key?

100% sure, I use my keys correctly all the time. It only works with master as far as I can tell.

In fact I just logged out and logged back in with the posting key I was using just to make sure.

Probably a bug then. Steem api works with posting key.

apparently I have to use .fromString():

var key = dsteem.PrivateKey.fromString('posting-key-goes-here')

This is your public posting key: STM7KtxFtRj4jXcvmvbifcAzh1rXnBWJiGuTeZAyWnKBKBoZerT1G

yeah all private keys start with a 5. master password starts with a P

grab your private posting key directly from on steemit and pass that.

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 61964.40
ETH 2998.63
USDT 1.00
SBD 2.47