- Antoni Koszowski (@akoszowski on GitHub)
ch-rust is going to be an application based on simple blockchain implementation enabling users to connect to the given node operator in p2p network and live preview currently processed transactions.
Idea is based on the article.
- Simple blockchain implementation
- Node operators logs preview via console
- UI enabling to connect to the given node operator
- UI live preview of the currently processed transactions
- Externally Owned Accounts + API for their creation
- On-chain transactions
- Reasonable consensus algorithm
- UI - creating EOA, generating private key
- UI - sending transactions to friends
-
In the first part I am going to implement the backend logic: simple blockchain implementation, node operators logs preview via console.
-
In the second part I am going to add UI enabling to connect to the given node operator and live preview of transactions.
Extra: If there would be enough time I plan to realize features described in Extra features section.
- Blockchain and nodes implementation
- Nodes console log preview and commands
- Possibility to generate externally owned accounts
- Private, public key generation, signature authorization (concept)
- On-chain transaction
- Client available, but not integrated with the
Blockchain
part - Project splitted into workspaces
- UI - connecting to given node
- UI - live preview of transactions
- UI - interface to send transactions to other addresses
- having started project with bit outdated dependencies versions, moving forward it was hard to bump the up without major code refactoring, what I wanted to avoid
- only later did I realize that
Yew
andTokio
is not enough for successful e2e integration, for it to happen I should have addedWarp
(or sth similar) as well, however it was not compatible with outdatedlibp2p
; here lessons learned: managing dependencies may be troublesome + it is better to be up to date with the dependencies :) - implementing handlers in
Warp
I would be able to create endpoints leveraging existing backend logic then used by appropriate client's requests Swarm
spawns p2p nodes with dynamic port binding, thus it would be hard connecting to a specific one, not really having a good idea here how to effectively resolve this problem- Even though, there is still plenty of improvements or new features that could be introduced,
I am pretty satisfied with the final results - I see how much I ve learned this semester, here in project getting acquainted with
libp2p
,tokio
,yew
and researchingwarp
. Still though, there is a lot of things to learn and advance on. Hopefully my Rustacean journey just begins :)
cargo build
Open few terminals (e.g. 3), in each of them run:
RUST_LOG=info cargo run
Feel free to experiment with commands:
ls b
- list mined blocksls p
- list peers in networkls accounts
- list information about all accountsls account <address>
- list information about account with given addresscreate account
- create new account, get the <address, balance, pub_key>; see <private_key> printed to the consoletransfer {"Transfer":[1,2,3,4]}
- transfers <from, to, amount, signature>
trunk serve
As already mentioned first part is based, in a high degree, on the article.
Block
and App
logic was slightly improved and now is covered with unit tests -> see Github CI. Also goal of getting acquainted
with libp2p
has been realized.