https://github.com/teheperor/dvf-blockchain
Learn Blockchains by Building One - HackerNoon.comをPython以外のプログラミング言語で写経
https://github.com/teheperor/dvf-blockchain
blockchain c-plus-plus csharp fsharp go javascript kotlin postman python rust typescript
Last synced: 2 months ago
JSON representation
Learn Blockchains by Building One - HackerNoon.comをPython以外のプログラミング言語で写経
- Host: GitHub
- URL: https://github.com/teheperor/dvf-blockchain
- Owner: teheperor
- License: mit
- Created: 2019-07-12T14:20:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T18:30:53.000Z (over 3 years ago)
- Last Synced: 2026-01-03T12:16:57.800Z (6 months ago)
- Topics: blockchain, c-plus-plus, csharp, fsharp, go, javascript, kotlin, postman, python, rust, typescript
- Language: C++
- Homepage:
- Size: 1.13 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dvf-blockchain
[Learn Blockchains by Building One \- HackerNoon\.com](https://hackernoon.com/learn-blockchains-by-building-one-117428612f46)をPython以外のプログラミング言語で写経した。
## Description
はじめにC#で写経してみたら、コード量が少ないわりにWenアプリケーションフレームワーク、HTTPクライアント、JSON、ハッシュ生成とかいろいろな要素が入っていてプログラミング言語や開発環境やエコシステムの学習のいい題材になると思った。
それでほかのプログラミング言語でもやってみようと思いC#、C++、JavaScript、Go、TypeScript、Rust、Kotlin、F#で写経した。
基本的な方針は[オリジナルのPythonのコード](https://github.com/dvf/blockchain)の設計、構造、名前、エラー処理、処理結果をできるだけ維持して写経すること。
処理結果、特にプルーフオブワーク処理の結果については異なるプログラミング言語による実装間での互換性は維持しない。理由はタイムスタンプの精度(桁数)やJSONのフォーマットを合わせるのが面倒くさいから。
もともとのコードがブロックチェーンのエッセンスの説明のためのものでエラー処理は雑であり写経でも同程度にした。
それぞれのプログラミング言語や開発環境やエコシステムの学習を重視する。
- C# [blockchain-netfx](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-netfx)
- 最初に書いたC#版。
- C# [blockchain-netcore](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-netcore)
- [blockchain-netfx](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-netfx)を.NET Coreのプロジェクトにして更新した。
- C++ [blockchain-cpp-crow](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-cpp-crow)
- はじめにC++で書いたもの。
- C++ [blockchain-cpp](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-cpp)
- [blockchain-cpp-crow](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-cpp-crow)で使用している[ipkn/crow](https://github.com/ipkn/crow)の開発が止まっていることと、ほかのものも試してみたかったのでWebアプリケーションフレームワークを[cpp-httplib](https://github.com/yhirose/cpp-httplib)に変更した。
- [Boost](https://www.boost.org/)への依存をなくして、UUID V4生成には[sole](https://github.com/r-lyeh-archived/sole)を使うようにした。
- JavaScript(Node.js) [blockchain-js](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-js)
- Go [blockchain-go](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-go)
- TypeScript [blockchain-ts](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-ts)
- Rust [blockchain-rust](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-rust)
- Kotlin [blockchain-kotlin](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-kotlin)
- F# [blockchain-fsharp](https://github.com/teheperor/dvf-blockchain/tree/master/blockchain-fsharp)
## Test
[postman](https://www.getpostman.com/)の[テスト・コレクション](https://github.com/teheperor/dvf-blockchain/tree/master/test/postman)とPythonの[テスト](https://github.com/teheperor/dvf-blockchain/tree/master/test/python)を書いた。
どちらも同じ内容で2つのノードにアクセスして正常系の動作だけを一通りテストする。
## License
[MIT](https://github.com/tcnksm/tool/blob/master/LICENCE)
## References
- [Learn Blockchains by Building One \- HackerNoon\.com](https://hackernoon.com/learn-blockchains-by-building-one-117428612f46)
- [dvf/blockchain: A simple Blockchain in Python](https://github.com/dvf/blockchain)
- [ブロックチェ-ンを構築しながら学ぶ \| POSTD](https://postd.cc/learn-blockchains-by-building-one/)