readme udpagted

pull/88/head
moneroexamples 6 years ago
parent 77e00ccba1
commit a348fa2abf

@ -1,13 +1,13 @@
# Open Monero - a fully open sourced implementation of MyMonero backend
In this example [restbed](https://github.com/Corvusoft/restbed/) is used to
demonstrate how to provide Monero related JSON REST service. For this purpose,
demonstrate how to provide Monero related JSON REST service. For this purpose,
a service called Open Monero was developed.
Open Monero is an open source implementation of backend of
https://mymonero.com/. The frontend, which includes HTML, CSS, JavaScript, was adapted
from (and originally developed by) https://mymonero.com/.
from (and originally developed by) https://mymonero.com/.
Open Monero's backend is open sourced, free
to use, host and modify. Additionally, some features were added/changed as compared
@ -15,36 +15,33 @@ to MyMonero. They include:
- google analytics, cloudflare, images and flash were removed.
- frontend's html and javascript upgrads and cleanups.
- transaction fees were set to zero.
- transaction service fee was set to zero (same as in MyMonero).
- the wallets generated use 25 word mnemonics, fully compatible with official monero wallets
(13 word mnemonics generated by MyMonero work as usual though).
- import wallet fee was reduced.
- added support of testnet and stagenet networks, and mainnet without relying transactions
- improved handling of mempool, coinbase, locked and unlocked transactions.
- added dynamic miner fees.
- minimum mixin set to 4 for the next hard fork.
- view only mode added.
- ability to offline show your address and private view and spend keys, based on the mnemonic seed, in case of server or connections problem resulting in not being able to login to your account.
- private tx key given to a user which can be used to prove sending xmr to a recipient.
- private tx key given to a user which can be used to prove sending xmr to a recipient.
- Cross-Origin Resource Sharing (CORS) was disabled.
- transaction confirmation window added to double check tx details before its commited.
- ability to select transaction priority.
- transaction confirmation window added to double check tx details before its commited.
- ability to select transaction priority.
- legacy address + payment_id system replaced with integrated addresses for better privacy.
- free, time based imports of recent transactions added.
- new transaction details window.
- sending xmr to a subaddress (not receiving nor generating subaddresses for now).
## Stagenet version (Currently offline)
- [http://139.162.32.245:81](http://139.162.32.245:81) - DOWN due to VPN problems at the moment :-(
- [http://139.162.32.245:81](http://139.162.32.245:81) - DOWN due to problems with
my VPS hosting.
This is Open Monero running on testnet network. You can use it to play around with it.
Since this is testnet version, frequent changes and database resets are expected. Also,
This is Open Monero running on stagnet network. You can use it to play around with it.
Since this is stagnet version, frequent changes and database resets are expected. Also,
it is running on cheap vps, which may result in some lag.
it is running on cheap VPS, which may result in some lag.
If you want some testnet or stagenet monero, please make issue with your stagenet address that you can
obtained from Open Monero.
## Screenshot
@ -55,37 +52,37 @@ obtained from Open Monero.
The Open Monero consists of four components that need to be setup for it to work:
- MySql/Mariadb database - it stores user address (viewkey is not stored!),
- MySql/Mariadb database - it stores user address (viewkey is not stored!),
associated transactions, outputs, inputs and transaction import payments information.
- Frontend - it is virtually same as that of MyMonero, except before mentioned differences.
It consists of HTML, CSS, and JavaScript.
- Monero daemon - daemon must be running and fully sync, as this is
where all transaction data is fetched from and used. Daemon also commits txs
- Monero daemon - daemon must be running and fully sync, as this is
where all transaction data is fetched from and used. Daemon also commits txs
from the Open Monero into the Monero network.
- Backend - fully written in C++. It uses [restbed](https://github.com/Corvusoft/restbed/) to serve JSON REST to the frontend
- Backend - fully written in C++. It uses [restbed](https://github.com/Corvusoft/restbed/) to serve JSON REST to the frontend
and [mysql++](http://www.tangentsoft.net/mysql++/) to interface the database. It also accesses Monero blockchain and "talks"
with Monero deamon.
## Limitations
#### Performance
Open Monero is not as fast as MyMonero.
This is because it is basic, easy to understand and
straight forward implementation of the backend. Thus,
it does not use any special memory buffers/caches for transactions,
This is because it is basic, easy to understand and
straight forward implementation of the backend. Thus,
it does not use any special memory buffers/caches for transactions,
blocks, complex database structures and SQL queries. Also, no ongoing monitoring of user's
transactions is happening, since viewkey is not stored. Transaction search threads start when
user logs in (viewkey and address are submitted to the search thread), and finish shorty
transactions is happening, since user's viewkey is not stored (only its hash). Transaction search threads start when
user logs in (viewkey and address are submitted to the search thread), and finish shorty
after logout. Once the search threads stop, they can't be restarted without user logging
in back, because viewkey is unknown.
## Example compilation on Ubuntu 18.04
## Example compilation on Ubuntu 18.04
Below are example and basic instructions on how to setup up and run Open Monero on Ubuntu 16.04.
For other Linux operating systems, the instructions are analogical.
Below are example and basic instructions on how to setup up and run Open Monero on Ubuntu 16.04.
For other Linux operating systems, the instructions are analogical.
#### Monero download and compilation
@ -98,7 +95,7 @@ sudo apt update
sudo apt install git build-essential cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind-dev pkg-config libssl-dev libcurl4-openssl-dev libgtest-dev libreadline-dev libzmq3-dev libsodium-dev
# go to home folder
# go to home folder
cd ~
git clone --recursive https://github.com/monero-project/monero
@ -113,15 +110,15 @@ make
#### Compilation of the Open Monero (don't run it yet)
Once Monero was downloaded and compiled, we can download Open Monero and compile it.
In fact we could postpone compilation to later, but
Once Monero was downloaded and compiled, we can download Open Monero and compile it.
In fact we could postpone compilation to later, but
we can just do it now, to see if it compiles. But don't run it yet. It will not
work without database, setup frontend, and synced and running monero blockchain.
```bash
# need mysql++ libraries
# need mysql++ libraries
sudo apt install libmysql++-dev
# go to home folder if still in ~/monero
cd ~
@ -133,7 +130,7 @@ mkdir build && cd build
cmake ..
# altearnatively can use cmake -DMONERO_DIR=/path/to/monero_folder ..
# altearnatively can use cmake -DMONERO_DIR=/path/to/monero_folder ..
# if monero is not in ~/monero
make
@ -199,10 +196,10 @@ Command line options
-h [ --help ] [=arg(=1)] (=0) produce help message
-t [ --testnet ] [=arg(=1)] (=0) use testnet blockchain
-s [ --stagenet ] [=arg(=1)] (=0) use stagenet blockchain
--do-not-relay [=arg(=1)] (=0) does not relay txs to other nodes.
useful when testing construction and
--do-not-relay [=arg(=1)] (=0) does not relay txs to other nodes.
useful when testing construction and
submiting txs
-p [ --port ] arg (=1984) default port for restbed service of
-p [ --port ] arg (=1984) default port for restbed service of
Open Monero
-c [ --config-file ] arg (=./config/config.json)
Config file path.
@ -210,42 +207,42 @@ Command line options
Other backend options are in `confing/config.json`.
Before running `openmonero`:
Before running `openmonero`:
- make sure you have `Downloads` folder in your home directory.
- make sure you have `Downloads` folder in your home directory.
Time library used in Open Monero stores there time zone offsets database that it uses.
- edit `config/confing.js` file with your settings. Especially set `frontend-url` and `database`
connection details.
- set `apiUrl` in `html\js\config.js` and `nettype` option. Last slash `/` in `apiUrl` is important.
- set `apiUrl` in `html\js\config.js` and `nettype` option. Last slash `/` in `apiUrl` is important.
If running backend for testnet or stagenet networks, frontend `nettype` must be set to
1 - TESTNET or 2 - STAGENET. 0 is for MAINNET.
For mainnet, it is set to `false`.
- make sure monero daemon is running and fully sync. If using testnet or stagenet networks, use monero daemon
with `--testnet` or `--stagenet` flags!
To start for mainnet:
To start for mainnet:
```bash
./openmonero
```
To start for testnet:
To start for testnet:
```bash
./openmonero -t
```
To start for stagenet:
To start for stagenet:
```bash
./openmonero -s
```
To start for stagenet with non-default location of `config.json` file:
```bash
./openmonero -s -c /path/to/config.json
```
## API calls
Example calls and their outputs are provided below.
@ -270,7 +267,7 @@ Example output:
```
`api` number is represented as `uint32_t`. In this case, `65536` represents
`api` number is represented as `uint32_t`. In this case, `65536` represents
major version 1 and minor version 0.
In JavaScript, to get these numbers, one can do as follows:
@ -310,7 +307,7 @@ Output (only part shown):
"status": "success",
"total_received": 32594830001895764,
"total_received_unlocked": 32594830001895764,
"transactions": [
"transactions": [
{
"coinbase": false,
"hash": "2877c449a7a9f0a507c7a6e4ae17b43d96dc44369092e57adc4e6d9ddcde1a68",
@ -537,13 +534,13 @@ Need to add other.
## Scrap notes (just for myself)
### Generate your own ssl certificate
### Generate your own ssl certificate
Setting up https and ssl certificates in restbed
- https://github.com/Corvusoft/restbed/blob/34187502642144ab9f749ab40f5cdbd8cb17a54a/example/https_service/source/example.cpp
Based on the link above:
```bash
# Create Certificate
cd /tmp

@ -3,7 +3,7 @@ var config = {
mainnetExplorerUrl: "https://xmrchain.com/",
testnetExplorerUrl: "https://testnet.xmrchain.com/",
stagenetExplorerUrl: "http://162.210.173.150:8083/",
nettype: 1, /* 0 - MAINNET, 1 - TESTNET, 2 - STAGENET */
nettype: 2, /* 0 - MAINNET, 1 - TESTNET, 2 - STAGENET */
coinUnitPlaces: 12,
txMinConfirms: 10, // corresponds to CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE in Monero
txCoinbaseMinConfirms: 60, // corresponds to CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW in Monero
@ -31,4 +31,3 @@ var config = {
avgBlockTime: 120,
debugMode: false
};

Loading…
Cancel
Save