Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glaukiol1/gagchain
Proof-Of-Work blockchain written in Go
https://github.com/glaukiol1/gagchain
algorithm bitcoin blockchain cryptocurrency cryptography database db elliptic elliptic-curve-cryptography keypairs secp256k1 tcp
Last synced: about 21 hours ago
JSON representation
Proof-Of-Work blockchain written in Go
- Host: GitHub
- URL: https://github.com/glaukiol1/gagchain
- Owner: glaukiol1
- Created: 2022-01-10T21:12:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-17T14:15:18.000Z (almost 3 years ago)
- Last Synced: 2024-10-12T20:41:20.734Z (about 1 month ago)
- Topics: algorithm, bitcoin, blockchain, cryptocurrency, cryptography, database, db, elliptic, elliptic-curve-cryptography, keypairs, secp256k1, tcp
- Language: Go
- Homepage:
- Size: 111 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gagchain (Gagcoin)
Experimental blockchain built in Golang. It is still under development and features will be updated regulary.
## Features
- Custom TCP server for communication with nodes
- Custom Database built only to store the current chain
- Custom communication messages to communicate with other nodes
- Verifying node authenticity by its address
- Concurrency
- Easy to compile and run## Using this for your own blockchain project
If you use this as a template, please do not remove any credits, and I expect to be credited in a README file or something similar. You can always run your own node, just setup the variables that are found in the `main.go` file (root directory).
## Usage
WHen you run a node, you can do the following things;
Init blockchain;
```go
blockchain.InitBlockchain()
```Or: `&blockchain.Blockchain{chain []*blockchain.Block}`
Init Transaction Pool;
```go
blockchain.NewTransactionPool()
```Add Block to the blockchain (this also mines it if;
- The Miner field is ""
- config.Mining_Node = true
```go
(*blockchain.Blockchain).AddBlock(data []*blockchain.Transaction, hash []byte, nonce int, Miner string)
```Add transaction to the Transaction Pool;
```go
(*blockchain.TransactionPool).AddTransaction(transaction *blockchain.Transaction)
```New Transaction;
```go
(*blockchain.Blockchain).NewTransactionInstance(from *ecdsa.PublicKey, to string, amount int)
```Mine Transactions from Transaction Pool;
```go
(*blockchain.TransactionPool).MineTransactions()
```