All Projects โ†’ lightstreams-network โ†’ lightchain

lightstreams-network / lightchain

Licence: GPL-3.0 License
Fast proof-of-authority blockchain based on go-ethereum and tendermint

Programming Languages

go
31211 projects - #10 most used programming language
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to lightchain

cosmonauts-world
Projects in the Cosmos and Tendermint ecosystem ๐ŸŒŒ
Stars: โœญ 14 (-73.08%)
Mutual labels:  tendermint, ethermint
kcoin
A stable cryptocurrency that algorithmically targets $1 USD using the Kowala Protocol
Stars: โœญ 17 (-67.31%)
Mutual labels:  consensus, tendermint
Ethermint Archive
Ethereum on Tendermint using Cosmos-SDK!
Stars: โœญ 667 (+1182.69%)
Mutual labels:  consensus, tendermint
go-cita
A Go implementation of CITA. https://docs.nervos.org/cita
Stars: โœญ 25 (-51.92%)
Mutual labels:  consensus, tendermint
Abci Host
Clojure host/server for Tendermint's ABCI protocol.
Stars: โœญ 18 (-65.38%)
Mutual labels:  consensus, tendermint
anychaindb
AnychainDB is fast, distributed, blockchain database based on Tendermint and MongoDB
Stars: โœญ 16 (-69.23%)
Mutual labels:  consensus, tendermint
raftor
Distributed chat system built with rust
Stars: โœญ 31 (-40.38%)
Mutual labels:  consensus
cbc-casper-js
JS implementation of Vlad Zamfir's CBC Casper TFG
Stars: โœญ 21 (-59.62%)
Mutual labels:  consensus
cosmospy
Python tools for Cosmos wallet management and offline transaction signing
Stars: โœญ 57 (+9.62%)
Mutual labels:  tendermint
Raft-Paxos-Sample
MIT6.824ๅฎž็Žฐๅˆ†ๅธƒๅผไธ€่‡ดๆ€ง็ฎ—ๆณ•โ€”โ€”Raft&Paxos
Stars: โœญ 37 (-28.85%)
Mutual labels:  consensus
regen-ledger
Blockchain for planetary regeneration
Stars: โœญ 154 (+196.15%)
Mutual labels:  tendermint
numerifides
A proposal for a system of decentralized trust, built on an open, public blockchain.
Stars: โœญ 14 (-73.08%)
Mutual labels:  consensus
distributed-compliance-ledger
DCL is a public permissioned ledger framework for Zigbee compliance certification of device models. The ledger is based on Cosmos SDK and Tendermint.
Stars: โœญ 41 (-21.15%)
Mutual labels:  tendermint
mintscan-binance-dex-frontend
Mintscan Frontend for Binance DEX
Stars: โœญ 21 (-59.62%)
Mutual labels:  tendermint
nimbus
Upgradeable consensus framework for Substrate blockchains and parachains
Stars: โœญ 31 (-40.38%)
Mutual labels:  consensus
Motoro
Smart contracts for decentralized rentals of vehicles.
Stars: โœญ 96 (+84.62%)
Mutual labels:  consensus
pyrrha-consensus
Core set of Ethereum contracts for Pandora Boxchain functioning
Stars: โœญ 25 (-51.92%)
Mutual labels:  consensus
abci server
An application that allows writing ABCI servers.
Stars: โœญ 35 (-32.69%)
Mutual labels:  tendermint
little-raft
The lightest distributed consensus library. Run your own replicated state machine! โค๏ธ
Stars: โœญ 316 (+507.69%)
Mutual labels:  consensus
xrpl-dev-portal
Source code for xrpl.org including developer documentation
Stars: โœญ 330 (+534.62%)
Mutual labels:  consensus

Lightchain

This is the official Lightstreams implementation of a proof-of-authority (PoA) blockchain. Lightchain is an ethereum-compatible blockchain which uses byzantine consensus to replace the original proof-of-work (PoW) from Ethereum. This is achieved by integrating tendermint for the consensus layer.

Disclosures and Disclaimer

https://docs.lightstreams.network/products/lightchain/disclosures-and-disclaimer

About Lightstreams

We are currently working hard to release the Lightstreams main network which aims to provide a fast, privacy-enabled, content-sharing blockchain. Stay tuned about our project's progress by reading the lightstreams blog or by checking out the Lightstreams' website.

Documentation

You can find more detailed documentation in the lightchain CLI reference documentation.

Pre-requirements

Installation

To install lightchain in your system just run following commands:

mkdir -p ${GOPATH}/src/github.com/lightstreams-network
cd ${GOPATH}/src/github.com/lightstreams-network
git clone https://github.com/lightstreams-network/lightchain.git ./lightchain
cd ./lightchain
make get_vendor_deps
make install

Note: --> dep ensure can take some time.

To validate if you installation was done correctly, run the following command to obtain current installed version of Lightchain

lightchain version

It should output something like this

Version: 1.0.0-beta Mainnet

Create a Lightstreams node

Lightstreams provides its own MainNet network, and a testnet called sirius. By default, all new created nodes get connected to MainNet and synchronized, but alternatively you can choose to connect to sirius or even run isolate network using standalone, more information is detailed above.

Node initialization

To initialise a new node you need to run lightchain init. The local path where blockchain files are going to be stored is set to ${HOME}/.lightchain. You can change using the --datadir flag

lightchain init

Node launch

To run a lightchain node you only need to run the following command:

lightchain run

After you run the command above, the network synchronization will take several minutes, so grab a coffee while you wait :)

Node launch with RPC open

Note: running Lightchain node with RPC open can be dangerous due to same reasons like when using Geth!

To run a lightchain node with RPC open, you only need to append the RPC flags as in Geth, final command:

lightchain run --datadir="${HOME}/.lightchain" --rpc --rpcaddr=0.0.0.0 --rpcport=8545 --rpcapi eth,net,web3,personal,admin

Networks

Mainnet

To see the current state of the MainNet network and check the status of your transactions, you can go to the lightstreams block explorer

Sirius

To run a node using sirius network you will need to initialize your node using --sirius flag as follow:

lightchain init --datadir="${HOME}/.lightchain_sirius" --sirius

To see the current state of the sirius network and check the status of your transactions, you can go to the lightstreams block explorer

To request free tokens Please sign up to the Lightstreams Community Forum and follow the instructions in this thread to obtain free tokens to use in our test network Sirius.

Standalone

Standalone mode allows you to create an isolated node for testing proposes. To do it, you can run the following command:

lightchain init --datadir="${HOME}/.lightchain_standalone" --standalone

Using this network you won't need to synchronize to anyone as you a running an independent network where you are the only validator node.

To use this network at the genesis block, the account 0xc916cfe5c83dd4fc3c3b0bf2ec2d4e401782875e has been initialized with 300M Photons. Its passphrase is WelcomeToSirius.

Documentation

When you run lightchain run or lightchain run --help, you will see a list of available flags:

Launches lightchain node and all of its online services including blockchain (Geth) and the consensus (Tendermint).

Usage:
  lightchain run [flags]

Flags:
      --abci_protocol string   socket | grpc (default "socket")
      --datadir string         Data directory for the databases and keystore (default "/home/ggarrido/.lightchain")
  -h, --help                   help for run
      --lvl string             Level of logging (default "info")
      --prometheus             Enable prometheus metrics exporter
      --rpc                    Enable the HTTP-RPC server
      --rpcaddr string         HTTP-RPC server listening interface (default "localhost")
      --rpcapi string          API's offered over the HTTP-RPC interface
      --rpccorsdomain string   Comma separated list of domains from which to accept cross origin requests (browser enforced)
      --rpcport int            HTTP-RPC server listening port (default 8545)
      --rpcvhosts string       Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default "localhost")
      --tmt_p2p_port uint      Tendermint port used to achieve exchange messages across nodes (default 26656)
      --tmt_proxy_port uint    Lightchain RPC port used to receive incoming messages from Tendermint (default 26658)
      --tmt_rpc_port uint      Tendermint RPC port used to receive incoming messages from Lightchain (default 26657)
      --trace                  Whenever to be asserting and reporting blockchain state in real-time (testing, debugging purposes)
      --tracelog string        The filepath to a log file where all tracing output will be persisted (default "/tmp/tracer.log")
      --ws                     Enable the WS-RPC server
      --wsaddr string          WS-RPC server listening interface (default "localhost")
      --wsport int             WS-RPC server listening port (default 8546)

If you want to know more about how to use lightchain command line client, see our online documentation

Metrics

Read how to run metrics explorer

Troubleshooting

Corrupted Database state

If you node is displaying the following error message:

Nonce not strictly increasing. Expected YYYY got XXXX engine=consensus module=ABCI

That was likely caused due to an synchronization issue after a transaction was executed from your local node. Due to that connection problem the local state becomes invalid and the nonce of account used to performes that transaction stays behind the real one.

We have an open issue to resolve this problem

In meanwhile our team resolve the issue #70, there is an alternative solution:

  • Shut down your node
  • Remove the memory state saved on $rm ${DATADIR}/database/transactions.rlp
  • Start the node again lightchain run...

Applications

Leth

Lightstreams created a command line application called leth to run and manage a lightstreams node, as well as interact with the Lightstreams network

Leth wraps geth & ipfs into a simple, easy-to-use interface and which connects to the Lightstreams network. For convenience, we provide an HTTP gateway API or you can also use the command line client

Docker

In case you prefer to use Docker, follow the instructions below.

First, create a new docker image, which will be tagged as lightchain:latest

make docker

or in case you prefer to fetch the latest version published on AWS, tagged as lightchain:latest-aws

make docker_aws

Once that is completed, you just need to run the following command which will create your container with a running instance of lightchain.

export HOST_DATADIR=${HOME}/.lightchain_docker

docker run -v "${HOST_DATADIR}:/srv/lightchain" \
	-e "NETWORK=sirius" \
	-p 8545:8545 -p 26657:26657 -p 26656:26656 \
	-it lightchain:latest

Where ${HOST_DATADIR} is the path in the host disk to persist lightchain data. In case a volume is not used the node data will be lost after the container is closed.

Alternatively to sirius, as NETWORK, you can also choose mainnet and standalone.

As you can see several ports has been mapped to your local environment:

  • 8545 which exposes the rpc api of Ethereum
geth attach http://localhost:8545
  • 26657 websocket api of tendermint
curl -X http://localhost:26657/status
  • 26656 required by the consensus engine (Tendermint) for p2p communications

Project data structure

โ”œโ”€โ”€ consensus
โ”‚   โ”œโ”€โ”€ config
โ”‚   โ”‚   โ”œโ”€โ”€ config.toml
โ”‚   โ”‚   โ”œโ”€โ”€ genesis.json
โ”‚   โ”‚   โ”œโ”€โ”€ node_key.json
โ”‚   โ”‚   โ””โ”€โ”€ priv_validator.json
โ”‚   โ””โ”€โ”€ data
โ””โ”€โ”€ database
    โ”œโ”€โ”€ chaindb
    โ”‚   โ”œโ”€โ”€ 000001.log
    โ”‚   โ”œโ”€โ”€ CURRENT
    โ”‚   โ”œโ”€โ”€ LOCK
    โ”‚   โ”œโ”€โ”€ LOG
    โ”‚   โ””โ”€โ”€ MANIFEST-000000
    โ”œโ”€โ”€ genesis.json
    โ””โ”€โ”€ keystore
        โ”œโ”€โ”€ UTC--2018-08-26T21-40-07.289727986Z--4eaaad8ea38d5ef75ebdeb3d1be59d56f86c4ca9
        โ””โ”€โ”€ UTC--2018-08-26T21-40-31.689362077Z--4f5adedca6d869e9f5f7dcf4b7a9dfa8231a095f

Lightchain datadir is split into two main folder:

  1. consensus: contains all the information regarding consensus
  2. database: contains all files related to the Ethereum-compatible blockchain

Wiki

To know more about how Lightchain works and how Tendermint is integrated to perform the PoA, visit our repository wiki

Tests

Running Web3 tests verifying blockchain functionalities

Read how to run Web3 tests

Running Tracer asserting blockchain internals, state, DB

Read how to run the Tracer

Running Unit Tests

go test ./...

Credit & Licenses

Bugs, Issues, Questions

If you find any bugs or simply have a question, please write an issue and we'll try and help as best we can.

Help

Need help? have questions? any feedback? Get in touch with us.

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].