-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: EMC #15
Comments
Generally no problerm, doesn't sound like too much work. Wouldn't it be a better attempt to just implement a JSON API for iBank? Advantages:
You just would need a way to associate EMCoin-Addresses to Player accounts. |
I glad, when I see, you agree to help me! Regarding JSON API for iBank:
If you agree with my reasons, and when you ready to start work - I will help you to make 1st step: install your own EMC server, for work with it. This is possible 3 OSes: Windows, Linux, FreeBSD. Thereafter, I will explain step-by-step, what need to do. |
Continue: About "You just would need a way to associate EMCoin-Addresses to Player accounts" Yes, you right. In my design, iBank keeps table "EMC" (or another name). That table has 2 columns:
For create new EMC Address, need send JSON request to coin server "getnewaddress", with account name == "iBank". So, as you see, don't needed to create WEB page, or do something complex. Also, good idea - always log new addresses, assigned to players, in the text file. |
Hmm I'm not quite sure if it's clever to directly integrate this into iBank. So basically that plugin is handling all the JSON communication with the daemon Advantages:
Please let me know your opinion on this. |
I like your idea, to encapsulate Coin-interface into separate sub-plugin. As I understand, when player asks /show_addr_emc, plugin can get control without But, if any player asks balance from iBank, then iBank must ask plugin to Possible interface: iBank asks sub-plugin "what is new"? If everything is OK for you, we can start wotk for sub-plugin. I think, "emercoin" is best. But, of course, you can propose another name. Anyway, currency config must include params for connect that or another coin-server. Config params looks like: Maybe something more, but I think, it is enough. Also, question: Is this possible to deposit something into system clipboard from minecraft? |
The sub plugin won't have problems at all modifying iBank data (exposed API pretty much)
The above should be enough. |
Seems like clear, and must work. I cannot imagine serious problem, but inconvenience with copy/paste address at client's side. If possible to copy EMC address to user's clipboard, this problem is resolved, too. When you install program, you will need modify config for activate http port listening. Mining uses same JSON RPC interface. For testing server and RPC access, you can run from unix command line like: |
Sorry for the delay, didn't quite get to implementing this yet. Any deadline you have on your side? |
I don't have any deadlines, this is 100% our family initiative. But, I think, idea is brilliant, and this chat-chain is open to public. So, I little afraid, anyone else can steal/use this idea, and we will lost chance to establish "out-the-gameworld minecraft economy..."
|
If you get me a windows-build, it would be really cool. |
Yes, I have. Please download from my site: When db load is complete (no "data too old" in bottom line, and in righ-bottom corner is green checkbox) - exit from program. You need to create in there file emercoin.conf, for allow program work as server. There is sample of this file: listen=1 Thereafter, start program again. If everything works OK, you can try access same info by JSON request, when you complete these initial steps, I will explain, what to do next. |
Got that done, still working on plugin... |
Very good!!! OK. Following is next step, how to create new unique address for receive payment: This is API request "getnewaddress", with parameter: params":["iBank"] curl Parameter "iBank" - account name - I think, it must be written in plugin config, Request generates new address, linked to this account, in my sample: Address always has same length, 34 characters. But, this feature is not standardized, You can fetch list of addresses, linked for account iBank by: curl It returns array of addresses, belong to specified account. Unfortunately, current coin server cannot delete account/address. You can only move address to another account. But, this is not important for our application, just need to know about this feature. And, what you need to do as 1st step:
For 3: If error structure is not null, then it contains something like: When you complete this part, I will explain, how to extract payments and add into player accounts, For reference, there is fill list of JSON RPC commands: Thanks in advance, |
I won't have problems with the BITCOIN (or to be specific Emercoin) JSON RPC, since I just use BitcoinRPC library. Dont reinvent the wheel, if it works great :) |
OK, good! I did not know about this library. Very good, you found it and use. My idea - to use: If you need details, I will share. |
The library seems to use "listsinceblock". |
listsinceblock returns all transaction in the EMC-network since some block, to all addresses/wallets. There is tricky, how correctly extract last N transactions. Problem is - while you extract list So, I think, easiest way - to extract all transactions in single batch. I think, need to run couple of iterations, for example, with start with "from=0, count=32", and check earliest Tx (in the end-of-the-list): if(it_time < tx_time from last batch)? Usually, loop will ends on 1st iteration; And easy to count, with this strategy (reload whole TX-list), there will just 2n records moved over localport (or LAN) - this is acceptable system overload. So, loop must be like: uint64_t last_db_tx_time = extract_max_time_from_db(); // process tx_arr here - maybe need skip head of the list, with small confirmations. conf < 4, for example |
Sure it can be a huge list, but I think it is acceptable. The advantage of it like this is, that i basically don't have to do anything, because I can just do the following:
Which gives me the confirmed transactions, without any outlay. |
=====CONTINUE ==== Or, another way, if you do not want support in the iBank detailed input TX list: |
That seems like an even better solution. |
Oh, sorry. I sent partial message, and server rejects updates. |
I checked my test EMC-server - getreceivedbyaddress works with EMC: [olegh@bsd ~/W/coin]$ emercoind getreceivedbyaddress EX49umAGd35Gw6agjN8U7CY7faDocqXNRp [olegh@bsd ~/W/coin]$ emercoind getbalance Also, important - it is not decrease value, when money sent out from this account (you see, total balance is less than received by specified account). So, must work! |
Should theoretically work now. You find a bit of explanation there. To download:
FYI: It is possible to entirely translate this plugin. |
Pair questions:
I will start testing right now... |
Sorry, plugin is started, created directory iBankCryptoCurrency, minecraft@bsd /var/games/bukkit/plugins]$ cd iBankCryptoCurrency Following - error printout from server start: [19:04:13 INFO]: [iBankCryptoCurrency] Enabling iBankCryptoCurrency v0.1(c05ddb2499dd746bde06420f6106a62697974c03)[true]{InitialGluehorse} |
The plugin needs iBank ofcourse. Therefor account name = (iBank)Bank Account Name, as described in the repo above. |
iBank was installed. But, you see above, some error happening at plugin initialization. Please check. If needed, I can grant you ssh access to my server, for you test it on my site. |
SSH should be the easiest. |
check e-mail, please |
I wrote simple "copy-to-clipboard" WEB-page: |
Further discussion should go here: |
Hi,
My son invented nice idea, and I want to help him to implement it. Also, need your assistance in this project.
https://bitcointalk.org/index.php?topic=472142.0
http://emerfor.org/folding_home/about_en.php
http://emerfor.org/
Players use spare time of their computers to help Stamford University;
Players rewarded EMC for this work
Players transfer EMCs to game server
iBank fetch EMC-transaction, and deposits EMCs to game accounts
Players use these moneys for fun in game world
What you will get from this project?
I don't know JAVA, can read, but cannot write. However, I know C++ very good,
and know JSON_RPC interface to Emercoin Server (almost as same as Bitcoin).
So, if you are interested, we can work on this task together - I will write interface
to Emercoin server, and you will add it to iBank.
Currently, I know algorithms, and architecture,
how to organize data in this subsystem.
If you are interested, please contact me:
khovayko@gmail.com
Thanks in advance,
Oleg
The text was updated successfully, but these errors were encountered: