Mise à jour de GitLab prévue ce samedi 23 octobre 2021 à partir de 9h00 CET

Commit 41727e73 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Project renamed to uCoin

parent 8e1ac769
......@@ -6,7 +6,7 @@ var path = require('path');
var mongoose = require('mongoose');
var connectPgp = require('connect-pgp');
var _ = require('underscore');
var nodecoin = require('../lib/nodecoin');
var server = require('../lib/server');
var configurer = require('../lib/configurer');
module.exports.database = {
......@@ -71,8 +71,8 @@ module.exports.express = {
},
loadMongoDB: function(callback){
// Bootstraps models
nodecoin.database.init();
nodecoin.database.connect(config, function (err) {
server.database.init();
server.database.connect(config, function (err) {
if(!err)
console.log("Connected to MongoDB.");
else
......
#!/usr/bin/env node
var config = require('../config/config');
var nodecoin = require('../app/lib/nodecoin');
var http = require('http');
var program = require('commander');
var config = require('../config/config');
var server = require('../app/lib/server');
var http = require('http');
var program = require('commander');
function keys (val) {
return val.split(',');
......@@ -39,7 +39,7 @@ for(var i in program.initKeys){
config.initKeys.push({path: program.initKeys[i]});
}
nodecoin.express.app(config, function (err, app) {
server.express.app(config, function (err, app) {
if(!config.server.ipv4address){
http.createServer(app).listen(app.get('port'), function(){
console.log('NodeCoin server listening on port ' + app.get('port'));
......
......@@ -8,7 +8,7 @@ exports.server = {
exports.db = {
//port : 27017, // optional
database : "nodecoin",
database : "ucoin",
host : "localhost"
};
......
......@@ -350,4 +350,4 @@ Money ownership **IS NOT** limited to members of the Community. Any owner (an in
### Transactions chain
It is obvious that a coin a sender does not own CAN NOT be sent by him. That is why a transaction refers to other transactions, to prove that the sender actually owns the coins he wants to send.
\ No newline at end of file
It is obvious that a coin a sender does not own CAN NOT be sent by him. That is why a transaction refers to other transactions, to prove that the sender actually owns the coins he wants to send.
# NodeCoin HTTP API
# uCoin HTTP API
* [Overview](#overview)
* [Merkle URLs](#merkle-urls)
......@@ -24,7 +24,7 @@
## Overview
Data is made accessible through an HTTP API mainly inspired from [OpenUDC_exchange_formats draft](https://github.com/Open-UDC/open-udc/blob/master/docs/OpenUDC_exchange_formats.draft.txt), and has been adapted to fit NodeCoin specificities.
Data is made accessible through an HTTP API mainly inspired from [OpenUDC_exchange_formats draft](https://github.com/Open-UDC/open-udc/blob/master/docs/OpenUDC_exchange_formats.draft.txt), and has been adapted to fit uCoin specificities.
http[s]://Node[:port]/...
|-- pks/
......@@ -62,9 +62,9 @@ Merkle URL is a special kind of URL applicable for resources:
* `hdc/amendments/view/[AMENDMENT_ID]/members`
* `hdc/amendments/view/[AMENDMENT_ID]/voters`
Such kind of URL returns Merkle tree hashes informations. In NodeCoin, Merkle trees are an easy way to detect unsynced data and where the differences come from. For example, `hdc/amendments/view/[AMENDMENT_ID]/members` is a Merkle tree whose leaves are hashes of members key fingerprint sorted ascending way. Thus, if any new key is added, a branch of the tree will see its hash modified and propagated to the root hash. Change is then easy to detect.
Such kind of URL returns Merkle tree hashes informations. In uCoin, Merkle trees are an easy way to detect unsynced data and where the differences come from. For example, `hdc/amendments/view/[AMENDMENT_ID]/members` is a Merkle tree whose leaves are hashes of members key fingerprint sorted ascending way. Thus, if any new key is added, a branch of the tree will see its hash modified and propagated to the root hash. Change is then easy to detect.
For commodity issues, this URL uses query parameters to retrieve partial data of the tree, as most of the time all the data is not required. NodeCoin Merkle tree has a determined number of parent nodes (given a number of leaves), which allows to ask only for interval of them.
For commodity issues, this URL uses query parameters to retrieve partial data of the tree, as most of the time all the data is not required. uCoin Merkle tree has a determined number of parent nodes (given a number of leaves), which allows to ask only for interval of them.
Here is an example of members Merkle tree with 5 members (taken from [Tree Hash EXchange format (THEX)](http://web.archive.org/web/20080316033726/http://www.open-content.net/specs/draft-jchapweske-thex-02.html)):
......@@ -84,9 +84,9 @@ Here is an example of members Merkle tree with 5 members (taken from [Tree Hash
Where A,B,C,D,E are already hashed data.
With such a tree structure, NodeCoin consider the tree has exactly 6 nodes: `[ROOT,H,E,F,G,E]`. Nodes are just an array, and for a Lambda Server LS1, it is easy to ask for the values of another server LS2 for level 1 (`H` and `E`, the second level): it requires nodes interval `[1;2]`.
With such a tree structure, uCoin consider the tree has exactly 6 nodes: `[ROOT,H,E,F,G,E]`. Nodes are just an array, and for a Lambda Server LS1, it is easy to ask for the values of another server LS2 for level 1 (`H` and `E`, the second level): it requires nodes interval `[1;2]`.
Hence it is quite easy for anyone who wants to check if a `Z` member joined the NodeCoin community as it would alter the `E` branch of the tree:
Hence it is quite easy for anyone who wants to check if a `Z` member joined the uCoin community as it would alter the `E` branch of the tree:
ROOT'=H(H+E')
/ \
......@@ -115,7 +115,7 @@ Parameter | Description
### pks/*
This URL is used to manage OpenPGP certificates, making NodeCoin acting **like** an SKS server.
This URL is used to manage OpenPGP certificates, making uCoin acting **like** an SKS server.
#### `pks/add`
**Goal**
......@@ -164,7 +164,7 @@ Result differs according to parameters and is HKP-compliant.
### hdc/*
This URL pattern manages all the data used by NodeCoin based on the PKS.
This URL pattern manages all the data used by uCoin based on the PKS.
In a general way, those URLs return HTTP **200** code on success, HTTP **501** if not implemented and any HTTP error code on error.
......@@ -393,7 +393,7 @@ GET a transaction chain justifying that coin `[COIN_ID]` is owned by the given `
Name | Value | Method
---- | ----- | ------
`PGP_FINGERPRINT` | Owner of the coins. | URL
`COIN_ID` | Coin [unique identifier](https://github.com/c-geek/nodecoind/blob/master/doc/HDC.md#coins-format). | URL
`COIN_ID` | Coin [unique identifier](https://github.com/c-geek/ucoin/blob/master/doc/HDC.md#coins-format). | URL
**Returns**
......@@ -634,7 +634,7 @@ GET the transaction of given `TRANSACTION_ID`.
Name | Value | Method
---- | ----- | ------
`TRANSACTION_ID` | The transaction [unique identifier](https://github.com/c-geek/nodecoind/blob/master/doc/HDC.md#transaction). | URL
`TRANSACTION_ID` | The transaction [unique identifier](https://github.com/c-geek/ucoin/blob/master/doc/HDC.md#transaction). | URL
**Returns**
......
# NCP - NodeCoin Protocol
NodeCoin defines its own protocol called NCP which defines messages, interpretation of them and structuration rules in order to build new currencies based on individuals and Universal Dividend.
**YET TO DEFINE**
\ No newline at end of file
NodeCoin TODO list
uCoin TODO list
Documentation:
✔ Readme - Presentation @done (13-07-08 22:58)
Protocol:
define NodeCoin messages (data structures):
define uCoin messages (data structures):
✔ OpenUDC certificates @done (13-07-08 22:58)
NodeCoin amendments @done (13-07-08 22:58)
NodeCoin money issuances @done (13-07-08 22:58)
NodeCoin transactions @done (13-07-08 22:58)
uCoin amendments @done (13-07-08 22:58)
uCoin money issuances @done (13-07-08 22:58)
uCoin transactions @done (13-07-08 22:58)
Protocol implementation:
......
# NCM - NodeCoin Messages format
# UCM - uCoin Messages format
NCM HDC Messages Format: it adds rules on top of HDC messages in order to implement a system compliant with NodeCoin monetary rules.
UCM is a format defining messages both based on and completing HDC messages to be used in uCoin Protocol (UCP).
## Certificates
......
# UCP - uCoin Protocol
uCoin defines its own protocol called UCP which defines messages, interpretation of them and structuration rules in order to build new currencies based on individuals and Universal Dividend.
**YET TO DEFINE**
# NodeCoin architecture
# uCoin architecture
------------
| NodeCoin | The software
| uCoin | The software
------------
|
------------
| NCP | Implements NodeCoin Protocol
| UCP | Implements uCoin Protocol
------------
|
,--------+---------,
▼ ▼
------------ ------------
| HDC |◀-------| NCM | Based on HDC and NCM messages formats
| HDC |◀-------| UCM | Based on HDC and UCM messages formats
------------ ------------
| |
'--------+---------'
......@@ -26,8 +26,8 @@ More details on each layer:
Layer | Role
----- | ----
NodeCoin | The software that implements NCP. One instance of NodeCoin handles only one currency.
[NCP](https://github.com/c-geek/nodecoind/blob/master/doc/NCP.md) | A protocol defining how to handle messages in order to build an HDC system.
[HDC](https://github.com/c-geek/nodecoind/blob/master/doc/HDC.md) | A format defining messages to describe an HDC system.
[NCM](https://github.com/c-geek/nodecoind/blob/master/doc/NCM.md) | A format defining messages used by NCP.
[HTTP API](https://github.com/c-geek/nodecoind/blob/master/doc/HTTP_API.md) | The communication protocol to exchange HDC and NCM messages over HTTP.
\ No newline at end of file
uCoin | The software that implements UCP. One instance of uCoin handles only one currency.
[UCP](https://github.com/c-geek/ucoin/blob/master/doc/UCP.md) | A protocol defining how to handle messages in order to build an HDC system.
[HDC](https://github.com/c-geek/ucoin/blob/master/doc/HDC.md) | A format defining messages to describe an HDC system.
[UCM](https://github.com/c-geek/ucoin/blob/master/doc/UCM.md) | A format defining messages used by UCP.
[HTTP API](https://github.com/c-geek/ucoin/blob/master/doc/HTTP_API.md) | The communication protocol to exchange HDC and UCM messages over HTTP.
# NodeCoin, yet another Bitcoin-like ?
# uCoin, yet another Bitcoin-like ?
Well, NodeCoin uses the crypto-currency concept introduced by Bitcoin. In those terms, NodeCoin is like Bitcoin. But NodeCoin has completely different fundation principles, such as individuals, web of trust and Universal Dividend (i.e.: money issued directly by every individual) to do *really* better than Bitcoin.
Well, uCoin uses the crypto-currency concept introduced by Bitcoin. In those terms, uCoin is like Bitcoin. But uCoin has completely different fundation principles, such as individuals, web of trust and Universal Dividend (i.e.: money issued directly by every individual) to do *really* better than Bitcoin.
Actually, NodeCoin has a theoretical reference called [Relativity Theory of Money (french)](http://wiki.creationmonetaire.info/). This theory demonstrates that a currency which aims at respecting individual's economic liberties MUST implement the Universal Dividend, which is the only way to avoid both spatial and temporal asymmetry in money issuance.
Actually, uCoin has a theoretical reference called [Relativity Theory of Money (french)](http://wiki.creationmonetaire.info/). This theory demonstrates that a currency which aims at respecting individual's economic liberties MUST implement the Universal Dividend, which is the only way to avoid both spatial and temporal asymmetry in money issuance.
## Spatial and temporal what ?
......@@ -12,7 +12,7 @@ Those concepts refers to the relative access of individuals to newly created mon
When new Bitcoins are created, only **some** Bitcoin users are credited of brand new Bitcoins. **We believe this is the first injustice.** Some might say *«but miners used electricity and time to get it»* ... we would answer this work shouldn't be rewarded by newly created Bitcoins. New Bitcoins should spray the whole Bitcoin community. Miners should be rewared another way, not by money issuance.
Of course, Bitcoin can't do this as Bitcoin users are not strongly identified, and one might benefit multiple time of money creation if he owns several wallets. But NodeCoin can fix this.
Of course, Bitcoin can't do this as Bitcoin users are not strongly identified, and one might benefit multiple time of money creation if he owns several wallets. But uCoin can fix this.
### Temporally
......@@ -20,7 +20,7 @@ Bitcoin has a planned limit of 21 million BTC, which means less and less bitcoin
Every member of a monetary community should be equal towards issuing new coins, and get the same relative amount of it over the time, even if he is a later adopter.
NodeCoin aims at fixing this bug too.
uCoin aims at fixing this bug too.
## How to implement such a system ?
......@@ -28,7 +28,7 @@ To resolve those problems, the whole idea is to lean on OpenPGP mecanisms to cre
### The monetary Web of Trust (WoT)
The whole basis of NodeCoin is made up of individuals who chose to trust each other and constitute a community, aka. Web of Trust. Note that *trust* does not mean considering every member as a trustworthy person: it only means that the community trusts each member is a unique and living person.
The whole basis of uCoin is made up of individuals who chose to trust each other and constitute a community, aka. Web of Trust. Note that *trust* does not mean considering every member as a trustworthy person: it only means that the community trusts each member is a unique and living person.
Once a WoT is constituted, new members may only join by cooptation of existing members in the WoT. Cooptation is done throught a two step process:
......@@ -45,8 +45,8 @@ Such a contract is actually a chained list of amendments, each amendement defini
### Coins
Coins are issued directly by WoT members, in accordance with the Monetary Contract specifications. NodeCoin uses a divisionary money system divided in 9 decimal unities (1..9) completed with a power 10 parameter. When issuing money, each individual may create the unities he desires, in the limits established by the Monetary Contract.
Coins are issued directly by WoT members, in accordance with the Monetary Contract specifications. uCoin uses a divisionary money system divided in 9 decimal unities (1..9) completed with a power 10 parameter. When issuing money, each individual may create the unities he desires, in the limits established by the Monetary Contract.
### Transactions
Transactions are the last entity managed by NodeCoin: it materializes money ownership. Transactions have a huge role in NodeCoin system: it both carries the role of money issuance and money transfert from one account to another.
\ No newline at end of file
Transactions are the last entity managed by uCoin: it materializes money ownership. Transactions have a huge role in uCoin system: it both carries the role of money issuance and money transfert from one account to another.
{
"name": "nodecoin",
"name": "ucoin",
"version": "0.0.6",
"description": "OpenUDC-like implementation using Node.js",
"main": "bin/nodecoin",
"main": "bin/ucoin",
"directories": {
"test": "test"
},
"scripts": {
"test": "mocha test/*.js",
"start": "bin/nodecoin"
"start": "bin/ucoin"
},
"repository": {
"type": "git",
"url": "git@github.com:c-geek/nodecoin.git"
"url": "git@github.com:c-geek/ucoin.git"
},
"keywords": [
"openudc",
......@@ -23,7 +23,7 @@
"readmeFilename": "readme.md",
"gitHead": "3abd4db425bdb2c89ceb3f38eb15942bc3ebaf1d",
"bugs": {
"url": "https://github.com/c-geek/nodecoin/issues"
"url": "https://github.com/c-geek/ucoin/issues"
},
"dependencies": {
"express": "",
......@@ -42,6 +42,6 @@
"supertest": ""
},
"bin": {
"nodecoin": "./bin/nodecoin"
"ucoin": "./bin/ucoin"
}
}
# NodeCoin [![Build Status](https://api.travis-ci.org/c-geek/nodecoin.png)](https://api.travis-ci.org/c-geek/nodecoin.png)
# uCoin [![Build Status](https://api.travis-ci.org/c-geek/ucoin.png)](https://api.travis-ci.org/c-geek/ucoin.png)
NodeCoin is a free server-side software which allows to create new P2P crypto-currencies based on individuals and implementing Universal Dividend.
uCoin is a free server-side software which allows to create new P2P crypto-currencies based on individuals and implementing Universal Dividend.
It is mainly inspired from [OpenUDC project](https://github.com/Open-UDC/open-udc) for that purpose, but differs defining its own open currency protocol called NCP (NodeCoin Protocol).
It is mainly inspired from [OpenUDC project](https://github.com/Open-UDC/open-udc) for that purpose, but differs defining its own open currency protocol called UCP (UCoin Protocol).
You can get more in NodeCoin project reading the following documents:
* [Concepts](https://github.com/c-geek/nodecoind/blob/master/doc/concepts.md)
* [Architecture](https://github.com/c-geek/nodecoind/blob/master/doc/architecture.md)
You can get more in uCoin project reading the following documents:
* [Concepts](https://github.com/c-geek/ucoind/blob/master/doc/concepts.md)
* [Architecture](https://github.com/c-geek/ucoind/blob/master/doc/architecture.md)
## Installation
NodeCoin is powered by Node.js v0.10+, so you need it installed first. Here is an example for Ubuntu installation:
uCoin is powered by Node.js v0.10+, so you need it installed first. Here is an example for Ubuntu installation:
$ sudo apt-get update
$ sudo apt-get install python-software-properties python g++ make
......@@ -20,40 +20,40 @@ NodeCoin is powered by Node.js v0.10+, so you need it installed first. Here is a
You can find the installation of Node.js for other distribution [on this GitHub document](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager).
And then, just install NodeCoin:
And then, just install uCoin:
sudo npm install -g nodecoin
sudo npm install -g ucoin
## Get NodeCoin run
## Get uCoin run
Launch it using the following command:
$ nodecoin
$ ucoin
By default, nodecoin runs on port 8081. You may change it using the --port parameter:
By default, ucoin runs on port 8081. You may change it using the --port parameter:
$ nodecoin --port 80
$ ucoin --port 80
(may require root access to launch on port 80)
It is also possible to specify the IPv4 interface:
$ nodecoin -p 8888 --ipv4 127.0.0.1
$ ucoin -p 8888 --ipv4 127.0.0.1
NodeCoin server listening on 127.0.0.1 port 8888
uCoin server listening on 127.0.0.1 port 8888
Or IPv6 interface:
$ nodecoin -p 8888 --ipv6 ::1
$ ucoin -p 8888 --ipv6 ::1
NodeCoin server listening on ::1 port 8888
uCoin server listening on ::1 port 8888
Or both:
$ nodecoin -p 8888 --ipv4 127.0.0.1 --ipv6 ::1
$ ucoin -p 8888 --ipv4 127.0.0.1 --ipv6 ::1
NodeCoin server listening on 127.0.0.1 port 8888
NodeCoin server listening on ::1 port 8888
uCoin server listening on 127.0.0.1 port 8888
uCoin server listening on ::1 port 8888
Note too that listening to multiple interfaces doesn't imply mutiple program instances: only *one* is running on multiple interfaces.
......@@ -63,16 +63,16 @@ Nodecoin should be launched with a few more parameters to be part of a currency
First, it is required to tell the name of the currency:
$ nodecoin --currency beta_brousouf
$ ucoin --currency beta_brousouf
NodeCoin server listening on port 8081
uCoin server listening on port 8081
Currency name: beta_brousouf
Second, initial public keys of the first members of the community must be given:
$ nodecoin --currency beta_brousouf --initKeys /path/to/key1.pub,/path/to/key2.pub
$ ucoin --currency beta_brousouf --initKeys /path/to/key1.pub,/path/to/key2.pub
NodeCoin server listening on port 8081
uCoin server listening on port 8081
Currency name: beta_brousouf
Initkeys loaded.
......@@ -82,24 +82,24 @@ Note: initial keys are a prerequisite for Monetary Contract: Nodecoin will only
### PGP-signed HTTP requests
This is one of the great features coming with NodeCoin: [connect-pgp](https://github.com/c-geek/connect-pgp) is a NPM module which *signs HTTP responses*. Such a feature is very important to authentify incoming responses over the network.
This is one of the great features coming with uCoin: [connect-pgp](https://github.com/c-geek/connect-pgp) is a NPM module which *signs HTTP responses*. Such a feature is very important to authentify incoming responses over the network.
To use this feature, just launch NodeCoin using `--pgpkey` and `--pgppasswd` parameters:
To use this feature, just launch uCoin using `--pgpkey` and `--pgppasswd` parameters:
nodecoin --pgpkey "/path/to/some/private.key" --pgppasswd "ultr[A]!%HiGhly-s3cuR3-p4ssw0d"
ucoin --pgpkey "/path/to/some/private.key" --pgppasswd "ultr[A]!%HiGhly-s3cuR3-p4ssw0d"
Signed requests with PGP: **enabled**.
NodeCoin server listening on port 8081
uCoin server listening on port 8081
### Help
For more more details on the nodecoin command, run:
For more more details on the ucoin command, run:
nodecoin --help
ucoin --help
Which displays:
Usage: nodecoin [options]
Usage: ucoin [options]
Options:
......@@ -117,12 +117,12 @@ Which displays:
## Disclaimer
NodeCoin *is not* an implementation of the OpenUDC protocol. Firstly because OpenUDC protocol is still a in drafting state, and secondly because NodeCoin have some divergences in its mecanisms.
Consequently, NodeCoin proposes its own protocol called NCP.
uCoin *is not* an implementation of the OpenUDC protocol. Firstly because OpenUDC protocol is still a in drafting state, and secondly because uCoin have some divergences in its mecanisms.
Consequently, uCoin proposes its own protocol called UCP.
## Get involved in NodeCoin project
## Get involved in uCoin project
For the moment NodeCoin is developed only by its author. If you wish to participate/debate on it, you contact me directly at cem.moreau@gmail.com.
For the moment uCoin is developed only by its author. If you wish to participate/debate on it, you contact me directly at cem.moreau@gmail.com.
# References
......@@ -138,4 +138,4 @@ For the moment NodeCoin is developed only by its author. If you wish to particip
# License
This software is provided under [MIT license](https://raw.github.com/c-geek/nodecoin/master/LICENSE).
\ No newline at end of file
This software is provided under [MIT license](https://raw.github.com/c-geek/ucoin/master/LICENSE).
\ No newline at end of file
......@@ -2,10 +2,10 @@ var should = require('should');
var assert = require('assert');
var mongoose = require('mongoose');
var sha1 = require('sha1');
var nodecoin = require('../app/lib/nodecoin');
var server = require('../app/lib/server');
nodecoin.database.init();
server.database.init();
var Amendment = mongoose.model('Amendment');
var amTest;
......
......@@ -4,8 +4,8 @@ var fs = require('fs');
var mongoose = require('mongoose');
var sha1 = require('sha1');
var async = require('async');
var nodecoin = require('../app/lib/nodecoin');
nodecoin.database.init();
var server = require('../app/lib/server');
server.database.init();
var Amendment = mongoose.model('Amendment');
var Contract = mongoose.model('Contract');
......
var should = require('should');
var request = require('supertest');
var nodecoin = require('../app/lib/nodecoin');
var should = require('should');
var request = require('supertest');
var server = require('../app/lib/server');
var config = {
server: { port: 8001 },
db: {
database : "nodecoin_test",
database : "ucoin_test",
host: "localhost"
},
initKeys: []
......@@ -50,7 +50,7 @@ function testPOST(url, should) {
var app;
before(function (done) {
nodecoin.express.app(config, function (err, appReady) {
server.express.app(config, function (err, appReady) {
app = appReady;
done();
});
......
......@@ -4,8 +4,8 @@ var mongoose = require('mongoose');
var sha1 = require('sha1');
var fs = require('fs');
var async = require('async');
var nodecoin = require('../app/lib/nodecoin');
nodecoin.database.init();
var server = require('../app/lib/server');
server.database.init();
var Amendment = mongoose.model('Amendment');
var Vote = mongoose.model('Vote');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment