Skip to content

Commit

Permalink
chore: Update license headers
Browse files Browse the repository at this point in the history
feat(README): Add more info to the readme

Signed-off-by: Sophia Koehler <[email protected]>
  • Loading branch information
sophia1ch committed Oct 30, 2024
1 parent 8ef824f commit 41cc8aa
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 9 deletions.
15 changes: 11 additions & 4 deletions payment-channel-cc/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<h2 align="center">Perun Stellar Example</h2>
<h2 align="center">Perun Cross Contract Example</h2>

This example shows how to set up a payment channel on Stellar, which utilizes the [go-perun](https://github.com/perun-network/go-perun) channel library, and also the [Stellar payment channel backend](https://github.com/perun-network/perun-stellar-backend).
This example shows how to set up a payment channel on Stellar and Ethereum, which utilizes the [go-perun](https://github.com/perun-network/go-perun) channel library, and also the [Ethereum payment channel backend](https://github.com/perun-network/perun-eth-backend) and the [Stellar payment channel backend](https://github.com/perun-network/perun-stellar-backend).

# Setup

Navigate to the payment-channel-cc directory and run the following commands to install the dependencies.

```sh
go mod tidy
go mod vendor
```
Spin up the local Stellar blockchain, serving as a local testnet for demonstration purposes.

```sh
Expand All @@ -12,7 +18,7 @@ Spin up the local Stellar blockchain, serving as a local testnet for demonstrati

This will start the Stellar, Horizon and Soroban nodes in the background. This is the platform on which we deploy the Stellar Asset Contract (SAC), and the Perun Payment Channel contract. This allows us to create and utilize L2 channels on Stellar for any customized Stellar asset tokens.

Install [ganache-cli](https://github.com/trufflesuite/ganache-cli) and run
Install [ganache-cli](https://github.com/trufflesuite/ganache-cli) and open a new terminal to run
```sh
KEY_DEPLOYER=0x79ea8f62d97bc0591a4224c1725fca6b00de5b2cea286fe2e0bb35c5e76be46e
KEY_ALICE=0x1af2e950272dd403de7a5760d41c6e44d92b6d02797e51810795ff03cc2cda4f
Expand All @@ -21,6 +27,7 @@ BALANCE=100000000000000000000

ganache -h 127.0.0.1 --port 8545 --wallet.accounts $KEY_DEPLOYER,$BALANCE $KEY_ALICE,$BALANCE $KEY_BOB,$BALANCE -b 5
```
This starts a local ganache node with three prefunded accounts. The first account is used to deploy the contract, and the other two are used as Alice and Bob in the example.

# Using the example

Expand All @@ -30,4 +37,4 @@ You can start the demo by simply running
go run .
```

The accounts for Alice and Bob used in the example are generated randomly and funded at the initialization stage of the demo.
The stellar accounts for Alice and Bob used in the example are generated randomly and funded at the initialization stage of the demo.
14 changes: 14 additions & 0 deletions payment-channel-cc/client/channel.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2024 PolyCrypt GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package client

import (
Expand Down
2 changes: 1 addition & 1 deletion payment-channel-cc/client/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 PolyCrypt GmbH
// Copyright 2024 PolyCrypt GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion payment-channel-cc/client/handle.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 PolyCrypt GmbH
// Copyright 2024 PolyCrypt GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion payment-channel-cc/client/util.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 PolyCrypt GmbH
// Copyright 2024 PolyCrypt GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion payment-channel-cc/ethereumUtil/util.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 PolyCrypt GmbH
// Copyright 2024 PolyCrypt GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion payment-channel-cc/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 PolyCrypt GmbH
// Copyright 2024 PolyCrypt GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions payment-channel-cc/stellarUtil/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package stellarUtil

import (
Expand Down

0 comments on commit 41cc8aa

Please sign in to comment.