Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: web wallet based python flask  (Read 783 times)

Offline alt

web wallet based python flask
« on: May 21, 2015, 05:56:37 AM »

I am writing a web wallet, based python flask,
it's not a light wallet.
it depend a wallet backend to provide rpc call.
it run a web server at local host,
update the browser in real time throw web socket.
I am not family with User interface.
please join me if you are good at web develop.

you can try the demo version now.
install:
Code: [Select]
pip install btsbots-wallet
config
Code: [Select]
cat > ~/.python-bts/bts_client.json
{
    "client_default": {
        "host": "localhost",
        "port": "3988",
        "user": "alt",
        "password": "alt"
    }
}
run
Code: [Select]
btsbots_wallet_cli
then visit http://localhost:5000

source code is here:
https://github.com/pch957/btsbots-wallet
« Last Edit: May 21, 2015, 05:58:19 AM by alt »

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 11958
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: web wallet based python flask
« Reply #1 on: May 21, 2015, 06:05:27 AM »
wow .. first public project I see that uses the websockets API .. +5% +5%!!
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline alt

Re: web wallet based python flask
« Reply #2 on: May 21, 2015, 06:27:48 AM »
wow .. first public project I see that uses the websockets API .. +5% +5%!!
it's really fast.
and flask is really good, the UI develop is totally seperate from backend.

Offline 麥可貓

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: web wallet based python flask
« Reply #3 on: May 21, 2015, 07:09:50 AM »
I encounter some error when doing '$ sudo pip install btsbots-wallet':

Quote
Collecting wsgiref==0.1.2 (from btsbots-wallet)
  Using cached wsgiref-0.1.2.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-cdh4x3j6/wsgiref/setup.py", line 5, in <module>
        import ez_setup
   
    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-cdh4x3j6/wsgiref

I googled it and tried steps from this link, but it didn;t work. Any suggestions?
PTS: PmRVDPymZqSAZEXauHZSewrUrE66af7epT
BTSX: michaelcat
Delegate Team: x1.sun  x2.sun

Offline alt

Re: web wallet based python flask
« Reply #4 on: May 21, 2015, 10:22:24 AM »
try install ez_setup, In fact I haven't install this package, but from the error message, you need it.
Code: [Select]
pip install ez_setup
I encounter some error when doing '$ sudo pip install btsbots-wallet':

Quote
Collecting wsgiref==0.1.2 (from btsbots-wallet)
  Using cached wsgiref-0.1.2.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-cdh4x3j6/wsgiref/setup.py", line 5, in <module>
        import ez_setup
   
    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-cdh4x3j6/wsgiref

I googled it and tried steps from this link, but it didn;t work. Any suggestions?

Offline alt

Re: web wallet based python flask
« Reply #5 on: May 22, 2015, 11:01:39 AM »
I have almost complete the UI frame work



Offline wuyanren

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
Re: web wallet based python flask
« Reply #6 on: May 22, 2015, 12:13:44 PM »
美元市场偏离达到30%,真的令人担忧

Offline alt

Re: web wallet based python flask
« Reply #7 on: May 22, 2015, 05:46:56 PM »
wallet balance and market


Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 11958
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: web wallet based python flask
« Reply #8 on: May 22, 2015, 05:54:55 PM »
wow .. you really know how to create a slick an nicely looking User interface .. +5% !!! definitely alot better than all webpages I ever created!
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline alt

Re: web wallet based python flask
« Reply #9 on: May 22, 2015, 06:17:38 PM »
wow .. you really know how to create a slick an nicely looking User interface .. +5% !!! definitely alot better than all webpages I ever created!
I just got a good frame work  :D

Offline alt

Re: web wallet based python flask
« Reply #10 on: May 22, 2015, 06:18:56 PM »
this is from mobile


Tuck Fheman

  • Guest
Re: web wallet based python flask
« Reply #11 on: May 22, 2015, 09:38:46 PM »
 +5%

Offline BunkerChain Labs

Re: web wallet based python flask
« Reply #12 on: May 22, 2015, 09:53:42 PM »
wallet balance and market



Looks like moonstone goes themselves some competition.. and inside of a day or two you seem to have gone even further in your development!

Keep us posted on your dev!
+-+-+-+-+-+-+-+-+-+-+
www.Peerplays.com | World's First Decentralized Tournament Platform Built Entirely on the Blockchain!
+-+-+-+-+-+-+-+-+-+-+

Offline Thom

Re: web wallet based python flask
« Reply #13 on: May 23, 2015, 01:38:54 AM »
Excellent work alt! Where did you find the info for the websocket interface, from reading the code?

I'm just starting to design a BitShares authentication plugin for the Joomla CMS, and was going to use the standard RPC interface to the BitShares client. That will work, but since I'm starting from scratch it may make more sense to utilize the new websockets I/F.

I basically just need to validate a BitShares account name and perhaps later I'll get into obtaining account balances or other info to facilitate shopping cart transactions. If you could point me to any info about the websocket I/F I would greatly appreciate it.

Here are my initial thoughts:

Basic BitShares authentication scheme for Joomla

NOTE: the credentials of Joomla and BitShares use separate passwords but share the account name. A Joomla account must be created with its own password. The common binding is the Joomla username == a valid, authenticated BitShares account name. This avoids sending wallet password across the Internet, and allows for normal Joomla authentication without BitShares but provides an isolated integration of the BitShares ecosystem if the BitShares wallet is active and unlocked.

Prerequisite: BitShares config.json must be edited to enable RPC / websocket interface on localhost for access by javascript code in web browser.

Use case: (client side | Joomla server side)

1) User starts the BitShares wallet (either GUI or CMD Line version).

2) User interacts with BitShares (opens and unlocks the wallet or just logs into GUI).

3) User clicks the "login" link on Joomla website.

4) User enters username / password credentials into input fields of Joomla form and clicks submit.


5) Joomla server response back to browser is a block of client-side javascript code that will use RPC (or websocket?) calls to the local BitShares wallet (via AJAX) to validate the username is a valid BitShares account. Only the username is passed to the client from Joomla.

6) The client code in the browser will basically return validation TRUE or FALSE to Joomla. It may also return other info to Joomla, such as account balances (TBD).

7) If the username entered in the Joomla login form is verified to be a valid BitShares account, the Joomla BitShares authentication plugin will query the Joomla DB for the username. If it exists authentication is complete and the user is logged into Joomla. If not the plugin  prompts the user for minimal Joomla account info (an email address or the std Joomla user registration form for the user to complete, but with username provided in step 4 as a read only field). If the form validates correctly a Joomla account now exists and authentication is complete for both Joomla and BitShares.

8 ) If the credentials are rejected the joomla BitShares plugin cascades down to the next active joomla auth plugin (if any). If there are no other auth methods configured, an "authentication failed" error message is displayed to user.

Injustice anywhere is a threat to justice everywhere - MLK |  Verbaltech Team Witness Proposal: https://bitsharestalk.org/index.php/topic,13837.msg243656.html#msg243656

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 11958
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: web wallet based python flask
« Reply #14 on: May 23, 2015, 11:33:18 AM »
Excellent work alt! Where did you find the info for the websocket interface, from reading the code?

I'm just starting to design a BitShares authentication plugin for the Joomla CMS, and was going to use the standard RPC interface to the BitShares client. That will work, but since I'm starting from scratch it may make more sense to utilize the new websockets I/F.

I basically just need to validate a BitShares account name and perhaps later I'll get into obtaining account balances or other info to facilitate shopping cart transactions. If you could point me to any info about the websocket I/F I would greatly appreciate it.

Here are my initial thoughts:

Basic BitShares authentication scheme for Joomla

NOTE: the credentials of Joomla and BitShares use separate passwords but share the account name. A Joomla account must be created with its own password. The common binding is the Joomla username == a valid, authenticated BitShares account name. This avoids sending wallet password across the Internet, and allows for normal Joomla authentication without BitShares but provides an isolated integration of the BitShares ecosystem if the BitShares wallet is active and unlocked.

Prerequisite: BitShares config.json must be edited to enable RPC / websocket interface on localhost for access by javascript code in web browser.

Use case: (client side | Joomla server side)

1) User starts the BitShares wallet (either GUI or CMD Line version).

2) User interacts with BitShares (opens and unlocks the wallet or just logs into GUI).

3) User clicks the "login" link on Joomla website.

4) User enters username / password credentials into input fields of Joomla form and clicks submit.


5) Joomla server response back to browser is a block of client-side javascript code that will use RPC (or websocket?) calls to the local BitShares wallet (via AJAX) to validate the username is a valid BitShares account. Only the username is passed to the client from Joomla.

6) The client code in the browser will basically return validation TRUE or FALSE to Joomla. It may also return other info to Joomla, such as account balances (TBD).

7) If the username entered in the Joomla login form is verified to be a valid BitShares account, the Joomla BitShares authentication plugin will query the Joomla DB for the username. If it exists authentication is complete and the user is logged into Joomla. If not the plugin  prompts the user for minimal Joomla account info (an email address or the std Joomla user registration form for the user to complete, but with username provided in step 4 as a read only field). If the form validates correctly a Joomla account now exists and authentication is complete for both Joomla and BitShares.

8 ) If the credentials are rejected the joomla BitShares plugin cascades down to the next active joomla auth plugin (if any). If there are no other auth methods configured, an "authentication failed" error message is displayed to user.

I haven't read your post in full (I appologize) but you may want to read
http://bytemaster.bitshares.org/article/2014/12/22/BitShares-Login/
If you haven't already
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

 

Google+