GithubHelp home page GithubHelp logo

naivecoin-rs's Introduction

naivecoin-rs

An implementation of Naivecoin in Rust

Goals

  1. Things should be simple
  2. It should perform as well as possible without making things complicated
  3. Should be able to accomplish basic tasks, cryptocurrencies are expected to do

Getting Started

Start two instances of the app

# run these command on different terminal emulators
cargo run # it runs with the default configuration
KEY_LOC=node/wallet2/private_key.pem HTTP_PORT=8001 P2P_PORT=5001 INITIAL="0.0.0.0:5000" cargo run

Get Blockchain

curl localhost:8000/blocks

Mine a Block

curl -X POST localhost:8000/mineBlock

Mine a Transaction

curl --data '{"address":"ADDRESS_OF_THE_SECOND_PEER", "amount":DESIRED_AMOUNT}' localhost:8000/mineTransaction

Send a Transaction to Pool

curl --data '{"address":"ADDRESS_OF_THE_SECOND_PEER", "amount":DESIRED_AMOUNT}' localhost:8000/sendTransaction
# then mine a block so it gets added to the blockchain
curl -X POST localhost:8000/mineBlock

Get Balance

curl localhost:8001/balance
# the balance should be DESIRED_AMOUNT

TODO

  • Add UI for viewing and interacting with the blockchain
  • Check security

References

naivecoin-rs's People

Contributors

erenoku avatar cheblin avatar

Watchers

 avatar  avatar

Forkers

cheblin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.