Skip to content

Commit f7c8d66

Browse files
committed
Update the README
1 parent e61ec61 commit f7c8d66

File tree

1 file changed

+48
-64
lines changed

1 file changed

+48
-64
lines changed

README.md

+48-64
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PseudoNode 0.5.0
2-
================
1+
LibPseudoNode 0.6.0
2+
===================
33

44
PseudoNode is a cryptocurrency full node "emulator".
55

@@ -14,11 +14,7 @@ Compared to a normal full node:
1414

1515
* PseudoNode *does not require the blockchain to be downloaded*.
1616
* PseudoNode can "sync" with the network in seconds.
17-
* PseudoNode supports multiple cryptocurrencies that are bitcoin derivatives.
18-
Currently supported are testnet, litecoin, dogecoin, paycoin and flappycoin.
19-
It is reasonably trivial to extend the implementation to support more
20-
currencies.
21-
* PseudoNode is *not* a wallet (cannot be used to store coins).
17+
* PseudoNode supports multiple cryptocurrencies that are Bitcoin derivatives.
2218
* PseudoNode uses no disk space (sans the executable), negligible RAM, and
2319
negligible CPU time. PseudoNode also consumes less network resources
2420
(data usage/bandwidth) than a normal full node.
@@ -27,28 +23,63 @@ PseudoNode can be downloaded from here (the official release):
2723

2824
* [https://github.com/basil00/PseudoNode/releases](https://github.com/basil00/PseudoNode/releases)
2925

30-
PseudoNode is currently experimental software. There are likely to be some
31-
bugs.
26+
Usage
27+
=====
28+
29+
As of version 0.6.0, PseudoNode is a library (a.k.a. LibPseudoNode). The
30+
PseudoNode library can be used for many applications that would otherwise
31+
require a full node, but without the inconvenience of a large/slow blockchain
32+
download and sync.
33+
34+
To create a basic Bitcoin PseudoNode using the library, simply call the
35+
function:
36+
37+
struct PN *node = PN_create(NULL, NULL, NULL, 0);
38+
39+
See the `pseudo_node.h` file for more detail documentation about the
40+
PseudoNode configuration. Various parameters can be controlled, such
41+
as:
42+
43+
* Which cryptocurrency PseudoNode connects to (default is Bitcoin).
44+
* Protocol and node configuration (e.g. extra services bits).
45+
* Configuration to intercept various networks events, such as the broadcast
46+
of a new transaction or block.
47+
* Whether or not `PN_create` assumes control of the calling thread.
48+
49+
The PseudoNode library supports a callbacks for various events. For example,
50+
to intercepting transactions can be achieved via the following pseudo-code:
3251

33-
Example Usage
34-
=============
52+
struct PN_callbacks CALLBACKS;
53+
memset(&CALLBACKS, 0, sizeof(CALLBACKS));
54+
CALLBACKS.tx = tx_callback; // Set transaction call-back
55+
struct PN *node = PN_create(NULL, &CALLBACKS, NULL, 0);
3556

36-
PseudoNode is currently implemented as a command-line tool.
57+
The function `tx_callback` will be called for each transaction broadcast on
58+
the network. See the sample application `apps/txmon` for an example of how
59+
this can be used to build a simple transaction monitor.
3760

38-
By default it will connect to the bitcoin network:
61+
In addition to the above, PseudoNode allows raw transactions can be broadcast
62+
to the network using the following function call:
63+
64+
PN_broadcast_tx(node, tx_data, tx_len);
65+
66+
Reference Program
67+
=================
68+
69+
A reference PseudoNode is currently implemented as a command-line tool.
70+
71+
By default it will connect to the Bitcoin network:
3972

4073
pseudonode
4174

4275
You can connect to different networks using the --coin=COIN option, e.g.:
4376

4477
pseudonode --coin=testnet
4578
pseudonode --coin=litecoin
46-
pseudonode --coin=dogecoin
47-
pseudonode --coin=paycoin
48-
pseudonode --coin=flappycoin
79+
pseudonode --coin=bitcoin-xt
4980

5081
The current implementation supports the following cryptocurrencies: bitcoin,
51-
testnet (bitcoin), litecoin, dogecoin, paycoin, flappycoin.
82+
testnet (bitcoin), litecoin and bitcoin XT.
5283

5384
By default, PseudoNode considers data (tx or blocks) valid if 2 other nodes
5485
also believe so. This value can be configured via the --threshold=VAL option,
@@ -88,53 +119,6 @@ For MacOSX, run the command:
88119

89120
make -f Makefile.macosx
90121

91-
Technical
92-
=========
93-
94-
PseudoNode connects to the network just like a normal full node. Each "inv"
95-
message it receives is treated as a vote. After the threshold number of votes
96-
has been received, then PseudoNode will consider the data valid, and will
97-
relay it. This means that PseudoNode will not relay data unless the network
98-
is already relaying it.
99-
100-
PseudoNode cannot handle some kinds of messages directly, e.g. "getdata" for a
101-
non-recent block. For this PseudoNode forwards the message to another node
102-
and acts as a proxy server.
103-
104-
TODOs
105-
=====
106-
107-
PseudoNode is currently alpha quality software. Some ideas for future work:
108-
109-
* Bloom filters.
110-
* Mining support? However without the UTXO set only empty blocks can be
111-
safely mined.
112-
113-
FAQ
114-
===
115-
116-
*Does PseudoNode harm the network?*
117-
118-
Short answer: No.
119-
120-
Long answer: Not unless the number of PseudoNodes significantly overwhelms the
121-
number of normal full nodes. Otherwise, if PseudoNode can connect to at least
122-
some good nodes (default 2), then PseudoNode will act just like a normal node
123-
and contribute network bandwidth.
124-
125-
*Can PseudoNode cause the network to fork?*
126-
127-
No, PseudoNode just follows what other nodes are doing.
128-
129-
*Can PseudoNode steal coins?*
130-
131-
No.
132-
133-
*Can PseudoNodes be banned from the network?*
134-
135-
Not easily. Requests that PseudoNode cannot handle directly can always be
136-
forwarded to other (cooperative) full nodes.
137-
138122
LICENSE
139123
=======
140124

0 commit comments

Comments
 (0)