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: BitShares ASP.NET Web API  (Read 712 times)

0 Members and 1 Guest are viewing this topic.

Online amencon

  • Sr. Member
  • ****
  • Posts: 230
    • View Profile
BitShares ASP.NET Web API
« on: November 07, 2014, 05:10:21 AM »

So I had some extra time last weekend and decided I'd finally get around to building the .NET API for a bitshares client.  This killed 2 birds with 1 stone for me since I've been wanting to build something with the .NET Web API framework as well as figuring out how to communicate with the BitShares client.

You can find the info page at: bitsharesapi.info
API URL structure is **http://bitsharesapi.info/api/commands/<command>?paramString=<parameterString?>** (or you can go to the info page and fill in the text boxes to see an example in a pop up window).

So what is this good for?  Probably nothing, I suppose a quick way you can get info from a bitshares client remotely if you trust me.  Mostly a side project for my own edification and I might use it to build sites in the future hosted on machines without a local client running, though if someone is using .NET and they think the code might help them with their own project I've thrown up the project files on GitHub here: https://github.com/amenconi/BitSharesDotNetAPI

Thanks.

testz: Edit post, fix github link.
« Last Edit: November 07, 2014, 06:41:38 AM by testz »

Offline bytemaster

Re: BitShares ASP.NET Web API
« Reply #1 on: November 07, 2014, 05:46:11 AM »
Nice... may want to avoid using popups to display result.
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline betax

  • Hero Member
  • *****
  • Posts: 808
    • View Profile
Re: BitShares ASP.NET Web API
« Reply #2 on: November 07, 2014, 06:46:09 AM »
That's great, you could port it to VNext so it can run in linux. Your service can be reused too if you want to create a bot.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12267
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: BitShares ASP.NET Web API
« Reply #3 on: November 07, 2014, 06:58:12 AM »
+5% ... thanks for open sourcing it!!
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Online amencon

  • Sr. Member
  • ****
  • Posts: 230
    • View Profile
Re: BitShares ASP.NET Web API
« Reply #4 on: November 07, 2014, 08:58:59 AM »
Nice... may want to avoid using popups to display result.
Hmm true, the home page was more of an afterthought but your right the pop up is completely pointless, I've tweaked it to return the URL and result in the page.

That's great, you could port it to VNext so it can run in linux. Your service can be reused too if you want to create a bot.
Interesting, I've actually never heard of VNext but I'll definitely check it out.  You see any good use cases in particular for this service?

+5% ... thanks for open sourcing it!!
Of course man.  I'm a big proponent of open source, I just wish I could do the same for a lot of my other work, not that it's groundbreaking or anything.

So now that I know how to communicate with the client in .NET, the question is what kind of web app would people like to see?  Awhile ago of course I thought of doing something similar to bitsharesblocks.com, but svk has done such an awesome job with it I didn't see any reason trying to copy it.

Offline betax

  • Hero Member
  • *****
  • Posts: 808
    • View Profile
Re: BitShares ASP.NET Web API
« Reply #5 on: November 07, 2014, 11:08:16 AM »
Use cases:

+ Full web api, to administrate your wallet remotely as you said, easily from a web page. Security is a concern, so I would limit what it can be done.

+ The web api would allow you to do integrate with a web wallet, you could use angularjs and even "reuse" the code from the main wallet.

+ A restricted web api can be used for security, adding an extra barrier to break to get into the wallet.

+ The service can be used as the generic interface class for anything :) (An Exchange, a bot, e-commerce)

Mainly you have .net and bitshares the world is your oyster. (same as nodejs, python, c++ )

Just make your life easier and make sure is portable (mono, linux)
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Online amencon

  • Sr. Member
  • ****
  • Posts: 230
    • View Profile
Re: BitShares ASP.NET Web API
« Reply #6 on: November 07, 2014, 05:10:23 PM »
Use cases:

+ Full web api, to administrate your wallet remotely as you said, easily from a web page. Security is a concern, so I would limit what it can be done.

+ The web api would allow you to do integrate with a web wallet, you could use angularjs and even "reuse" the code from the main wallet.

+ A restricted web api can be used for security, adding an extra barrier to break to get into the wallet.

+ The service can be used as the generic interface class for anything :) (An Exchange, a bot, e-commerce)

Mainly you have .net and bitshares the world is your oyster. (same as nodejs, python, c++ )

Just make your life easier and make sure is portable (mono, linux)
Yeah originally I was going to limit the API to only respond to "GET" requests but collating that list of commands seemed like a lot of work unless others actually wanted to use the service.  Unfortunately the sticking point in my mind is how does anyone trust the API information considering it moves through my server first?  In theory couldn't I change data or have my own client version that returns bad results?  It's true there wouldn't be much financial incentive if the API didn't accept any input commands and manage any wallets for others though.

If there is a way to overcome the trust issue I could see how it could be very useful.  Who wants to have to run their own heavyweight client for every little website they want to make that needs some client information, right?

Thanks for the ideas and the heads up on VNext/MVC 6, didn't realize a new version was coming out and I like the idea of them merging the frameworks and making it cloud friendly.

 

Google+