perun-polkadot-backend

module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0

README


Perun

Perun Polkadot: Backend

CI status

This project implements a Substrate backend for our go-perun framework. It enables go-perun applications to create state-channels on Polkadot by connecting to the Perun Pallet.

Project structure

  • channel/ channel interface implementations
  • wallet/ wallet interface implementations
    • sr25519/ Schnorrkel-Ristretto Ed25519 wallet
  • pkg/ 3rd-party helpers
  • client/ helper functions for setting up a go-perun client
  • wallet/sr25519/test/accounts.json config for testing

Development Setup

If you want to locally develop with this project:

  1. Clone the repo:
git clone https://github.com/perun-network/perun-polkadot-backend
cd perun-polkadot-backend
  1. Start a local Substrate node with the Perun Pallet installed. See the polkadot node repository for more details.
docker run --rm -p 9944:9944 ghcr.io/perun-network/polkadot-test-node
  1. Run the tests. This step needs a working Go distribution, see go.mod for the required version.
go test -p 1 ./...

The tests take a while but should eventually finish successfully. The long testing time results from the block-time of the node. The -p 1 flag is important, since the tests otherwise are started in parallel and mess up the account nonce.

Demo

We prepared a demo CLI node to play around with payment channels on substrate chains.
Highly recommended you to check it out 👍

Funding

The development of this project is supported by the Web3 Foundation through the Grants Program.
The development of the go-perun library is supported by the German Ministry of Education and Science (BMBF) through a Startup Secure grant.

Security Disclaimer

This software is still under development. The authors take no responsibility for any loss of digital assets or other damage caused by the use of it.

Copyright 2022 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 the Polkadot channel backend implementation.
Package channel contains the Polkadot channel backend implementation.
pallet
Package pallet implements functions to interact with a Perun pallet.
Package pallet implements functions to interact with a Perun pallet.
pallet/test
Package test provides helper and setup functions to test the pallet package.
Package test provides helper and setup functions to test the pallet package.
test
Package test provides helper and setup functions to test the channel package.
Package test provides helper and setup functions to test the channel package.
Package client contains end-to-end tests.
Package client contains end-to-end tests.
pkg
Package pkg implements helpers for 3rd party libraries.
Package pkg implements helpers for 3rd party libraries.
sr25519
Package sr25519 provides helper functions for the go-schnorrkel library.
Package sr25519 provides helper functions for the go-schnorrkel library.
substrate
Package substrate provides reusable functions for interacting with a substrate node.
Package substrate provides reusable functions for interacting with a substrate node.
substrate/test
Package test provides helper and setup functions to test the substrate package.
Package test provides helper and setup functions to test the substrate package.
Package wallet implements the go-perun Wallet interface for substrate.
Package wallet implements the go-perun Wallet interface for substrate.
sr25519
Package sr25519 implements go-perun's wallet interface for the polkadot backend.
Package sr25519 implements go-perun's wallet interface for the polkadot backend.
sr25519/test
Package test provides helper and setup functions to test the sr25519 wallet.
Package test provides helper and setup functions to test the sr25519 wallet.

Jump to

Keyboard shortcuts

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