All Projects → koshikraj → pynaivechain

koshikraj / pynaivechain

Licence: Apache-2.0 license
Python implementation of naivechain project

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pynaivechain

Swagger Py Codegen
a Python web framework generator supports Flask, Tornado, Falcon, Sanic
Stars: ✭ 508 (+2722.22%)
Mutual labels:  sanic
Hproxy
hproxy - Asynchronous IP proxy pool, aims to make getting proxy as convenient as possible.(异步爬虫代理池)
Stars: ✭ 62 (+244.44%)
Mutual labels:  sanic
Owllook
owllook-小说搜索引擎
Stars: ✭ 2,163 (+11916.67%)
Mutual labels:  sanic
Microservices Connector
Inter-Service communication framework, support for microservice architecture and distributed system
Stars: ✭ 17 (-5.56%)
Mutual labels:  sanic
Immuni Backend App Configuration
Repository for the backend app configuration
Stars: ✭ 33 (+83.33%)
Mutual labels:  sanic
Graphql Server
This is the core package for using GraphQL in a custom server easily
Stars: ✭ 65 (+261.11%)
Mutual labels:  sanic
Mangum
AWS Lambda & API Gateway support for ASGI
Stars: ✭ 475 (+2538.89%)
Mutual labels:  sanic
Sanic
Async Python 3.7+ web server/framework | Build fast. Run fast.
Stars: ✭ 15,660 (+86900%)
Mutual labels:  sanic
Sanic Transmute
Easily document your Sanic API with Swagger UI, Plus param validation and model serialization.
Stars: ✭ 42 (+133.33%)
Mutual labels:  sanic
Sanic Cors
A Sanic extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible. Based on flask-cors by Cory Dolphin.
Stars: ✭ 143 (+694.44%)
Mutual labels:  sanic
Sanic Dispatcher
A Dispatcher extension for Sanic which also acts as a Sanic-to-WSGI adapter
Stars: ✭ 29 (+61.11%)
Mutual labels:  sanic
Cookiecutter Sanic Microservice
A template for rapid development of Sanic based RESTful Microservices
Stars: ✭ 32 (+77.78%)
Mutual labels:  sanic
Sanic Nginx Docker Example
Sanic + Nginx + Docker basic example
Stars: ✭ 77 (+327.78%)
Mutual labels:  sanic
Memegen
The free and open source API to generate memes.
Stars: ✭ 648 (+3500%)
Mutual labels:  sanic
Asyncorm
Fully Async ORM inspired in django's
Stars: ✭ 182 (+911.11%)
Mutual labels:  sanic
Lyanna
My Blog Using Sanic
Stars: ✭ 482 (+2577.78%)
Mutual labels:  sanic
Sanic Prometheus
Prometheus metrics for Sanic, an async python web server
Stars: ✭ 63 (+250%)
Mutual labels:  sanic
pait
Python Modern API Tools, fast to code
Stars: ✭ 24 (+33.33%)
Mutual labels:  sanic
Sanic Jwt
Authentication, JWT, and permission scoping for Sanic
Stars: ✭ 189 (+950%)
Mutual labels:  sanic
Sanic session
Provides server-backed sessions for Sanic using Redis, Memcache and more.
Stars: ✭ 131 (+627.78%)
Mutual labels:  sanic

pynaivechain

Python implementation of naivechain project

Build Status

Naivechain - a blockchain implementation in 200 lines of code

Motivation

All the current implementations of blockchains are tightly coupled with the larger context and problems they (e.g. Bitcoin or Ethereum) are trying to solve. This makes understanding blockchains a necessarily harder task, than it must be. Especially source-code-wisely. This project is an attempt to provide as concise and simple implementation of a blockchain as possible.

What is blockchain

From Wikipedia : Blockchain is a distributed database that maintains a continuously-growing list of records called blocks secured from tampering and revision.

Key concepts of Naivechain

Check also this blog post for a more detailed overview of the key concepts

  • HTTP interface to control the node
  • Use Websockets to communicate with other nodes (P2P)
  • Super simple "protocols" in P2P communication
  • Data is not persisted in nodes
  • No proof-of-work or proof-of-stake: a block can be added to the blockchain without competition

alt tag

alt tag

Naivecoin

For a more extensive tutorial about blockchains, you can check the project Naivecoin. It is based on Naivechain and implements for instance Proof-of-work, transactions and wallets.

Quick start

(set up two connected nodes and mine 1 block)

install python version >= 3.5

pip install -r requirements.txt
PORT=3001 python main.py
PORT=3002 PEERS=ws://localhost:3001 python main.py
curl -H "Content-type:application/json" --data '{"data" : "Some data to the first block"}' http://localhost:3001/mineBlock

Quick start with Docker

(set up three connected nodes and mine a block)

docker-compose up
curl -H "Content-type:application/json" --data '{"data" : "Some data to the first block"}' http://localhost:3001/mineBlock

HTTP API

Get blockchain
curl http://localhost:3001/blocks
Create block
curl -H "Content-type:application/json" --data '{"data" : "Some data to the first block"}' http://localhost:3001/mineBlock
Add peer
curl -H "Content-type:application/json" --data '{"peer" : "ws://localhost:6001"}' http://localhost:3001/addPeer

Query connected peers

curl http://localhost:3001/peers
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].