Skip to content
GitLab
Explore
Sign in
Register
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
9d22c9c9
Commit
9d22c9c9
authored
7 years ago
by
Holger Nahrstaedt
Browse files
Options
Downloads
Patches
Plain Diff
fix flake8
parent
5d3d31b2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
beem/steem.py
+1
-1
1 addition, 1 deletion
beem/steem.py
beemgrapheneapi/graphenerpc.py
+5
-5
5 additions, 5 deletions
beemgrapheneapi/graphenerpc.py
examples/op_on_testnet.py
+5
-4
5 additions, 4 deletions
examples/op_on_testnet.py
with
11 additions
and
10 deletions
beem/steem.py
+
1
−
1
View file @
9d22c9c9
...
...
@@ -99,7 +99,7 @@ class Steem(object):
data_refresh_time_seconds
=
900
,
**
kwargs
):
"""
Init steem
:param str node: Node to connect to *(optional)*
:param str rpcuser: RPC user *(optional)*
:param str rpcpassword: RPC password *(optional)*
...
...
This diff is collapsed.
Click to expand it.
beemgrapheneapi/graphenerpc.py
+
5
−
5
View file @
9d22c9c9
...
...
@@ -80,7 +80,7 @@ class GrapheneRPC(object):
"""
def
__init__
(
self
,
urls
,
user
=
""
,
password
=
""
,
**
kwargs
):
def
__init__
(
self
,
urls
,
user
=
None
,
password
=
None
,
**
kwargs
):
"""
Init.
"""
self
.
api_id
=
{}
self
.
rpc_methods
=
{
'
offline
'
:
-
1
,
'
ws
'
:
0
,
'
jsonrpc
'
:
1
,
'
appbase
'
:
2
,
'
wsappbase
'
:
3
}
...
...
@@ -117,8 +117,8 @@ class GrapheneRPC(object):
if
self
.
urls
is
None
:
return
while
True
:
cnt
+=
1
if
next_url
:
cnt
+=
1
if
next_url
:
self
.
url
=
next
(
self
.
urls
)
log
.
debug
(
"
Trying to connect to node %s
"
%
self
.
url
)
if
self
.
url
[:
3
]
==
"
wss
"
:
...
...
@@ -169,7 +169,7 @@ class GrapheneRPC(object):
def
rpclogin
(
self
,
user
,
password
):
"""
Login into Websocket
"""
if
self
.
ws
and
self
.
current_rpc
==
0
:
if
self
.
ws
and
self
.
current_rpc
==
0
and
user
and
password
:
self
.
login
(
user
,
password
,
api_id
=
1
)
def
rpcclose
(
self
):
...
...
@@ -221,7 +221,7 @@ class GrapheneRPC(object):
raise
except
WebSocketConnectionClosedException
:
self
.
rpcconnect
(
next_url
=
False
)
self
.
register_apis
()
self
.
register_apis
()
except
Exception
as
e
:
log
.
critical
(
"
Error: {}
\n
"
.
format
(
str
(
e
)))
sleep_and_check_retries
(
self
.
num_retries
,
cnt
,
self
.
url
)
...
...
This diff is collapsed.
Click to expand it.
examples/op_on_testnet.py
+
5
−
4
View file @
9d22c9c9
...
...
@@ -19,14 +19,15 @@ from beemgrapheneapi.rpcutils import NumRetriesReached
log
=
logging
.
getLogger
(
__name__
)
logging
.
basicConfig
(
level
=
logging
.
INFO
)
password
=
"
yfABsiDXWcCVyDC2udXGYD2psFUiQy
"
password1
=
"
4JkeGCG3HghMMdwCpHyXpiZqoXbWuv
"
password
=
"
secretPassword
"
username
=
"
beem
"
if
__name__
==
"
__main__
"
:
stm
=
Steem
(
node
=
[
"
wss://testnet.steem.vc
"
])
prefix
=
stm
.
prefix
# curl --data "username=
beem
&password=
yfABsiDXWcCVyDC2udXGYD2psFUiQy
" https://testnet.steem.vc/create
account
=
Account
(
"
beem
"
,
steem_instance
=
stm
)
# curl --data "username=
username
&password=
secretPassword
" https://testnet.steem.vc/create
account
=
Account
(
username
,
steem_instance
=
stm
)
stm
.
wallet
.
purge
()
stm
.
wallet
.
create
(
"
123
"
)
stm
.
wallet
.
unlock
(
"
123
"
)
...
...
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