{"id":13579829,"url":"https://github.com/moneroexamples/onion-monero-blockchain-explorer","last_synced_at":"2025-05-15T08:10:14.613Z","repository":{"id":8676469,"uuid":"55582524","full_name":"moneroexamples/onion-monero-blockchain-explorer","owner":"moneroexamples","description":"Onion Monero Blockchain Explorer","archived":false,"fork":false,"pushed_at":"2025-04-06T10:52:44.000Z","size":39276,"stargazers_count":382,"open_issues_count":15,"forks_count":280,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-04-07T03:15:25.527Z","etag":null,"topics":["blockchain-explorer","cpp11","linux","monero"],"latest_commit_sha":null,"homepage":"https://xmrchain.net","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moneroexamples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-06T06:51:26.000Z","updated_at":"2025-04-07T01:21:50.000Z","dependencies_parsed_at":"2024-01-16T20:28:20.188Z","dependency_job_id":"fa4bd880-5844-45fe-ac04-fe756b7fe23b","html_url":"https://github.com/moneroexamples/onion-monero-blockchain-explorer","commit_stats":{"total_commits":1033,"total_committers":30,"mean_commits":34.43333333333333,"dds":0.08906098741529522,"last_synced_commit":"9aceabe42c8f3ec6f25240a4aa766453f2e37a7e"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moneroexamples%2Fonion-monero-blockchain-explorer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moneroexamples%2Fonion-monero-blockchain-explorer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moneroexamples%2Fonion-monero-blockchain-explorer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moneroexamples%2Fonion-monero-blockchain-explorer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moneroexamples","download_url":"https://codeload.github.com/moneroexamples/onion-monero-blockchain-explorer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248890167,"owners_count":21178377,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain-explorer","cpp11","linux","monero"],"created_at":"2024-08-01T15:01:43.713Z","updated_at":"2025-04-14T13:43:04.073Z","avatar_url":"https://github.com/moneroexamples.png","language":"C++","funding_links":[],"categories":["\u003ca name=\"cpp\"\u003e\u003c/a\u003eC++","Blockchain Explorers","C++"],"sub_categories":["Other Wallets"],"readme":"# Onion Monero Blockchain Explorer\n\nCurrently available Monero blockchain explorers have several limitations which are of\nspecial importance to privacy-oriented users:\n\n - they use JavaScript,\n - have images which might be used for [cookieless tracking](http://lucb1e.com/rp/cookielesscookies/),\n - track users activities through google analytics,\n - are closed sourced,\n - are not available as hidden services,\n - do not support Monero testnet nor stagenet networks,\n - have limited JSON API.\n\n\nIn this example, these limitations are addressed by development of\nan Onion Monero Blockchain Explorer. The example not only shows how to use\nMonero C++ libraries, but also demonstrates how to use:\n\n - [crow](https://github.com/ipkn/crow) - C++ micro web framework\n - [mstch](https://github.com/no1msd/mstch) - C++ {{mustache}} templates\n - [json](https://github.com/nlohmann/json) - JSON for Modern C++\n - [fmt](https://github.com/fmtlib/fmt) - Small, safe and fast string formatting library\n\n## Explorer hosts\n\nClearnet versions:\n - [https://xmrchain.net/](https://xmrchain.net/) - HTTPS enabled, most popular, and very stable.\n - [https://monerohash.com/explorer/](https://monerohash.com/explorer/) - nice looking one, HTTPS enabled.\n - [http://monerochain.com/](http://monerochain.com/) - JSON API based, multiple nodes.   \n\nTestnet version:\n\n - [https://testnet.xmrchain.com/](https://testnet.xmrchain.com/) - https enabled.\n\nStagenet version:\n \n - [https://stagenet.xmrchain.net/](https://stagenet.xmrchain.net/)\n\ni2p users (main Monero network):\n\n - [http://7o4gezpkye6ekibhgpkg7v626ze4idsirapufzrefkdysa6zxhha.b32.i2p/](http://7o4gezpkye6ekibhgpkg7v626ze4idsirapufzrefkdysa6zxhha.b32.i2p/)\n\nTor versions:\n\n - [http://exploredv42tq2nowrll6f27nuymenndwupueqvyugaqzbrvmjhhceqd.onion/](http://exploredv42tq2nowrll6f27nuymenndwupueqvyugaqzbrvmjhhceqd.onion/) - Native v3 Onion, JSON API enabled, emission enabled, rawtx enabled.\n\nAlternative block explorers:\n\n- [https://localmonero.co/blocks](https://localmonero.co/blocks)\n- [https://monerovision.com](https://monerovision.com)\n\n\n## Onion Monero Blockchain Explorer features\n\nThe key features of the Onion Monero Blockchain Explorer are:\n\n - no cookies, no web analytics trackers, no images,\n - open sourced,\n - made fully in C++,\n - showing encrypted payments ID,\n - showing ring signatures,\n - showing transaction extra field,\n - showing public components of Monero addresses,\n - decoding which outputs and mixins belong to the given Monero address and viewkey,\n - can prove that you send Monero to someone,\n - detailed information about ring members, such as their age, timescale, and ring sizes,\n - showing number of amount output indices,\n - support Monero testnet and stagnet networks,\n - tx checker and pusher for online pushing of transactions,\n - estimate possible spendings based on address and viewkey,\n - can provide total amount of all miner fees,\n - decoding encrypted payment id,\n - decoding outputs and proving txs sent to sub-address.\n\n\n## Development branch\n\nCurrent development branch:\n\n - https://github.com/moneroexamples/onion-monero-blockchain-explorer/tree/devel\n\nNote: `devel` branch of the explorer follows `master` branch of the monero!\n\n## Compilation on Ubuntu 24.04\n\n\n#### Monero download and compilation\n\nTo download and compile recent Monero follow instructions\nin the following link:\n\nhttps://github.com/moneroexamples/monero-compilation/blob/master/README.md\n\n##### Compile and run the explorer\n\nOnce the Monero compiles, the explorer can be downloaded and compiled\nas follows:\n\n```bash\n# go to home folder if still in ~/monero\ncd ~\n\n# download the source code \ngit clone https://github.com/moneroexamples/onion-monero-blockchain-explorer.git\n\n# enter the downloaded sourced code folder\ncd onion-monero-blockchain-explorer\n\n# make a build folder and enter it\nmkdir build \u0026\u0026 cd build\n\n# create the makefile\ncmake ..\n\n# compile\nmake\n```\n\n\nTo run it:\n```\n./xmrblocks\n```\n\nBy default it will look for blockchain in its default location i.e., `~/.bitmonero/lmdb`.\nYou can use `-b` option if its in different location.\n\nFor example:\n\n```bash\n./xmrblocks -b /home/mwo/non-default-monero-location/lmdb/\n```\n\nExample output:\n\n```bash\n[mwo@arch onion-monero-blockchain-explorer]$ ./xmrblocks\n2016-May-28 10:04:49.160280 Blockchain initialized. last block: 1056761, d0.h0.m12.s47 time ago, current difficulty: 1517857750\n(2016-05-28 02:04:49) [INFO    ] Crow/0.1 server is running, local port 8081\n```\n\nGo to your browser: http://127.0.0.1:8081\n\n## Compiling and running with Docker\n\nThe explorer can also be compiled using `docker build` as described below. By default it compiles\nagainst latest release tag (i.e. `v0.18.4.0`) of monero:\n\n```\n# build using all CPU cores\ndocker build --no-cache -t xmrblocks .\n\n# alternatively, specify number of cores to use (e.g. 2)\ndocker build --no-cache --build-arg NPROC=2  -t xmrblocks .\n\n# to build against development branch of monero (i.e. master branch)\ndocker build --no-cache --build-arg NPROC=3 --build-arg MONERO_BRANCH=master  -t xmrblocks .\n```\n\n- The build needs 3 GB space.\n- The final container image is 179MB.\n\nTo run it, mount the monero blockchain onto the container as volume.\n\n```\n# either run in foreground\ndocker run -it -v \u003cpath-to-monero-blockckain-on-the-host\u003e:/home/monero/.bitmonero -p 8081:8081  xmrblocks\n\n# or in background\ndocker run -it -d -v \u003cpath-to-monero-blockchain-on-the-host\u003e:/home/monero/.bitmonero -p 8081:8081  xmrblocks\n```\n\nExample output:\n\n```\ndocker run --rm -it -v /mnt/w7/bitmonero:/home/monero/.bitmonero -p 8081:8081 xmrblocks\nStaring in non-ssl mode\n(2020-04-20 16:20:00) [INFO    ] Crow/0.1 server is running at 0.0.0.0:8081 using 1 threads\n```\n\n### Docker Compose example\n\nThe explorer can also be built and run using Docker Compose, i.e.:\n\n```yaml\nversion: '3'\nservices:\n  monerod:\n    image: ghcr.io/sethforprivacy/simple-monerod:latest\n    restart: unless-stopped\n    container_name: monerod\n    volumes:\n      - xmrdata:/home/monero/.bitmonero\n    ports:\n      - 18080:18080\n      - 18089:18089\n    depends_on:\n        - explore\n    command:\n      - \"--rpc-restricted-bind-ip=0.0.0.0\"\n      - \"--rpc-restricted-bind-port=18089\"\n      - \"--public-node\"\n      - \"--no-igd\"\n      - \"--enable-dns-blocklist\"\n\n  explore:\n    image: xmrblocks:latest\n    build: ./onion-monero-blockchain-explorer\n    container_name: explore\n    restart: unless-stopped\n    volumes:\n      - xmrdata:/home/monero/.bitmonero\n    ports:\n      - 8081:8081\n    command: [\"./xmrblocks --daemon-url=monerod:18089 --enable-json-api --enable-autorefresh-option --enable-emission-monitor --enable-pusher\"]\n\nvolumes:\n  xmrdata:\n```\n\nTo build this image, run the following:\n\n```bash\ngit clone https://github.com/moneroexamples/onion-monero-blockchain-explorer.git\ncd onion-monero-blockchain-explorer\ndocker-compose build\n```\n\nOr build and run in one step via:\n\n```bash\ngit clone https://github.com/moneroexamples/onion-monero-blockchain-explorer.git\ncd onion-monero-blockchain-explorer\ndocker-compose up -d\n```\n\nWhen running via Docker, please use something like [Traefik](https://doc.traefik.io/traefik/) or [enable SSL](#enable-ssl-https) to secure communications.\n\n\n## The explorer's command line options\n\n```\nxmrblocks, Onion Monero Blockchain Explorer:\n  -h [ --help ] [=arg(=1)] (=0)         produce help message\n  -t [ --testnet ] [=arg(=1)] (=0)      use testnet blockchain\n  -s [ --stagenet ] [=arg(=1)] (=0)     use stagenet blockchain\n  --enable-pusher [=arg(=1)] (=0)       enable signed transaction pusher\n  --enable-mixin-details [=arg(=1)] (=0)\n                                        enable mixin details for key images,\n                                        e.g., timescale, mixin of mixins, in tx\n                                        context\n  --enable-key-image-checker [=arg(=1)] (=0)\n                                        enable key images file checker\n  --enable-output-key-checker [=arg(=1)] (=0)\n                                        enable outputs key file checker\n  --enable-json-api [=arg(=1)] (=0)     enable JSON REST api\n  --enable-as-hex [=arg(=1)] (=0)       enable links to provide hex\n                                        represtations of a tx and a block\n  --enable-autorefresh-option [=arg(=1)] (=0)\n                                        enable users to have the index page on\n                                        autorefresh\n  --enable-emission-monitor [=arg(=1)] (=0)\n                                        enable Monero total emission monitoring\n                                        thread\n  -p [ --port ] arg (=8081)             default explorer port\n  -x [ --bindaddr ] arg (=0.0.0.0)      default bind address for the explorer\n  --testnet-url arg                     you can specify testnet url, if you run\n                                        it on mainnet or stagenet. link will\n                                        show on front page to testnet explorer\n  --stagenet-url arg                    you can specify stagenet url, if you\n                                        run it on mainnet or testnet. link will\n                                        show on front page to stagenet explorer\n  --mainnet-url arg                     you can specify mainnet url, if you run\n                                        it on testnet or stagenet. link will\n                                        show on front page to mainnet explorer\n  --no-blocks-on-index arg (=10)        number of last blocks to be shown on\n                                        index page\n  --mempool-info-timeout arg (=5000)    maximum time, in milliseconds, to wait\n                                        for mempool data for the front page\n  --mempool-refresh-time arg (=5)       time, in seconds, for each refresh of\n                                        mempool state\n  -c [ --concurrency ] arg (=0)         number of threads handling http\n                                        queries. Default is 0 which means it is\n                                        based you on the cpu\n  -b [ --bc-path ] arg                  path to lmdb folder of the blockchain,\n                                        e.g., ~/.bitmonero/lmdb\n  --ssl-crt-file arg                    path to crt file for ssl (https)\n                                        functionality\n  --ssl-key-file arg                    path to key file for ssl (https)\n                                        functionality\n  -d [ --daemon-url ] arg (=http:://127.0.0.1:18081)\n                                        Monero daemon url\n  --daemon-login arg                    Specify username[:password] for daemon \n                                        RPC client\n  --enable-mixin-guess [=arg(=1)] (=0)  enable guessing real outputs in key\n```\n\nExample usage, defined as bash aliases.\n\n```bash\n# for mainnet explorer\nalias xmrblocksmainnet='~/onion-monero-blockchain-explorer/build/xmrblocks    --port 8081 --testnet-url \"http://139.162.32.245:8082\" --enable-pusher --enable-emission-monitor'\n\n# for testnet explorer\nalias xmrblockstestnet='~/onion-monero-blockchain-explorer/build/xmrblocks -t --port 8082 --mainnet-url \"http://139.162.32.245:8081\" --enable-pusher --enable-emission-monitor'\n```\n\nExample usage when running via Docker:\n\n```bash\n# Run in foreground\ndocker run -it -v \u003cpath-to-monero-blockckain-on-the-host\u003e:/home/monero/.bitmonero -p 8081:8081  xmrblocks \"./xmrblocks --daemon-url=node.sethforprivacy.com:18089 --enable-json-api --enable-autorefresh-option --enable-emission-monitor --enable-pusher\"\n\n# Run in background\ndocker run -it -d -v \u003cpath-to-monero-blockchain-on-the-host\u003e:/home/monero/.bitmonero -p 8081:8081  xmrblocks \"./xmrblocks --daemon-url=node.sethforprivacy.com:18089 --enable-json-api --enable-autorefresh-option --enable-emission-monitor --enable-pusher\"\n```\n\nMake sure to always start the portion of command line flags with `./xmrblocks` and set any flags you would like after that, as shown above.\n\n## Enable Monero emission\n\nObtaining current Monero emission amount is not straight forward. Thus, by default it is\ndisabled. To enable it use `--enable-emission-monitor` flag, e.g.,\n\n\n```bash\nxmrblocks --enable-emission-monitor\n```\n\nThis flag will enable emission monitoring thread. When started, the thread\n will initially scan the entire blockchain, and calculate the cumulative emission based on each block.\nSince it is a separate thread, the explorer will work as usual during this time.\nEvery 10000 blocks, the thread will save current emission in a file, by default,\n in `~/.bitmonero/lmdb/emission_amount.txt`. For testnet or stagenet networks,\n it is `~/.bitmonero/testnet/lmdb/emission_amount.txt` or `~/.bitmonero/stagenet/lmdb/emission_amount.txt`. This file is used so that we don't\n need to rescan entire blockchain whenever the explorer is restarted. When the\n explorer restarts, the thread will first check if `~/.bitmonero/lmdb/emission_amount.txt`\n is present, read its values, and continue from there if possible. Subsequently, only the initial\n use of the thread is time consuming. Once the thread scans the entire blockchain, it updates\n the emission amount using new blocks as they come. Since the explorer writes this file, there can\n be only one instance of it running for mainnet, testnet and stagenet. Thus, for example, you can't have\n two explorers for mainnet\n running at the same time, as they will be trying to write and read the same file at the same time,\n leading to unexpected results. Off course having one instance for mainnet and one instance for testnet\n is fine, as they write to different files.\n\n When the emission monitor is enabled, information about current emission of coinbase and fees is\n displayed on the front page, e.g., :\n\n```\nMonero emission (fees) is 14485540.430 (52545.373) as of 1313448 block\n```\n\nThe values given, can be checked using Monero daemon's  `print_coinbase_tx_sum` command.\nFor example, for the above example: `print_coinbase_tx_sum 0 1313449`.\n\nTo disable the monitor, simply restart the explorer without `--enable-emission-monitor` flag.\n\n## Enable SSL (https)\n\nBy default, the explorer does not use ssl. But it has such a functionality.\n\nAs an example, you can generate your own ssl certificates as follows:\n\n```bash\ncd /tmp # example folder\nopenssl genrsa -out server.key 1024\nopenssl req -new -key server.key -out server.csr\nopenssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt\n```\n\nHaving the `crt` and `key` files, run `xmrblocks` in the following way:\n\n```bash\n./xmrblocks --ssl-crt-file=/tmp/server.crt --ssl-key-file=/tmp/server.key\n```\n\nNote: Because we generated our own certificate, modern browsers will complain\nabout it as they can't verify the signatures against any third party. So probably\nfor any practical use need to have properly issued ssl certificates.\n\n## JSON API\n\nThe explorer has JSON api. For the API, it uses conventions defined by [JSend](https://labs.omniti.com/labs/jsend).\nBy default the api is disabled. To enable it, use `--enable-json-api` flag, e.g.,\n\n```\n./xmrblocks --enable-json-api\n```\n\n#### api/transaction/\u003ctx_hash\u003e\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://127.0.0.1:8081/api/transaction/6093260dbe79fd6277694d14789dc8718f1bd54457df8bab338c2efa3bb0f03d\"\n```\n\nPartial results shown:\n\n```json\n{\n  \"data\": {\n    \"block_height\": 1268252,\n    \"coinbase\": false,\n    \"confirmations\": 1057855,\n    \"current_height\": 2326107,\n    \"extra\": \"01be23e277aed6b5f41f66b05244bf994c13108347366ec678ae16657f0fc3a22b\",\n    \"inputs\": [\n      {\n        \"amount\": 0,\n        \"key_image\": \"67838fd0ffd79f13e735830d3ec60412aed59e53e1f997feb6f73d088b949611\",\n        \"mixins\": [\n          {\n            \"block_no\": 1238623,\n            \"public_key\": \"0a5b853c55303c10e1326acfb085b9e246e088b1ccac7e37f7a810d46a28a914\",\n            \"tx_hash\": \"686555fb053dd53f6f9eb79449e2bdcd377221f823f508158d70d4a1966fe955\"\n          },\n          {\n            \"block_no\": 1246942,\n            \"public_key\": \"527cf86f5abbfb006c970f7c6eb40493786d4751306f8985c6a43f98a88c0dff\",\n            \"tx_hash\": \"4fa1999f9e0d2ad031dbe5594f2e8336651b6cad19dd3cee7980a01c47600f91\"\n          }\n        ]\n      }\n    ],\n    \"mixin\": 9,\n    \"outputs\": [\n      {\n        \"amount\": 0,\n        \"public_key\": \"525779873776e4a42f517fd79b72e7c31c3ba03e730fc32287f6414fb702c1d7\"\n      },\n      {\n        \"amount\": 0,\n        \"public_key\": \"e25f00fceb77af841d780b68647618812695b4ca6ebe338faba6e077f758ac30\"\n      }\n    ],\n    \"payment_id\": \"\",\n    \"payment_id8\": \"\",\n    \"rct_type\": 1,\n    \"timestamp\": 1489753456,\n    \"timestamp_utc\": \"2017-03-17 12:24:16\",\n    \"tx_fee\": 12517785574,\n    \"tx_hash\": \"6093260dbe79fd6277694d14789dc8718f1bd54457df8bab338c2efa3bb0f03d\",\n    \"tx_size\": 13323,\n    \"tx_version\": 2,\n    \"xmr_inputs\": 0,\n    \"xmr_outputs\": 0\n  },\n  \"status\": \"success\"\n}\n\n```\n\n#### api/transactions\n\nTransactions in last 25 blocks\n\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://127.0.0.1:8081/api/transactions\"\n```\n\nPartial results shown:\n\n```json\n{\n  \"data\": {\n    \"blocks\": [\n      {\n        \"age\": \"33:16:49:53\",\n        \"height\": 1268252,\n        \"size\": 105390000000000000,\n        \"timestamp\": 1489753456,\n        \"timestamp_utc\": \"2017-03-17 12:24:16\",\n        \"txs\": [\n          {\n            \"coinbase\": true,\n            \"mixin\": 0,\n            \"outputs\": 8491554678365,\n            \"rct_type\": 0,\n            \"tx_fee\": 0,\n            \"tx_hash\": \"7c4286f64544568265bb5418df84ae69afaa3567749210e46f8340c247f4803f\",\n            \"tx_size\": 151000000000000,\n            \"tx_version\": 2\n          },\n          {\n            \"coinbase\": false,\n            \"mixin\": 5,\n            \"outputs\": 0,\n            \"rct_type\": 2,\n            \"tx_fee\": 17882516700,\n            \"tx_hash\": \"2bfbccb918ee5f050808dd040ce03943b7315b81788e9cdee59cf86b557ba48c\",\n            \"tx_size\": 19586000000000000,\n            \"tx_version\": 2\n          }\n        ]\n      }\n    ],\n    \"limit\": 25,\n    \"page\": 0\n  },\n  \"status\": \"success\"\n}\n```\n\n#### api/transactions?page=\u003cpage_no\u003e\u0026limit=\u003ctx_per_page\u003e\n\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://127.0.0.1:8081/api/transactions?page=2\u0026limit=10\"\n```\n\nResult analogical to the one above.\n\n#### api/block/\u003cblock_number|block_hash\u003e\n\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://139.162.32.245:8081/api/block/1293257\"\n```\n\nPartial results shown:\n\n```json\n{\n  \"data\": {\n    \"block_height\": 1293257,\n    \"block_reward\": 0,\n    \"current_height\": 1293264,\n    \"hash\": \"9ef6bb8f9b8bd253fc6390e5c2cdc45c8ee99fad16447437108bf301fe6bd6e1\",\n    \"size\": 141244,\n    \"timestamp\": 1492761974,\n    \"timestamp_utc\": \"2017-04-21 08:06:14\",\n    \"txs\": [\n      {\n        \"coinbase\": true,\n        \"extra\": \"018ae9560eb85d5ebd22d3beaed55c21d469eab430c5e3cac61b3fe2f5ad156770020800000001a9030800\",\n        \"mixin\": 0,\n        \"payment_id\": \"\",\n        \"payment_id8\": \"\",\n        \"rct_type\": 0,\n        \"tx_fee\": 0,\n        \"tx_hash\": \"3ff71b65bec34c9261e01a856e6a03594cf0472acf6b77db3f17ebd18eaa30bf\",\n        \"tx_size\": 95,\n        \"tx_version\": 2,\n        \"xmr_inputs\": 0,\n        \"xmr_outputs\": 8025365394426\n      }\n    ]\n  },\n  \"status\": \"success\"\n}\n```\n\n#### api/mempool\n\nReturn all txs in the mempool.\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://127.0.0.1:8081/api/mempool\"\n```\n\nPartial results shown:\n\n```json\n{\n  \"data\": {\n    \"limit\": 100000000,\n    \"page\": 0,\n    \"total_page_no\": 0,\n    \"txs\": [\n      {\n        \"coinbase\": false,\n        \"extra\": \"022100325f677d96f94155a4840a84d8e0c905f7a4697a25744633bcb438feb1e51fb2012eda81bf552c53c2168f4130dbe0265c3a7898f3a7eee7c1fed955a778167b5d\",\n        \"mixin\": 3,\n        \"payment_id\": \"325f677d96f94155a4840a84d8e0c905f7a4697a25744633bcb438feb1e51fb2\",\n        \"payment_id8\": \"\",\n        \"rct_type\": 2,\n        \"timestamp\": 1494470894,\n        \"timestamp_utc\": \"2017-05-11 02:48:14\",\n        \"tx_fee\": 15894840000,\n        \"tx_hash\": \"9f3374f8ac67febaab153eab297937a3d0d2c706601e496bf5028146da0c9aef\",\n        \"tx_size\": 13291,\n        \"tx_version\": 2,\n        \"xmr_inputs\": 0,\n        \"xmr_outputs\": 0\n      }\n    ],\n    \"txs_no\": 7\n  },\n  \"status\": \"success\"\n}\n```\n\nLimit of 100000000 is just default value above to ensure that all mempool txs are fetched\nif no specific limit given.\n\n#### api/mempool?limit=\u003cno_of_top_txs\u003e\n\nReturn number of newest mempool txs, e.g., only 10.\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://127.0.0.1:8081/api/mempool?limit=10\"\n```\n\nResult analogical to the one above.\n\n#### api/search/\u003cblock_number|tx_hash|block_hash\u003e\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://127.0.0.1:8081/api/search/1293669\"\n```\n\nPartial results shown:\n\n```json\n{\n  \"data\": {\n    \"block_height\": 1293669,\n    \"current_height\": 1293670,\n    \"hash\": \"5d55b8fabf85b0b4c959d66ad509eb92ddfe5c2b0e84e1760abcb090195c1913\",\n    \"size\": 118026,\n    \"timestamp\": 1492815321,\n    \"timestamp_utc\": \"2017-04-21 22:55:21\",\n    \"title\": \"block\",\n    \"txs\": [\n      {\n        \"coinbase\": true,\n        \"extra\": \"01cb7fda09033a5fa06dc601b9295ef3790397cf3c645e958e34cf7ab699d2f5230208000000027f030200\",\n        \"mixin\": 0,\n        \"payment_id\": \"\",\n        \"payment_id8\": \"\",\n        \"rct_type\": 0,\n        \"tx_fee\": 0,\n        \"tx_hash\": \"479ba432f5c88736b438dd4446a11a13046a752d469f7828151f5c5b86be4e9a\",\n        \"tx_size\": 95,\n        \"tx_version\": 2,\n        \"xmr_inputs\": 0,\n        \"xmr_outputs\": 7992697599717\n      }\n    ]\n  },\n  \"status\": \"success\"\n}\n```\n\n\n#### api/outputs?txhash=\u003ctx_hash\u003e\u0026address=\u003caddress\u003e\u0026viewkey=\u003cviewkey\u003e\u0026txprove=\u003c0|1\u003e\n\nFor `txprove=0` we check which outputs belong to given address and corresponding viewkey.\nFor `txprove=1` we use to prove to the recipient that we sent them founds.\nFor this, we use recipient's address and our tx private key as a viewkey value,\n i.e., `viewkey=\u003ctx_private_key\u003e`\n\nChecking outputs:\n\n```bash\n# we use here official Monero project's donation address as an example\ncurl  -w \"\\n\" -X GET \"http://127.0.0.1:8081/api/outputs?txhash=17049bc5f2d9fbca1ce8dae443bbbbed2fc02f1ee003ffdd0571996905faa831\u0026address=44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A\u0026viewkey=f359631075708155cc3d92a32b75a7d02a5dcf27756707b47a2b31b21c389501\u0026txprove=0\"\n```\n\n```json\n{\n  \"data\": {\n    \"address\": \"42f18fc61586554095b0799b5c4b6f00cdeb26a93b20540d366932c6001617b75db35109fbba7d5f275fef4b9c49e0cc1c84b219ec6ff652fda54f89f7f63c88\",\n    \"outputs\": [\n      {\n        \"amount\": 34980000000000,\n        \"match\": true,\n        \"output_idx\": 0,\n        \"output_pubkey\": \"35d7200229e725c2bce0da3a2f20ef0720d242ecf88bfcb71eff2025c2501fdb\"\n      },\n      {\n        \"amount\": 0,\n        \"match\": false,\n        \"output_idx\": 1,\n        \"output_pubkey\": \"44efccab9f9b42e83c12da7988785d6c4eb3ec6e7aa2ae1234e2f0f7cb9ed6dd\"\n      }\n    ],\n    \"tx_hash\": \"17049bc5f2d9fbca1ce8dae443bbbbed2fc02f1ee003ffdd0571996905faa831\",\n    \"tx_prove\": false,\n    \"viewkey\": \"f359631075708155cc3d92a32b75a7d02a5dcf27756707b47a2b31b21c389501\"\n  },\n  \"status\": \"success\"\n}\n```\n\nProving transfer:\n\nWe use recipient's address (i.e. not our address from which we sent xmr to recipient).\nFor the viewkey, we use `tx_private_key` (although the GET variable is still called `viewkey`) that we obtained by sending this txs.\n\n```bash\n# this is for testnet transaction\ncurl  -w \"\\n\" -X GET \"http://127.0.0.1:8082/api/outputs?txhash=94782a8c0aa8d8768afa0c040ef0544b63eb5148ca971a024ac402cad313d3b3\u0026address=9wUf8UcPUtb2huK7RphBw5PFCyKosKxqtGxbcKBDnzTCPrdNfJjLjtuht87zhTgsffCB21qmjxjj18Pw7cBnRctcKHrUB7N\u0026viewkey=e94b5bfc599d2f741d6f07e3ab2a83f915e96fb374dfb2cd3dbe730e34ecb40b\u0026txprove=1\"\n```\n\n```json\n{\n  \"data\": {\n    \"address\": \"71bef5945b70bc0a31dbbe6cd0bd5884fe694bbfd18fff5f68f709438554fb88a51b1291e378e2f46a0155108782c242cc1be78af229242c36d4f4d1c4f72da2\",\n    \"outputs\": [\n      {\n        \"amount\": 1000000000000,\n        \"match\": true,\n        \"output_idx\": 0,\n        \"output_pubkey\": \"c1bf4dd020b5f0ab70bd672d2f9e800ea7b8ab108b080825c1d6cfc0b7f7ee00\"\n      },\n      {\n        \"amount\": 0,\n        \"match\": false,\n        \"output_idx\": 1,\n        \"output_pubkey\": \"8c61fae6ada2a103565dfdd307c7145b2479ddb1dab1eaadfa6c34db65d189d5\"\n      }\n    ],\n    \"tx_hash\": \"94782a8c0aa8d8768afa0c040ef0544b63eb5148ca971a024ac402cad313d3b3\",\n    \"tx_prove\": true,\n    \"viewkey\": \"e94b5bfc599d2f741d6f07e3ab2a83f915e96fb374dfb2cd3dbe730e34ecb40b\"\n  },\n  \"status\": \"success\"\n}\n```\n\n\nResult analogical to the one above.\n\n#### api/networkinfo\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://127.0.0.1:8081/api/networkinfo\"\n```\n\n```json\n{\n  \"data\": {\n    \"alt_blocks_count\": 0,\n    \"block_size_limit\": 600000,\n    \"cumulative_difficulty\": 2091549555696348,\n    \"difficulty\": 7941560081,\n    \"fee_per_kb\": 303970000,\n    \"grey_peerlist_size\": 4991,\n    \"hash_rate\": 66179667,\n    \"height\": 1310423,\n    \"incoming_connections_count\": 0,\n    \"outgoing_connections_count\": 5,\n    \"start_time\": 1494822692,\n    \"status\": \"OK\",\n    \"target\": 120,\n    \"target_height\": 0,\n    \"testnet\": false,\n    \"top_block_hash\": \"76f9e85d62415312758bc09e0b9b48fd2b005231ad1eee435a8081e551203f82\",\n    \"tx_count\": 1219048,\n    \"tx_pool_size\": 2,\n    \"white_peerlist_size\": 1000\n  },\n  \"status\": \"success\"\n}\n```\n\n#### api/outputsblocks\n\nSearch for our outputs in last few blocks (up to 5 blocks), using provided address and viewkey.\n\n\n```bash\n# testnet address\ncurl  -w \"\\n\" -X GET http://127.0.0.1:8081/api/outputsblocks?address=9sDyNU82ih1gdhDgrqHbEcfSDFASjFgxL9B9v5f1AytFUrYsVEj7bD9Pyx5Sw2qLk8HgGdFM8qj5DNecqGhm24Ce6QwEGDi\u0026viewkey=807079280293998634d66e745562edaaca45c0a75c8290603578b54e9397e90a\u0026limit=5\u0026mempool=1\n```\n\nExample result:\n\n```json\n{\n  \"data\": {\n    \"address\": \"0182d5be0f708cecf2b6f9889738bde5c930fad846d5b530e021afd1ae7e24a687ad50af3a5d38896655669079ad0163b4a369f6c852cc816dace5fc7792b72f\",\n    \"height\": 960526,\n    \"limit\": \"5\",\n    \"mempool\": true,\n    \"outputs\": [\n      {\n        \"amount\": 33000000000000,\n        \"block_no\": 0,\n        \"in_mempool\": true,\n        \"output_idx\": 1,\n        \"output_pubkey\": \"2417b24fc99b2cbd9459278b532b37f15eab6b09bbfc44f9d17e15cd25d5b44f\",\n        \"payment_id\": \"\",\n        \"tx_hash\": \"9233708004c51d15f44e86ac1a3b99582ed2bede4aaac6e2dd71424a9147b06f\"\n      },\n      {\n        \"amount\": 2000000000000,\n        \"block_no\": 960525,\n        \"in_mempool\": false,\n        \"output_idx\": 0,\n        \"output_pubkey\": \"9984101f5471dda461f091962f1f970b122d4469077aed6b978a910dc3ed4576\",\n        \"payment_id\": \"0000000000000055\",\n        \"tx_hash\": \"37825d0feb2e96cd10fa9ec0b990ac2e97d2648c0f23e4f7d68d2298996acefd\"\n      },\n      {\n        \"amount\": 96947454120000,\n        \"block_no\": 960525,\n        \"in_mempool\": false,\n        \"output_idx\": 1,\n        \"output_pubkey\": \"e4bded8e2a9ec4d41682a34d0a37596ec62742b28e74b897fcc00a47fcaa8629\",\n        \"payment_id\": \"0000000000000000000000000000000000000000000000000000000000001234\",\n        \"tx_hash\": \"4fad5f2bdb6dbd7efc2ce7efa3dd20edbd2a91640ce35e54c6887f0ee5a1a679\"\n      }\n    ],\n    \"viewkey\": \"807079280293998634d66e745562edaaca45c0a75c8290603578b54e9397e90a\"\n  },\n  \"status\": \"success\"\n}\n```\n\n#### api/emission\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://127.0.0.1:8081/api/emission\"\n```\n\n```json\n{\n  \"data\": {\n    \"blk_no\": 1313969,\n    \"coinbase\": 14489473877253413000,\n    \"fee\": 52601974988641130\n  },\n  \"status\": \"success\"\n}\n```\n\nEmission only works when the emission monitoring thread is enabled.\n\n#### api/version\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://127.0.0.1:8081/api/version\"\n```\n\n```json\n{\n  \"data\": {\n    \"api\": 65536,\n    \"blockchain_height\": 1357031,\n    \"git_branch_name\": \"update_to_current_monero\",\n    \"last_git_commit_date\": \"2017-07-25\",\n    \"last_git_commit_hash\": \"a549f25\",\n    \"monero_version_full\": \"0.10.3.1-ab594cfe\"\n  },\n  \"status\": \"success\"\n}\n```\n\napi number is store as `uint32_t`. In this case `65536` represents\nmajor version 1 and minor version 0.\nIn JavaScript to get these numbers, one can do as follows:\n\n```javascript\nvar api_major = response.data.api \u003e\u003e 16;\nvar api_minor = response.data.api \u0026 0xffff;\n```\n\n#### api/rawblock/\u003cblock_number|block_hash\u003e\n\nReturn raw json block data, as represented in Monero.\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://139.162.32.245:8081/api/rawblock/1293257\"\n```\n\nExample result not shown.\n\n#### api/rawtransaction/\u003ctx_hash\u003e\n\nReturn raw json tx data, as represented in Monero.\n\n```bash\ncurl  -w \"\\n\" -X GET \"http://139.162.32.245:8081/api/rawtransaction/6093260dbe79fd6277694d14789dc8718f1bd54457df8bab338c2efa3bb0f03d\"\n```\n\nExample result not shown.\n\n## Other monero examples\n\nOther examples can be found on  [github](https://github.com/moneroexamples?tab=repositories).\nPlease know that some of the examples/repositories are not\nfinished and may not work as intended.\n\n## How can you help?\n\nConstructive criticism, code and website edits are always good. They can be made through github.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoneroexamples%2Fonion-monero-blockchain-explorer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoneroexamples%2Fonion-monero-blockchain-explorer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoneroexamples%2Fonion-monero-blockchain-explorer/lists"}