Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fedragon/gochain
Modelling a dead-simple blockchain in Go (mostly to learn Go itself).
https://github.com/fedragon/gochain
golang
Last synced: about 2 months ago
JSON representation
Modelling a dead-simple blockchain in Go (mostly to learn Go itself).
- Host: GitHub
- URL: https://github.com/fedragon/gochain
- Owner: fedragon
- License: mit
- Created: 2019-10-17T22:31:43.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-18T19:56:08.000Z (about 5 years ago)
- Last Synced: 2024-06-19T15:11:27.023Z (6 months ago)
- Topics: golang
- Language: Go
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gochain
Modelling a dead-simple blockchain in Go (mostly to learn Go itself).
## Usage
```
// Init chain
chain := NewChain("We ❤️ blockchains")// Init communication channels
unverified := make(chan Block)
updates := make(chan Chain)
verified := make(chan Block)// Init node(s)
node := &Node{
Updates: updates,
Unverified: unverified,
Verified: verified,
}
go node.Run()// Send initial version of the chain to all nodes
updates <- *chain// Run appender
go append(chain, verified)
```