fractal

module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2020 License: LGPL-3.0

README

Fractal

go version for fractal blockchain

master dev
TravisCI TravisCI

Build Steps

  1. make your own go env, set $GOPATH, and add $GOPATH/bin to PATH env

    cd ~
    mkdir -p go/bin go/src
    export GOPATH=~/go
    export PATH=$PATH:$GOPATH/bin
    
  2. clone source

    cd $GOPATH/src
    git clone git@github.com:fractal-platform/fractal.git github.com/fractal-platform/fractal
    
  3. build

    cd $GOPATH/src/github.com/fractal-platform/fractal
    go install -v -ldflags "-X main.gitCommit=$(git log --pretty=format:'%h' -1)" ./cmd/gftl/  
    go install -v -ldflags "-X main.gitCommit=$(git log --pretty=format:'%h' -1)" ./cmd/gtool/
    sudo cp transaction/txec/libwasmlib.dylib /usr/local/lib/
    

Running Fractal blockchain

Setup Basic Test Environment

  1. Setup keys&genesis

    cd ~
    mkdir test
    gtool keys --keys data1/keys --pass 666 newkeys
    gtool keys --keys data2/keys --pass 666 newkeys
    address1=$(gtool keys --keys data1/keys --pass 666 list | grep "Account Key" | awk -F: '{print $2}')
    gtool gstate --pass 666 --packerKeyOwner $address1 gen
    
  2. Setup the first node

    cd ~/test
    cp $GOPATH/src/fractal/cmd/gftl/test.toml .
    gftl --config test.toml --genesisAlloc genesis_alloc.json --rpc --rpcport 8545 --datadir data1 --port 30303 --pprof --pprofport 6060 --verbosity 3 --mine --packer --unlock 666
    
  3. Setup the second node, start a new terminal and exec:

    cd ~/test
    enode1=$(gtool admin --rpc http://127.0.0.1:8545 enode)
    gftl --config test.toml --genesisAlloc genesis_alloc.json --rpc --rpcport 8546 --datadir data2 --port 30304 --pprof --pprofport 6061 --verbosity 3 --mine --packer --unlock 666 --bootnodes $enode1  
    
  4. Test, start a new terminal and exec:

cd ~/test
address1=$(gtool keys --keys data1/keys --pass 666 list | grep "Account Key" | awk -F: '{print $2}')
address2=$(gtool keys --keys data2/keys --pass 666 list | grep "Account Key" | awk -F: '{print $2}')
gtool tx --rpc http://127.0.0.1:8545 --to $address2 --chainid 999 --keys data1/keys --pass 666 send

Setup Packer

  1. Add(Modify) a Packer

    cd ~/test
    cp $GOPATH/src/fractal/cmd/gftl/packer_keys.abi .
    address1=$(gtool keys --keys data1/keys --pass 666 list | grep "Account Key" | awk -F: '{print $2}')
    packerpubkey1=$(gtool keys --keys data1/keys --pass 666 list | grep "Packer Public Key" | awk -F: '{print $2}')
    gtool packer --rpc http://127.0.0.1:8545 --chainid 999 --keys data1/keys --pass 666 --abi packer_keys.abi --packerId 0 --packerAddress http://127.0.0.1:8545 --packerCoinbase $address1 --packerPubKey $packerpubkey1 setPacker
    
  2. Send transaction

    cd ~/test
    address1=$(gtool keys --keys data1/keys --pass 666 list | grep "Account Key" | awk -F: '{print $2}')
    address2=$(gtool keys --keys data2/keys --pass 666 list | grep "Account Key" | awk -F: '{print $2}')
    gtool tx --rpc http://127.0.0.1:8545 --to $address2 --chainid 999 --keys data1/keys --pass 666 --packer send
    

Directories

Path Synopsis
Package chain contains implementations for basic chain operations.
Package chain contains implementations for basic chain operations.
cmd
gtool
gtool implements the cmd tools for gftl
gtool implements the cmd tools for gftl
utils
Package utils contains internal helper functions for go-fractal commands.
Package utils contains internal helper functions for go-fractal commands.
Package common contains various helper functions.
Package common contains various helper functions.
bitutil
Package bitutil implements fast bitwise operations.
Package bitutil implements fast bitwise operations.
hexutil
Package hexutil implements hex encoding with 0x prefix.
Package hexutil implements hex encoding with 0x prefix.
math
Package math provides integer math utilities.
Package math provides integer math utilities.
mclock
Package mclock is a wrapper for a monotonic clock source
Package mclock is a wrapper for a monotonic clock source
core
config
Package config contains the normal config for other modules.
Package config contains the normal config for other modules.
types
Package types contains data types related to Fractal consensus.
Package types contains data types related to Fractal consensus.
secp256k1
Package secp256k1 wraps the bitcoin secp256k1 C library.
Package secp256k1 wraps the bitcoin secp256k1 C library.
sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
ftl
api
Fractal implements the Fractal full node service.
Fractal implements the Fractal full node service.
network
Package network contains the implementation of network protocol handler for fractal.
Package network contains the implementation of network protocol handler for fractal.
protocol
Package network contains the implementation of network protocol handler for fractal.
Package network contains the implementation of network protocol handler for fractal.
sync
sync cp2fp contains the implementation of fractal sync checkpoint to fixpoint.
sync cp2fp contains the implementation of fractal sync checkpoint to fixpoint.
Package miner contains implementations for block mining strategy.
Package miner contains implementations for block mining strategy.
p2p
Package p2p implements the Ethereum p2p network protocols.
Package p2p implements the Ethereum p2p network protocols.
discover
Package discover implements the Node Discovery Protocol.
Package discover implements the Node Discovery Protocol.
enr
Package enr implements Ethereum Node Records as defined in EIP-778.
Package enr implements Ethereum Node Records as defined in EIP-778.
nat
Package nat provides access to common network port mapping protocols.
Package nat provides access to common network port mapping protocols.
netutil
Package netutil contains extensions to the net package.
Package netutil contains extensions to the net package.
tx_collector
Package tx_collector contains the implementation of tx collector for packer.
Package tx_collector contains the implementation of tx collector for packer.
Package rlp implements the RLP serialization format.
Package rlp implements the RLP serialization format.
rpc
Package rpc contains defines for rpc server and client.
Package rpc contains defines for rpc server and client.
client
Package rpcclient contains implementations for net rpc client.
Package rpcclient contains implementations for net rpc client.
server
Package rpcserver contains implementations for net rpc server.
Package rpcserver contains implementations for net rpc server.
txexec
Package txexec implements all transaction executors.
Package txexec implements all transaction executors.
Package trie implements Merkle Patricia Tries.
Package trie implements Merkle Patricia Tries.
log
Package types contains log utils for fractal project.
Package types contains log utils for fractal project.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL