- Install and Start Docker and Docker-Compose
- Clone this repository:
git clone https://github.com/dancodery/algorand-state-channels.git
- Change directory to the cloned repository:
cd algorand-state-channels
- Generate .env file:
touch .env
- Start the Algorand Sandbox:
./sandbox up -v
- Build and start the Algorand State Channel Nodes:
docker-compose up -d --build asc-alice asc-bob
- Run the Payment Channel Demo Script:
./docker_payment_channel_demo.sh --config_file=testbed/experiment1.conf
- You can change the commands in
docker_payment_channel_demo.sh
to run different actions on the payment channel nodes. - You can read the logs by running
docker-compose logs asc-alice
ordocker-compose logs asc-bob
. - You can run cli commands on the payment channel nodes directly by running
docker exec -it asc-alice ascli -h
ordocker exec -it asc-bob ascli -h
. - You can inspect the blockchain by visiting https://app.dappflow.org/explorer/home in your browser and select the Algorand Sandbox network.
- python3.11 -m venv venv_algorand_state_channels
- source venv_algorand_state_channels/bin/activate
- pip3 install -r requirements.txt
- python3 example_usage.py
- docker-compose stop asc-alice
- docker-compose rm -f asc-alice
- docker-compose up -d --build asc-alice
... - docker-compose logs asc-alice
docker exec -it asc-alice bash
docker exec -it asc-bob bash
- docker-compose up [--remove-orphans] [-d] [--build] [container_name] ----> Creates and starts all containers defined in docker-compose.yml, [--remove-orphans] removes ophaned containers, [-d] runs in detached mode, [--build] builds images before starting containers
- docker-compose down ----> Stops and removes all containers, images and networks defined in docker-compose.yml
- docker-compose start ----> Starts any stopped container defined in docker-compose.yml
- docker-compose stop ----> Stops any running container defined in docker-compose.yml
- docker-compose pause ----> Pauses any running container defined in docker-compose.yml
- docker-compose unpause ----> Unpauses any paused container defined in docker-compose.yml
- docker-compose ps ----> Lists all containers that are running
- docker-compose logs [-f] [container_name] ----> Shows the logs of all containers, [-f] follows log output, [container_name] shows logs of specific container
This implementation has taken the following resources for assistance: https://github.com/lightningnetwork/lnd by Olaoluwa Osuntokun at Lightning Labs and https://github.com/lnbook/lnbook by Andreas M. Antonopoulos, Olaoluwa Osuntokun and Rene Pickhardt.
Intended use for educational purposes only.