index.rst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. .. blockchain documentation master file, created by
  2. sphinx-quickstart on Mon Mar 6 15:54:51 2017.
  3. You can adapt this file completely to your liking, but it should at least
  4. contain the root `toctree` directive.
  5. Welcome to labChain's documentation!
  6. ======================================
  7. This project is a completely new blockchain-based coin, with P2P networking, a consensus mechanism and a wallet interface. The goal of the project is to provide a framework that is easy to modify for people who want to develop proof-of-concepts for blockchain-based technology.
  8. DO NOT USE THIS AS A REAL CURRENCY TO SEND, RETRIEVE, OR STORE ACTUAL MONEY! While we do not currently know of any way to do so, there are almost certainly
  9. bugs in this implementation that would allow anyone to create money out of the blue or take yours away from you.
  10. Executables
  11. ***********
  12. .. list-table::
  13. :stub-columns: 1
  14. :widths: 10 90
  15. * - miner
  16. - .. automodule:: miner
  17. * - wallet
  18. - .. automodule:: wallet
  19. To start a minimal network of two peers that do not mine, you can do this on different machines::
  20. ./miner.py --listen-port 1234
  21. ./miner.py --bootstrap-peer a.b.c.d:1234
  22. To actually start mining, you'll need to use the wallet and generate a new address that should receive the mining rewards::
  23. ./wallet.py --wallet mining.wallet create-address mining-address.pem
  24. Afterwards, you can copy the file `mining-address.pem` to the second machine and restart the miner like this::
  25. ./miner.py --bootstrap-peer a.b.c.d:1234 --mining-pubkey mining-address.pem
  26. This miner will now mine new blocks for the block chain and send them to the miner application on
  27. the other machine. Once some blocks have been mined, you can check how much money you have made like this::
  28. ./wallet.py --wallet mining.wallet show-balance
  29. Once you have earned money mining, you can send some of it to someone else. To send them 42 coins (we already know how the other person can generate an address), you can do this::
  30. ./wallet.py --wallet mining.wallet transfer other_person_address.pem 42
  31. Both the miner and the wallet have many more options than just these, which can be found using the `--help` switch of the programs. Especially useful might also be the `--rpc-port` option of the miner, which needs to be set to different values when one wants to start more than one instance on the same computer::
  32. ./miner.py --rpc-port 2345 --listen-port 1234
  33. ./miner.py --rpc-port 3456 --bootstrap-peer 127.0.0.1:1234
  34. ./wallet.py --miner-port 2345 --wallet mining.wallet show-balance
  35. Source Code Documentation
  36. *************************
  37. .. autosummary::
  38. :toctree: _autosummary
  39. src.blockchain
  40. src.block
  41. src.chainbuilder
  42. src.crypto
  43. src.merkle
  44. src.mining
  45. src.mining_strategy
  46. src.proof_of_work
  47. src.protocol
  48. src.transaction
  49. src.persistence
  50. src.rpc_client
  51. src.rpc_server
  52. Tests
  53. *****
  54. To run the tests, just run the `pytest` command.
  55. Indices and tables
  56. ==================
  57. * :ref:`genindex`
  58. * :ref:`modindex`
  59. * :ref:`search`