Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
beem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
beem
Commits
5fa27b0a
Unverified
Commit
5fa27b0a
authored
5 years ago
by
Alexander Morris
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Create wls_post.py
wls v2.5 reward / posting example
parent
23118723
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/wls_post.py
+70
-0
70 additions, 0 deletions
examples/wls_post.py
with
70 additions
and
0 deletions
examples/wls_post.py
0 → 100644
+
70
−
0
View file @
5fa27b0a
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
unicode_literals
import
sys
from
datetime
import
datetime
,
timedelta
import
time
import
io
import
logging
from
beem.blockchain
import
Blockchain
from
beem.block
import
Block
from
beem.account
import
Account
from
beem.amount
import
Amount
from
beemgraphenebase.account
import
PasswordKey
,
PrivateKey
,
PublicKey
from
beem.steem
import
Steem
from
beem.utils
import
parse_time
,
formatTimedelta
from
beemapi.exceptions
import
NumRetriesReached
from
beem.nodelist
import
NodeList
from
beembase
import
operations
from
beem.transactionbuilder
import
TransactionBuilder
log
=
logging
.
getLogger
(
__name__
)
logging
.
basicConfig
(
level
=
logging
.
INFO
)
def
test_post
(
wls
):
op1
=
operations
.
Social_action
(
**
{
"
account
"
:
"
guest123
"
,
"
social_action_comment_create
"
:
{
"
permlink
"
:
'
just-a-test-post
'
,
"
parent_author
"
:
""
,
"
parent_permlink
"
:
"
test
"
,
"
title
"
:
"
just a test post
"
,
"
body
"
:
"
test post body
"
,
"
json_metadata
"
:
'
{
"
app
"
:
"
wls_python
"
}
'
}
})
op2
=
operations
.
Social_action
(
**
{
"
account
"
:
"
guest123
"
,
"
social_action_comment_update
"
:
{
"
permlink
"
:
'
just-a-test-post
'
,
"
title
"
:
"
just a test post
"
,
"
body
"
:
"
test post body
"
,
}
})
op3
=
operations
.
Vote
(
**
{
'
voter
'
:
'
guest123
'
,
'
author
'
:
'
wlsuser
'
,
'
permlink
'
:
'
another-test-post
'
,
'
weight
'
:
10000
,
})
privateWif
=
"
5K...
"
tx
=
TransactionBuilder
(
use_condenser_api
=
True
,
steem_instance
=
wls
)
tx
.
appendOps
(
op1
)
tx
.
appendWif
(
privateWif
)
tx
.
sign
()
tx
.
broadcast
()
if
__name__
==
"
__main__
"
:
# `blocking=True` forces use of broadcast_transaction_synchronous
wls
=
Steem
(
node
=
[
"
https://pubrpc.whaleshares.io
"
],
blocking
=
True
)
print
(
wls
.
get_blockchain_version
())
print
(
wls
.
get_config
())
test_post
(
wls
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment