The official Golang implementation of the OKChain protocol.
Overview - Homepage
OKChain is a high-performance public distributed multi-chain platform and a private, secure, decentralised digital currency.
Privacy: OKChain uses a cryptographically sound system to allow you to send and receive funds without your transactions being easily revealed on the blockchain (the ledger of transactions that everyone has). This ensures that your purchases, receipts, and all transfers remain absolutely private by default.
Security: Using the power of a distributed peer-to-peer consensus network, every transaction on the network is cryptographically secured. Individual wallets have a 25 word mnemonic seed that is only displayed once, and can be written down to backup the wallet. Wallet files are encrypted with a passphrase to ensure they are useless if stolen.
This is the core implementation of OKChain. It is open source and completely free to use without restrictions, except for those specified in the license agreement below. There are no restrictions on anyone creating an alternative implementation of OKChain that uses the protocol and network in a compatible manner.
- Sharding, including network and transaction sharding
- PoW or VRSF for joining the network
- BLS-pbft consensus mechanism
- Coinbase rewards
- Ecc-p256 signature and public address
- Supporting ethereum smart contracts
- Gossip protocol
- Node recovery mechanism
Operating System | Processor | Status |
---|---|---|
Ubuntu 16.04 | amd64 | Supported |
OSX 10.13 | amd64 | Supported |
Centos 7 | amd64 | Supported |
Windows 10 | amd64 | 2019 Q2 |
The following table summarizes the tools and libraries required to build. A
few of the libraries are also included in this repository (marked as
"Vendored"). By default, the build uses the library installed on the system,
and ignores the vendored sources. However, if no library is found installed on
the system, then the vendored source will be built and used. The vendored
sources are also used for statically-linked builds because distribution
packages often include only shared library binaries (.so
) but not static
library archives (.a
).
Dep | Min. version | Vendored | Debian/Ubuntu pkg | Arch pkg | Fedora | Optional |
---|---|---|---|---|---|---|
RocksDB | 5.10.4 | NO | build-essential |
base-devel |
gcc |
NO |
BLS | NO | NO | llvm libgmp-dev libssl-dev |
NO | g++ |
NO |
Upgrade your gcc to version at least 4.8 to get C++11 support.
-
Install Dependencies
apt-get update apt-get -y install build-essential libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev gcc
-
Install rocksdb
wget https://github.com/facebook/rocksdb/archive/v5.10.4.zip unzip rocksdb-5.10.4.zip cd rocksdb-5.10.4 make shared_lib && make install-shared
-
Install Dependencies
yum -y install epel-release && yum -y update yum -y install gflags-devel snappy-devel zlib-devel bzip2-devel gcc-c++ libstdc++-devel
-
Install rocksdb
wget https://github.com/facebook/rocksdb/archive/v5.10.4.zip unzip rocksdb-5.10.4.zip cd rocksdb-5.10.4 make shared_lib && make install-shared
-
Install Dependencies
brew install gcc gflags lz4 snappy
-
Install rocksdb
wget https://github.com/facebook/rocksdb/archive/v5.10.4.zip unzip rocksdb-5.10.4.zip cd rocksdb-5.10.4 make shared_lib && make install-shared
-
Install Dependencies
apt-get update apt-get -y install llvm g++ libgmp-dev libssl-dev echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile
-
Install BLS
To install from source, you can run the following commands:
git clone https://github.com/dfinity/bn cd bn make && make install export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
The library is then installed under /usr/local/
.
- To use it for the current session:
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
- To use it permanently, add
/usr/local/lib
to/etc/ld.so.conf
, then runldconfig
as root
-
Install Dependencies
brew install llvm gmp g++ openssl echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile
-
Install BLS
To install from source, you can run the following commands:
git clone https://github.com/dfinity/bn cd bn make && make install export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
git clone https://github.com/ok-chain/okchain
cd okchain
mkdir -p build/bin
cd cmd/okchaind
GOBIN=${GOPATH}/src/github.com/ok-chain/okchain/build/bin go install
cd cmd/okchaincli
GOBIN=${GOPATH}/src/github.com/ok-chain/okchain/build/bin go install
Note: okchaind
is the OKChain daemon program. And OKChaincli
is a command-line tool to interacte with the OKChaind
.
The build places the binary in bin/
sub-directory within the build directory
from which make was invoked (repository root by default). To run in
foreground:
./okchaind
To run in background:
./okchaind --detach
-
Docker quick start
docker run -d --name okchain/testnet-okchaind -v /okchain/chain:/root/.okchain \ -p 15000:15000 -p 16000:16000 -p 25000:25000 \ okchaind
-
Startup a local testnet
cd dev/docker docker-compose up -d
- Web: okcoin.com/chain
- Forum: forum.okchain.org
- Mail: [email protected]
- GitHub: https://github.com/ok-chain/okchain
Anyone is welcome to contribute to OKChain's codebase! If you have a fix or code change, feel free to submit it as a pull request directly to the "master" branch. In cases where the change is relatively small or does not affect other parts of the codebase it may be merged in immediately by any one of the collaborators. On the other hand, if the change is particularly large or complex, it is expected that it will be discussed at length either well in advance of the pull request being submitted, or even directly on the pull request.
If you want to help out, see CONTRIBUTING for a set of guidelines.
Packaging for your favorite distribution would be a welcome contribution!
Copyright (c) 2018-2019 The OKChain Project.
More details, See LICENSE.