Skip to content

An implementation of the Giskard consensus protocol for distributed transactions and computations.

License

Notifications You must be signed in to change notification settings

lnsandn01/sawtooth-giskard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Practical analysis of the Giskard Consensus Protocol

This repository is an implementation of the Giskard Consensus Protocol. The Giskard consensus protocol is used to validate transactions and computations in the PlatON network and tolerates Byzantine failures among participating nodes. This implementation integrates the protocol into the blockchain-framework Hyperledger Sawtooth, for testing its safety and liveness property.

Quicklinks

Installation

System Requirements

This library is developed on and intended for systems running:

If you do not want to install Ubuntu onto your computer, consider installing a virtual machine

Installation Steps

  1. Install Sawtooth Hyperledger with the poet consensus engine
  • sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8AA7AF1F1091A5FD

  • sudo add-apt-repository 'deb [arch=amd64] http://repo.sawtooth.me/ubuntu/chime/stable bionic universe'

  • sudo apt-get update

  • sudo apt-get install -y sawtooth python3-sawtooth-poet-cli python3-sawtooth-poet-engine python3-sawtooth-poet-families

  1. Download this repository to /home/repos/

    • cd /home
    • mkdir repos
    • cd repos
    • git clone [email protected]:lnsandn01/sawtooth-giskard.git
  2. Install tools and dependencies

  • sudo apt-get install -y python3-pip

  • sudo apt-get install -y python3-nose2

  • sudo cp -a /mnt/c/repos/sawtooth-giskard/common/requirements.txt /usr/lib/python3/dist-packages /sawtooth_poet_common/

  • cd /usr/lib/python3/dist-packages/sawtooth_poet_common/

  • pip3 install -r requirements.txt

  1. Replace the files in your local sawtooth install with my code
sudo mkdir packaging

sudo cp -a sawtooth-giskard/engine/sawtooth_poet_engine/{engine.py,giskard.py,giskard_block.py,main.py,giskard_global_state.py,giskard_global_trace.py,giskard_message.py,giskard_node.py,giskard_nstate.py,giskard_state_transition_type.py,oracle.py} /usr/lib/python3/dist-packages/sawtooth_poet_engine/

sudo cp -a sawtooth-giskard/tests/sawtooth_poet_tests/ /usr/lib/python3/dist-packages/

sudo cp -a sawtooth-giskard/core/sawtooth_poet/journal/block_wrapper.py /usr/lib/python3/dist-packages/sawtooth_poet/journal/

sudo cp -a sawtooth-giskard/simulator/packaging/simulator_rk_pub.pem /usr/lib/python3/dist-packages/sawtooth_poet_simulator/packaging/


sudo cp -a sawtooth-giskard/sawtooth-sdk-python/sawtooth_sdk/consensus/ /usr/lib/python3/dist-packages/sawtooth_sdk/

sudo cp -a sawtooth-giskard/sawtooth-sdk-python/sawtooth_sdk/messaging/  /usr/lib/python3/dist-packages/sawtooth_sdk/


sudo cp -a sawtooth-giskard/sawtooth-core/validator/sawtooth_validator/consensus/notifier.py /usr/lib/python3/dist-packages/sawtooth_validator/consensus/

sudo cp -a sawtooth-giskard/sawtooth-core/validator/sawtooth_validator/networking/dispatch.py /usr/lib/python3/dist-packages/sawtooth_validator/networking/

Running the Tests

cd /usr/lib/python3/dist-packages/

sudo nose2-3 \
-c sawtooth_poet_tests/nose2.cfg \
-v \
-s \
sawtooth_poet_tests/ \
test_giskard_network.TestGiskardNetwork.test_giskard_network 

Edit the test variables in the file /usr/lib/python3/dist-packages/sawtooth_poet_tests/test_giskard_network.py in the function test_giskard_network to test different behaviour of the Giskard protocol in different situations: dishonest_nodes(possible_values:0-4) or timeout_test(possible_values:0-4).

Before running the test again, or to stop the test:

ps ax | grep 'sawtooth-validator' | awk -F ' ' '{print $1}' | xargs sudo kill -9
sudo pkill poet
sudo pkill intkey
ps ax | grep 'settings-tp' | awk -F ' ' '{print $1}' | xargs sudo kill -9
sudo pkill sawtooth

About

An implementation of the Giskard consensus protocol for distributed transactions and computations.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •