Bitcoin Forum
September 23, 2024, 03:14:03 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 [5]
81  Bitcoin / Development & Technical Discussion / Re: PHP JSON sendfrom function on: May 09, 2011, 11:04:37 PM
I have figured this out, I overlooked that the wallet has no balance to send anything from  Grin . I was able to use move though as the whole point of all this was to consolidate balances into one account. Although strangely enough I'm seeing ghost accounts that do not show up in the wallet but are listed by the RPC, oh well. For anyone following this and interested in the code, here ya go!

Code:
<?php
require_once dirname(__FILE__) . "/classes/jsonRPCClient.php";

define ("BC_HOST""127.0.0.1");
define ("BC_USER""***");
define ("BC_PASS""***");
define ("BC_PORT""8332");

$bitcoin = new jsonRPCClient("http://".BC_USER.":".BC_PASS."@".BC_HOST.":".BC_PORT);

$to "ACCOUNT_NAME";

print_r($bitcoin->listaccounts());

echo 
"<hr>";

foreach(
$bitcoin->listaccounts() as $key=>$value){
if($bitcoin->getbalance((string)$key) > "0")
$bitcoin->move((string)$key, (string)$to, (float)$value);
echo "$key => ".(float)$value."<br>";
}
?>


This simply moves all balances from accounts greater than 0 into the account you tell it to. I would really like to settle the negative accounts somehow, but I'll get into that soon. Needed this because on my bank project I have been working on my account shows I have a value > 0, but the wallet total shows 0...
82  Bitcoin / Development & Technical Discussion / Remove accounts? on: May 09, 2011, 10:53:43 PM
Hey, I was wondering if there was a way to remove accounts other than starting a new wallet? Mostly for aesthetic purposes...
83  Bitcoin / Development & Technical Discussion / PHP JSON sendfrom function on: May 09, 2011, 09:51:00 PM
Would someone mind taking a look at this, I can't figure out what I'm doing wrong, it seems like it shouldn't be this difficult. I think the problem is my typecasts, whether its a string, int, or float.

Code:
<?php
$bitcoin 
= new jsonRPCClient("http://".BC_USER.":".BC_PASS."@".BC_HOST.":".BC_PORT);

$to "1FN8m1bzfzqo761p4vAwU6Rb2vJD3dFs7a";

//print_r($bitcoin->listreceivedbyaccount());

foreach($bitcoin->listreceivedbyaccount() as $key=>$value){
if($bitcoin->getbalance((string)$value['account']) > "0")
$bitcoin->sendfrom((string)$value['account'], (string)$to, (float)$bitcoin->getbalance((string)$value['account']));
//echo "$value[account] => $value[amount]<br>";
}
?>


I get this error:
Code:
Warning: fopen(http://...@127.0.0.1:8332) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in \www\classes\jsonRPCClient.php on line 132

Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to http://****:****@127.0.0.1:8332' in \www\classes\jsonRPCClient.php:140 Stack trace: #0 \www\bitcoin.php(20): jsonRPCClient->__call('sendfrom', Array) #1\www\bitcoin.php(20): jsonRPCClient->sendfrom(0, '1FN8m1bzfzqo761...', 3.07) #2 {main} thrown in \www\classes\jsonRPCClient.php on line 140

print_r shows this for $bitcoin->listreceivedbyaccount()

Code:
Array ( [0] => Array ( [account] => Mining [label] => Mining [amount] => 3.07 [confirmations] => 424 ) [1] => Array ( [account] => Personal [label] => Personal [amount] => 0.99 [confirmations] => 1021 ) [2] => Array ( [account] => f899139df5e1059396431415e770c6dd [label] => f899139df5e1059396431415e770c6dd [amount] => 0.3 [confirmations] => 873 ) )
84  Bitcoin / Project Development / Re: Bitcoin Credit Union on: May 08, 2011, 08:36:07 PM
This is a pioneering idea! I love seeing things like this. The problem is you haven't established what exactly your aim is and you haven't mentioned any benefits to users.

Earning an interest rate would be great, but you haven't worked out how you'll earn income. If it's by charging users to withdrawal/send money, then you need to tell us exactly how much.

Also, not using https on your site is a huge red flag and indicates you haven't given due diligence to security. Someone mentioned you could get a free ssl certificate here at a site called http://www.startcom.org. I don't know if there are eligibility requirements or not. You could also self-sign.

http://bitcointalk.org/index.php?topic=2626.0

Thanks ryan!

I appreciate your interest, my aim is simply to create a bank system that is not just a simple ewallet, those are great and I use them myself but I really wanted something that would benefit the people who use it, so with that regard I'm trying to make something I would want to use myself.
 
Right now depositing and withdrawing are free but to transfer funds between accounts will have a fee. The actual fee itself is determined by the users. I will initially set it at a .1% rate and from there the members can cast votes to increase or decrease this fee. I should mention that votes themselves will have their own fee, also determined by the members. This is meant to limit the number of votes cast by any one person. My goal is not to be any kind of president of the credit union, the very nature of credit unions are that they are ran by its members (volunteers). Your votes will be handled by the amount of weight you hold to the credit union which is based on your shares compared to the total number of shares the CU holds.

Just so you know I do not intend to keep this on my local machine, right now I just wanted to let you guys look at it and if you wanted to play around with it a bit you could. Since its not on the testnet I don't want to open registrations. Once I feel good about the functionality of the website and it gets moved to a new server I will look into ssl and getting that setup.

Again thanks for your interest and suggestion, I very much appreciate it!
85  Bitcoin / Project Development / Re: Bitcoin Credit Union on: May 05, 2011, 11:37:32 AM
Hi Sentry,

You indicate that members are paid for maintaining a balance.  Can you explain how this works?


Hey matt,

keeping a balance in your savings allows dividends to be paid to your account. dividends come from bank profits on things such as transaction fees, and overdraft fees (overdrafting undecided). also you will be given the option to invest in member loans where the interest is paid to the investors.

thankyou for the question, it makes me rethink how things should work and whether or not they will at all. also, if you have any ideas or suggestions, anything at all that you thing would be a better way of doing things PLEASE feel free to voice your opinions here.
86  Bitcoin / Project Development / Bitcoin Credit Union on: May 05, 2011, 03:55:10 AM
Bitcoin Credit Union
http://bccu.no-ip.org

Status: Registrations are open, approval required. Currently alpha state.
Follow on Twitter: http://twitter.com/#!/BitcoinCU


Donations are welcome and appreciated!
87  Bitcoin / Project Development / Re: Bitkarma on: May 03, 2011, 02:59:35 AM
Sort of, but I decided to scrap this idea because when I tried to explain it to my friends the response I constantly got was, "but why would anyone just give to you because of an arbitrary number?" Working on something else...  Grin

Also, I noticed there is another project with the word karma involved. If thats your site, sorry about all this.
88  Bitcoin / Project Development / Bitkarma on: April 29, 2011, 03:52:44 AM
I have been working on this project for a few days now and would like some feedback. The idea behind this site is simply give and you will receive in return.

By giving to other users you gain karma, the users with the most karma are listed where everyone can see. As people give back to them their karma goes back down so others can get a chance to be seen and given to by all.

I'm going to start with a closed beta for a few reasons, mostly because I'm stuck hosting this myself. Also because I don't want a bunch  of people complaining when a bug is found considering BTC is actually worth something. Lastly because I am not an artist, by no means is this site pretty (yes it has color). So if your interested let me know here and I'll get you set up, hopefully I can get enough interested people so that this thing works as its supposed to. Besides, if you help I'm likely to give to you in the spirit of testing!

Cheers!
Pages: « 1 2 3 4 [5]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!