Bitcoin Forum
May 11, 2024, 04:07:24 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 5 6 7 [8] 9 10 »
141  Bitcoin / Development & Technical Discussion / why JSON RPC values not use INT64 instead of float string? on: March 03, 2011, 12:49:34 PM
This would solve a bunch of problems.

Why not just return the int64 and let the client cast it to a float & divide 10^8 for display?

Currently since the JSON RPC returns floats, any library you use will return the values as floats, not strings. So to get the int64 value you need to multiply the float by 10^8 and cast to an int for internal usage.

Also by returning the value as int64, it will be enforcing good practice on clients instead of them unwittingly using floats.
142  Other / Off-topic / Anonymous or distributed web technologies on: March 02, 2011, 03:14:22 PM
Say I wanted to make a website selling newspapers in a country where it's illegal to buy them. What technologies could I use?

Freenet only serves static pages AFAIK, so not sure if that would be appropriate since it only hands out content but doesn't provide a way for users to interact with the site (discreetly or publicly).

Would a tor service fit the job here? What other tools exist?

The aim is to provide some level of protection for buyers of newspapers on the site (enough to make the government go after easier fish) and make it difficult to attack the site owner.
143  Bitcoin / Development & Technical Discussion / Linux packages should have an autodetect 32/64 bit using bash on: February 26, 2011, 05:30:59 PM
bitcoin.linux
Code:
#!/bin/bash
MACHINE_TYPE=`uname -m`
WORKING_DIR=`basename $0`
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
  # run 64-bit bitcoin here
  $WORKING_DIR/bin/64/bitcoin
else
  # run 32-bit bitcoin here
  $WORKING_DIR/bin/32/bitcoin
fi

Idea came to me after a user on IRC was having trouble running bitcoin (didn't know their arch nor how to navigate in console nor about bitcoin/bitcoind distinction).

My sister has been using bitcoin, and because of the long startup/multiple executables she was just going into every directory under bin and opening all the binaries repeatedly until it bitcoin opens. She assumed it was because bitcoin is broken. This script would also alleviate that problem.
144  Bitcoin / Development & Technical Discussion / [PATCH] InitializationCompleted on: February 25, 2011, 09:57:17 AM
I noticed that https://github.com/bitcoin/bitcoin hasn't had this patch merged into it,

https://github.com/genjix/spesmilo/blob/master/bitcoin.patch

I've been using this for a while and it works fine.

Can it be merged to make it into the next release please?
145  Bitcoin / Bitcoin Discussion / 6 hours and 0 confirms! on: February 24, 2011, 10:51:46 PM
At 1735 I made a transaction sending BTC to another offline wallet of mine using a computer with 0.3.19 beta. 8 connections and the full block chain.

At 2200 I downloaded 0.3.20 and opened that instead... Now it's 2250 and still 0 confirms...

Code:
    {
        "account" : "",
        "address" : "16xuHMEHQYVXTRJ6no5MivMVcCtPifEGsu",
        "category" : "send",
        "amount" : -65.48000000,
        "fee" : -0.00769472,
        "confirmations" : 0,
        "txid" : "fcf8d4487dc2d351879d2e2788e2b9554b80607c29e078f3b2b821496deb0f0e",
        "time" : 1298568918
    }

{
    "version" : 32001,
    "balance" : 0.00000000,
    "blocks" : 110231,
    "connections" : 2,
    "proxy" : "",
    "generate" : false,
    "genproclimit" : -1,
    "difficulty" : 36459.88692508,
    "hashespersec" : 0,
    "testnet" : false,
    "keypoololdest" : 1297624404,
    "paytxfee" : 0.00000000,
    "errors" : ""
}

Can I retrieve my bitcoins now that this transaction seems to be borked?
146  Other / Off-topic / Xtreme Programming (XP) on: February 24, 2011, 06:43:12 PM
What are your experiences of pair programming when 1 person has significantly higher skill advantage than the other? Is it a good way to teach programming?

How does it work in practice? Do they take turns to code while the other watches? Doesn't seem very efficient... Is there a looser way to code in pairs?

I'm used to agile dev in general though, but am thinking whether I can use pair programming as a teaching tool by constructing shared projects. The usual teacher-student method is too dictatorial for my tastes.
147  Economy / Marketplace / Web or graphic (3D or vector) design, teaching 3D modelling, coding, writing on: February 24, 2011, 01:41:06 PM
I want to buy a new laptop but don't have enough BTC and am trying to boycott paypal.
http://bitcointalk.org/index.php?topic=3817.0

Web design,
http://genjix.freehostia.com/mtux/  (all my own design)
http://genjix.freehostia.com/  (partially mine)

Or graphics design,
http://genjix.freehostia.com/#art

Or coding,

(Qt in Python, also know C++...)

Or can teach you to use Blender over Skype.

Writing:
http://en.wikipedia.org/wiki/User:Genjix/Free_software

Looking to gain 50-100 BTC. These things should take ~1-2 days.
148  Other / Off-topic / Low cost desktops? on: February 24, 2011, 12:03:49 PM
My laptop broke and I want a temporary system until I get a better computer later.

(I'm from UK)

Looking around at parts it seems I can get one for around ~€170 or $230? (Monitor for €70 and desktop for €100)

Is it possible to go any cheaper since this is a temporary system? Even if it's an old 600mhz desktop with a 14inch CRT for €30
149  Bitcoin / Bitcoin Discussion / wallet.dat backup tool on: February 17, 2011, 01:49:09 PM
  sudo aptitude install python-m2crypto git
  git clone git://github.com/genjix/sekureco.git
  cd sekureco
  ./sekureco help


Enjoy.
https://github.com/genjix/sekureco
150  Bitcoin / Development & Technical Discussion / verifying hashes using sha256sum on: February 15, 2011, 01:27:37 AM
http://blockexplorer.com/rawblock/00000000000271de9d8b94afff543366e290e995f3e3e337bb86a0b7bf02e8d1

Take this as an example.

Bitcoin is little endian, right?

So we need:
4 bytes - version
32 bytes - previous block hash
32 bytes - merkle root number
4 bytes - 4 second periodic timestamp (is it unix time?)
4 bytes - bits for difficulty
4 bytes - random nonce
1 byte - 0

From blockexplorer what values would I need to pickle into the file?
version - 1
prev hash - 00000000000148c04e58dca8e1a2df251339c81e2dfe1ff0e9d655b7b4ca428d
merkle root - 72febc107470c4f83e224f9683a5c7fb24c4dece8412b9d95db277c8dd75451d
timestamp - 1297566305
"bits" - 1b028552
nonce - 329961997
0

So I would write these to a file in binary little endian format then run:

sha256sum -b block_header > output
sha256sum -b output

and that should give 000000000001b85fa1709c6824d19d5c7d20736b0b2ea5fd470705a9513c42ae

right?

and how is 'version' decided? do new bitcoin versions up that number and fork the blockchain while accepting version 1 from before a certain point?
151  Other / Off-topic / Atlas Shrugged trailer released on: February 14, 2011, 06:06:08 AM
And it's so so so bad. Why would anyone make a (possibly three part given this is part one) film out of such a pile of crap.

http://socyberty.com/philosophy/atlas-shrugged-trailer-released-the-travesty-that-is-ayn-rand/

lol, so the turd finally droped from the anus.
152  Bitcoin / Wallet software / !! new bitcoin client !! on: February 14, 2011, 05:24:53 AM
Made a new client. Looking for testers and feedback.
https://github.com/genjix/spesmilo



And showing off internationalisation (slightly newer than above... made some minor corrections),



Code:
# as of version 47908a890726f424371c9784b8508cff163c2c78 (Gavin Andresen) Thu Feb 10 19:24:22 2011 -0500
#  Visual C++ compatibility fixes
git clone https://github.com/bitcoin/bitcoin

# apply the bitcoin.patch in this directory
make -f makefile.unix bitcoind
# copy to /usr/local/bin
sudo cp bitcoind /usr/local/bin

# install pyside for your distro, http://developer.qt.nokia.com/wiki/PySide_Binaries_Linux
sudo add-apt-repository ppa:pyside
sudo apt-get update
sudo apt-get install python-pyside

# run the program
python main.py

# Esperanto translation:
#   uncomment the 5th line from the bottom of main.py

Still got lots of features planned.
153  Bitcoin / Development & Technical Discussion / [PATCH] isinitialized RPC method on: February 13, 2011, 08:44:30 AM
Why:
Currently it is hard for a GUI wrapping bitcoind by means of the RPC-server to detect when bitcoin is running but still initialising. This seeks to resolve that.

What does it do:
- Moves RPC server startup to very beginning.
- Adds isinitialized method.

Change made to bitcoin/bitcoin from github

http://pastebin.com/LYtBRXgk

Code:
diff --git a/init.cpp b/init.cpp
index 04bdd68..52cf7a1 100644
--- a/init.cpp
+++ b/init.cpp
@@ -115,6 +115,7 @@ bool AppInit(int argc, char* argv[])
     } catch (...) {
         PrintException(NULL, "AppInit()");
     }
+    fInitializationCompleted = true;
     if (!fRet)
         Shutdown(NULL);
     return fRet;
@@ -122,6 +123,9 @@ bool AppInit(int argc, char* argv[])
 
 bool AppInit2(int argc, char* argv[])
 {
+    if (GetBoolArg("-server") || fDaemon)
+        CreateThread(ThreadRPCServer, NULL);
+
 #ifdef _MSC_VER
     // Turn off microsoft heap dump noise
     _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
@@ -443,9 +447,6 @@ bool AppInit2(int argc, char* argv[])
     if (!CreateThread(StartNode, NULL))
         wxMessageBox("Error: CreateThread(StartNode) failed", "Bitcoin");
 
-    if (GetBoolArg("-server") || fDaemon)
-        CreateThread(ThreadRPCServer, NULL);
-
 #if defined(__WXMSW__) && defined(GUI)
     if (fFirstRun)
         SetStartOnSystemStartup(true);
diff --git a/rpc.cpp b/rpc.cpp
index 69b09bc..72fc9a8 100644
--- a/rpc.cpp
+++ b/rpc.cpp
@@ -28,6 +28,8 @@ void ThreadRPCServer2(void* parg);
 typedef Value(*rpcfn_type)(const Array& params, bool fHelp);
 extern map<string, rpcfn_type> mapCallTable;
 
+bool fInitializationCompleted = false;
+
 
 Object JSONRPCError(int code, const string& message)
 {
@@ -146,7 +148,6 @@ Value help(const Array& params, bool fHelp)
     return strRet;
 }
 
-
 Value stop(const Array& params, bool fHelp)
 {
     if (fHelp || params.size() != 0)
@@ -277,18 +278,22 @@ Value getinfo(const Array& params, bool fHelp)
 
     Object obj;
     obj.push_back(Pair("version",       (int)VERSION));
-    obj.push_back(Pair("balance",       (double)GetBalance() / (double)COIN));
-    obj.push_back(Pair("blocks",        (int)nBestHeight));
-    obj.push_back(Pair("connections",   (int)vNodes.size()));
-    obj.push_back(Pair("proxy",         (fUseProxy ? addrProxy.ToStringIPPort() : string())));
-    obj.push_back(Pair("generate",      (bool)fGenerateBitcoins));
-    obj.push_back(Pair("genproclimit",  (int)(fLimitProcessors ? nLimitProcessors : -1)));
-    obj.push_back(Pair("difficulty",    (double)GetDifficulty()));
-    obj.push_back(Pair("hashespersec",  gethashespersec(params, false)));
-    obj.push_back(Pair("testnet",       fTestNet));
-    obj.push_back(Pair("keypoololdest", (boost::int64_t)GetOldestKeyPoolTime()));
-    obj.push_back(Pair("paytxfee",      (double)nTransactionFee / (double)COIN));
-    obj.push_back(Pair("errors",        GetWarnings("statusbar")));
+    obj.push_back(Pair("isinitialized", (bool)fInitializationCompleted));
+    if (fInitializationCompleted)
+    {
+        obj.push_back(Pair("balance",       (double)GetBalance() / (double)COIN));
+        obj.push_back(Pair("blocks",        (int)nBestHeight));
+        obj.push_back(Pair("connections",   (int)vNodes.size()));
+        obj.push_back(Pair("proxy",         (fUseProxy ? addrProxy.ToStringIPPort() : string())));
+        obj.push_back(Pair("generate",      (bool)fGenerateBitcoins));
+        obj.push_back(Pair("genproclimit",  (int)(fLimitProcessors ? nLimitProcessors : -1)));
+        obj.push_back(Pair("difficulty",    (double)GetDifficulty()));
+        obj.push_back(Pair("hashespersec",  gethashespersec(params, false)));
+        obj.push_back(Pair("testnet",       fTestNet));
+        obj.push_back(Pair("keypoololdest", (boost::int64_t)GetOldestKeyPoolTime()));
+        obj.push_back(Pair("paytxfee",      (double)nTransactionFee / (double)COIN));
+        obj.push_back(Pair("errors",        GetWarnings("statusbar")));
+    }
     return obj;
 }
 
@@ -1806,6 +1811,8 @@ void ThreadRPCServer2(void* parg)
             if (valMethod.type() != str_type)
                 throw JSONRPCError(-32600, "Method must be a string");
             string strMethod = valMethod.get_str();
+            if (!fInitializationCompleted && strMethod != "help" && strMethod != "getinfo")
+                throw JSONRPCError(-42000, "Still initializing");
             if (strMethod != "getwork")
                 printf("ThreadRPCServer method=%s\n", strMethod.c_str());
 
diff --git a/rpc.h b/rpc.h
index 48a7b8a..85c3ef3 100644
--- a/rpc.h
+++ b/rpc.h
@@ -4,3 +4,4 @@
 
 void ThreadRPCServer(void* parg);
 int CommandLineRPC(int argc, char *argv[]);
+extern bool fInitializationCompleted;

PS plz add .patch to allowed attachments Cheesy
PSS upload folder is full! i cannot upload the patch file.
154  Bitcoin / Development & Technical Discussion / Payment to yourself detection on: February 13, 2011, 04:26:25 AM
Can I guarantee that txids will only ever occur once or twice in listtransactions? IIRC I cannot, right? (because you can split payments or something- not too clear on this).
155  Other / Off-topic / UK: got paypal? on: February 12, 2011, 10:40:28 PM
Hey,

I need to buy a part for my laptop, but the guy ONLY takes paypal. I've tried several cards already and they give me various stupid errors (or redirect to main page or need 7 day confirmation .etc)...

Anyone here able to let me xfer them £10 through internet banking and then they send the £10 to him for me? Trusted members only (don't want to get scammed :p)

Thanks
156  Bitcoin / Development & Technical Discussion / file_lock in python/Qt on: February 12, 2011, 10:03:57 PM
Hey,

So I want to detect when bitcoind is running but that RPC server hasn't yet started up.

The way bitcoind checks whether it's already running is by using boost::file_lock
http://www.boost.org/doc/libs/1_35_0/boost/interprocess/sync/file_lock.hpp

Any ideas how to use this in python? I could create my own binding for python but I'd rather not have a compilable dependency for such a minor thing.

The problem with checking a systems processes is that it's unreliable to assume the program is always called bitcoin (i.e different server implementations).

I tried a different file-lock library:
Code:
$ bitcoind
$ sudo apt-get install python-lockfile
$ python
import lockfile
lock = lockfile.FileLock('.bitcoin')
with lock:
    print lock.path

'.bitcoin'
$ cd .bitcoin/
$ python
import lockfile
lock = lockfile.FileLock('.lock')
with lock:
    print lock.path

'.lock'

Any ideas how to do this? Must be cross-platform. File locking is an OS function, so maybe I'm not using the correct file?
157  Bitcoin / Bitcoin Discussion / bubble imminent on: February 12, 2011, 07:09:33 PM
Yesterday night there was 1.1 BTC per $. This morning it was 0.9 BTC per $ briefly.

- Small core community.
- Not many services. People mainly using bitcoin as an investment vehicle.
- Sharp increases in value.
+ Linux users tend to be idealists and not invest in something because of money necessarily.
+ Lots of outside interest recently.

I conclude a large chance of a bubble soon happening.
158  Other / Off-topic / laptop power jack on: February 12, 2011, 07:14:52 AM
I did a bit of investigation and came across this page,                                                                                                        

http://www.laptopjacks.com/view_part/LG-Laptop-DC-Power-Jack-LG41225.html

Part Number: LG41225
Center pin diameter: 2.5mm
(and lists my laptop there as LG P300)

However my laptop has 5 contact points whereas that picture only has 3.

I then saw this power jack which I believe is the same type,
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=400145746359

What does that metal cover do? For the description of another unrelated power jack, I saw "If your old jack has 3 pins only, you can easily remove the metal shield covering the DC Jack" <- so why do I need it?

meh... any suggestions? I found half of the power jack I need... now it just needs it's winter jacket.
159  Bitcoin / Bitcoin Discussion / Core ideas of Bitcoin on: February 11, 2011, 12:07:32 AM
What are the core ideas? Don't get bogged down in details- it's for non-technical people.

- Distributed. We set the rules.
- Microtransactions.
- Transactions cost nothing.
- Anonymous

How would you phrase this to the common man? I've heard the gold farming analogy for mining, but how about for everything else?

How would you best explain distribution while allaying any security fears?
160  Bitcoin / Bitcoin Discussion / WINDOWS ONLY poll- which version do you run Bitcoin on? on: February 10, 2011, 09:30:29 PM
Thanks.
Pages: « 1 2 3 4 5 6 7 [8] 9 10 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!