perun-stellar-backend

module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0

README

Perun

Perun Stellar backend

This repository contains the Stellar backend for the go-perun channel library. It provides the necessary components to run our secure peer-to-peer Perun Payment Channels on the Stellar blockchain, using a Soroban smart contract implementation. The payment channel implementation connects our Perun state machine with the Perun contract, which implements the Perun Payment Channel logic on the Stellar blockchain. To connect to the Stellar blockchain, we use the Horizon client service of the Stellar Go SDK, which is located here.

This project is financed through the Stellar Community Fund grants program.

In the following sections, we will describe how to run our Payment Channels on a local instance of the Stellar blockchain.

Setup

  1. Clone this repository:
git clone https://github.com/perun-network/perun-stellar-backend
cd perun-stellar-backend
  1. Running the payment channel unit tests:

To run the unit tests only, you can use the following command:


go test ./...
  1. Running the payment channel tests, including the integration tests:

The integration tests require running a local Stellar blockchain, a Horizon client and a Soroban RPC server. The binaries are packaged in a docker image.

To install the docker image, you need to download and build it first, using the build.sh script in testdata/docker:

./testdata/docker/build.sh

Now you can run the docker image with

./quickstart.sh standalone

The initialization takes a few seconds. Afterwards, you can run the tests using the following command:


go test -tags=integration ./...

Note that this backend is customized to run on a local Stellar blockchain (standalone), but can be easily adapted to run on a public blockchain.

Payment Channel Demo

A demonstrator of Perun payment channels on the Stellar blockchain can be found here.

Copyright 2024 PolyCrypt GmbH. Use of the source code is governed by the Apache 2.0 license that can be found in the LICENSE file.

Directories

Path Synopsis
Package channel contains all relevant components to generate, utilize and conclude payment channels on the Stellar blockchain.
Package channel contains all relevant components to generate, utilize and conclude payment channels on the Stellar blockchain.
env
Package env provides the functionality to connect to the Stellar blockchain and broadcast transactions to the network and decode its response.
Package env provides the functionality to connect to the Stellar blockchain and broadcast transactions to the network and decode its response.
types
Package types defines the stellar asset that is used in payment channels.
Package types defines the stellar asset that is used in payment channels.
Package wallet provides the necessary components to use Stellar accounts for Perun payment channels.
Package wallet provides the necessary components to use Stellar accounts for Perun payment channels.
Package wire enables communication between go-perun and the Stellar blockchain.
Package wire enables communication between go-perun and the Stellar blockchain.

Jump to

Keyboard shortcuts

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