1
- PseudoNode 0.5 .0
2
- ================
1
+ LibPseudoNode 0.6 .0
2
+ ===================
3
3
4
4
PseudoNode is a cryptocurrency full node "emulator".
5
5
@@ -14,11 +14,7 @@ Compared to a normal full node:
14
14
15
15
* PseudoNode * does not require the blockchain to be downloaded* .
16
16
* 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.
22
18
* PseudoNode uses no disk space (sans the executable), negligible RAM, and
23
19
negligible CPU time. PseudoNode also consumes less network resources
24
20
(data usage/bandwidth) than a normal full node.
@@ -27,28 +23,63 @@ PseudoNode can be downloaded from here (the official release):
27
23
28
24
* [ https://github.com/basil00/PseudoNode/releases ] ( https://github.com/basil00/PseudoNode/releases )
29
25
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:
32
51
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);
35
56
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.
37
60
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:
39
72
40
73
pseudonode
41
74
42
75
You can connect to different networks using the --coin=COIN option, e.g.:
43
76
44
77
pseudonode --coin=testnet
45
78
pseudonode --coin=litecoin
46
- pseudonode --coin=dogecoin
47
- pseudonode --coin=paycoin
48
- pseudonode --coin=flappycoin
79
+ pseudonode --coin=bitcoin-xt
49
80
50
81
The current implementation supports the following cryptocurrencies: bitcoin,
51
- testnet (bitcoin), litecoin, dogecoin, paycoin, flappycoin .
82
+ testnet (bitcoin), litecoin and bitcoin XT .
52
83
53
84
By default, PseudoNode considers data (tx or blocks) valid if 2 other nodes
54
85
also believe so. This value can be configured via the --threshold=VAL option,
@@ -88,53 +119,6 @@ For MacOSX, run the command:
88
119
89
120
make -f Makefile.macosx
90
121
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
-
138
122
LICENSE
139
123
=======
140
124
0 commit comments