The extended version of the Cryptocurrency Service implementing data proofs. This project demonstrates how to bootstrap your own cryptocurrency with Exonum blockchain.
See the documentation for a detailed step-by-step guide how to approach this example.
Exonum blockchain keeps balances of users and handles secure transactions between them.
It implements most basic operations:
Simply run the following command to start the cryptocurrency service on 4 nodes on the local machine:
bash
docker run -p 8000-8008:8000-8008 exonumhub/exonum-cryptocurrency-advanced:demo
Ready! Find demo at http://127.0.0.1:8008.
Docker will automatically pull image from the repository and
run 4 nodes with public endpoints at 127.0.0.1:8000
, ..., 127.0.0.1:8003
and private ones at 127.0.0.1:8004
, ..., 127.0.0.1:8007
.
To stop docker container, use docker stop <container id>
command.
Be sure you installed necessary packages:
Below you will find a step-by-step guide to starting the cryptocurrency service on 4 nodes on the local machine.
Build the project:
```sh cd examples/cryptocurrency-advanced/backend
cargo install ```
Generate template:
```sh mkdir example
exonum-cryptocurrency-advanced generate-template example/common.toml --validators-count 4 ```
Generate public and secrets keys for each node:
```sh exonum-cryptocurrency-advanced generate-config example/common.toml example/pub1.toml example/sec1.toml --peer-address 127.0.0.1:6331 -c example/consensus1.toml -s example/service1.toml -n
exonum-cryptocurrency-advanced generate-config example/common.toml example/pub2.toml example/sec2.toml --peer-address 127.0.0.1:6332 -c example/consensus2.toml -s example/service2.toml -n
exonum-cryptocurrency-advanced generate-config example/common.toml example/pub3.toml example/sec3.toml --peer-address 127.0.0.1:6333 -c example/consensus3.toml -s example/service3.toml -n
exonum-cryptocurrency-advanced generate-config example/common.toml example/pub4.toml example/sec4.toml --peer-address 127.0.0.1:6334 -c example/consensus4.toml -s example/service4.toml -n ```
Finalize configs:
```sh exonum-cryptocurrency-advanced finalize --public-api-address 0.0.0.0:8200 --private-api-address 0.0.0.0:8091 example/sec1.toml example/node1cfg.toml --public-configs example/pub1.toml example/pub2.toml example/pub3.toml example/pub_4.toml
exonum-cryptocurrency-advanced finalize --public-api-address 0.0.0.0:8201 --private-api-address 0.0.0.0:8092 example/sec2.toml example/node2cfg.toml --public-configs example/pub1.toml example/pub2.toml example/pub3.toml example/pub_4.toml
exonum-cryptocurrency-advanced finalize --public-api-address 0.0.0.0:8202 --private-api-address 0.0.0.0:8093 example/sec3.toml example/node3cfg.toml --public-configs example/pub1.toml example/pub2.toml example/pub3.toml example/pub_4.toml
exonum-cryptocurrency-advanced finalize --public-api-address 0.0.0.0:8203 --private-api-address 0.0.0.0:8094 example/sec4.toml example/node4cfg.toml --public-configs example/pub1.toml example/pub2.toml example/pub3.toml example/pub_4.toml ```
Run nodes:
```sh exonum-cryptocurrency-advanced run --node-config example/node1cfg.toml --db-path example/db1 --public-api-address 0.0.0.0:8200 --consensus-key-pass pass --service-key-pass pass
exonum-cryptocurrency-advanced run --node-config example/node2cfg.toml --db-path example/db2 --public-api-address 0.0.0.0:8201 --consensus-key-pass pass --service-key-pass pass
exonum-cryptocurrency-advanced run --node-config example/node3cfg.toml --db-path example/db3 --public-api-address 0.0.0.0:8202 --consensus-key-pass pass --service-key-pass pass
exonum-cryptocurrency-advanced run --node-config example/node4cfg.toml --db-path example/db4 --public-api-address 0.0.0.0:8203 --consensus-key-pass pass --service-key-pass pass ```
Install frontend dependencies:
```sh cd ../frontend
npm install ```
Build sources:
sh
npm run build
Run the application:
sh
npm start -- --port=8280 --api-root=http://127.0.0.1:8200
--port
is a port for Node.JS app.
--api-root
is a root URL of public API address of one of nodes.
Ready! Find demo at http://127.0.0.1:8280.
Cryptocurrency demo is licensed under the Apache License (Version 2.0). See LICENSE for details.