stamhe / Phoenix-Chain-Core

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Phoenix Chain Core

Golang implementation of the Phoenix Chain protocol.

Welcome to the Phoenix-Chain-Core source code repository! The Phoenix Chain protocol is based on Ethereum and Tendermint. It has a high-performance consensus mechanism,which is a hybrid of DPOS and PBFT.

Building the source

  • install golang 1.16+
wget https://dl.google.com/go/go1.17.7.linux-amd64.tar.gz
tar -zxf go1.17.7.linux-amd64.tar.gz -C /usr/local
vi /etc/profile

paste the following to /etc/profile:

#golang env config
export GO111MODULE=on
export GOROOT=/usr/local/go
export GOPATH=/home/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

then

cd /home 
mkdir gopath
source /etc/profile
  • install libraries

for ubuntu:

sudo apt install libgmp-dev libssl-dev

for centos:

yum install -y gmp-devel openssl-devel
  • build
make all
sudo cp -f ./build/bin/phoenixkey /usr/bin/
sudo cp -f ./build/bin/phoenixchain /usr/bin/

Starting up your node to connect to the Phoenix Chain network

mkdir data
cd data
  • generate keys
phoenixkey genkeypair | tee >(grep "PrivateKey" | awk '{print $2}' > ./nodekey) >(grep "PublicKey" | awk '{print $3}' > ./nodeid) && phoenixkey genblskeypair | tee >(grep "PrivateKey" | awk '{print $2}' > ./blskey) >(grep "PublicKey" | awk '{print $3}' > ./blspub)
  • generate a wallet
phoenixchain --datadir ./ account new --name "{wallet-name}"
  • run node
cd ..
nohup phoenixchain --identity "phoenix" --datadir ./data --port 16789 --rpcaddr 0.0.0.0 --rpcport 6789 --rpcapi "phoenixchain,net,web3,admin,personal" --rpc --nodekey ./data/nodekey --pbft.blskey ./data/blskey > ./data/phoenix.log 2>&1 &
  • check node
phoenixchain attach http://localhost:6789 --exec phoenixchain.blockNumber

License

The Phoenix-Chain-Core library (i.e. all code outside of the commands directory) is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the COPYING.LESSER file.

The Phoenix-Chain-Core binaries (i.e. all code inside of the commands directory) is licensed under the GNU General Public License v3.0, also included in our repository in the COPYING file.

About

License:GNU Lesser General Public License v3.0


Languages

Language:Go 43.2%Language:Assembly 40.0%Language:C++ 10.5%Language:C 3.5%Language:JavaScript 1.8%Language:Makefile 0.2%Language:Java 0.1%Language:Sage 0.1%Language:M4 0.1%Language:NSIS 0.1%Language:Solidity 0.1%Language:HTML 0.1%Language:CMake 0.0%Language:Python 0.0%Language:Shell 0.0%Language:Batchfile 0.0%Language:Ruby 0.0%Language:Dockerfile 0.0%