Giter VIP home page Giter VIP logo

solsticechain's Introduction

solsticechain

Proof of Authority blockchain, with predefined list of nodes

  • miners are set in the configuration file and included in the genesis block, thus immutable
  • only miners which are in the genesis block are allowed to include blocks
  • address similar to bitcoin
  • mining consists of signing the block signature by the miners
  • mining each 1 minute, with 10 coins reward
  • nodes with sync using network communication (commands)
  • a simple RPC server is implemented

run locally

export NODE_ID=3005
go install
cd $GOPATH/bin
solsticechain createwallet #this will be the first miner's address, minerAddress1
solsticechain createblockchain -address <minerAddress1>
solsticechain getbalance -address <minerAddress1> # returns the balance of minerAddress1
solsticechain printchain # prints the blockchain
solsticechain startnode -miner <minerAddress1> # starts the node and the API server
solsticechain send -from <minerAddress1> -to <clientNode1> -amount 10 -data 'test send' -mine

# in a new terminal
export NODE_ID=3000
solsticechain createwallet #this will be a client node (non miner)

# in a new terminal
export NODE_ID=3010
solsticechain createwallet #this will be second miner's address, minerAddress2
solsticechain startnode -miner <minerAddress2> # starts the node and downloads the blockchain from minerNode1

cli commands

Usage:
  createblockchain -address ADDRESS - Create a blockchain and send genesis block reward to ADDRESS
  createwallet - Generates a new key-pair and saves it into the wallet file
  getbalance -address ADDRESS - Get balance of ADDRESS
  listaddresses - Lists all addresses from the wallet file
  printchain - Print all the blocks of the blockchain
  reindexutxo - Rebuilds the UTXO set
  send -from FROM -to TO -amount AMOUNT -data DATA -mine - Send AMOUNT of coins from FROM address to TO, optional data, mine on the same node (if-mine)
  startnode -miner ADDRESS - Start a node with ID specified in NODE_ID env. var. -miner enables mining

api

  • get block count http://localhost:30058/block-count
  • get block http://localhost:30058/blocks/1 (by block height) http://localhost:30058/blocks/66b5abab811574a13f35af36ed6750990a6cb18eac61adb66fee39e92d74ec4b (by block hash)

solsticechain's People

Contributors

nikravi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.