diff --git a/payment-channel-cc/README.md b/payment-channel-cc/README.md index 8605ef5..0d50f93 100644 --- a/payment-channel-cc/README.md +++ b/payment-channel-cc/README.md @@ -1,9 +1,15 @@ -

Perun Stellar Example

+

Perun Cross Contract Example

-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 @@ -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 @@ -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 @@ -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. \ No newline at end of file +The stellar accounts for Alice and Bob used in the example are generated randomly and funded at the initialization stage of the demo. \ No newline at end of file diff --git a/payment-channel-cc/client/channel.go b/payment-channel-cc/client/channel.go index aea563a..ed90f43 100644 --- a/payment-channel-cc/client/channel.go +++ b/payment-channel-cc/client/channel.go @@ -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 ( diff --git a/payment-channel-cc/client/client.go b/payment-channel-cc/client/client.go index 01afc0e..060f955 100644 --- a/payment-channel-cc/client/client.go +++ b/payment-channel-cc/client/client.go @@ -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. diff --git a/payment-channel-cc/client/handle.go b/payment-channel-cc/client/handle.go index c44beb6..0330655 100644 --- a/payment-channel-cc/client/handle.go +++ b/payment-channel-cc/client/handle.go @@ -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. diff --git a/payment-channel-cc/client/util.go b/payment-channel-cc/client/util.go index 7c4b8aa..7671140 100644 --- a/payment-channel-cc/client/util.go +++ b/payment-channel-cc/client/util.go @@ -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. diff --git a/payment-channel-cc/ethereumUtil/util.go b/payment-channel-cc/ethereumUtil/util.go index 42f76bc..d984f4b 100644 --- a/payment-channel-cc/ethereumUtil/util.go +++ b/payment-channel-cc/ethereumUtil/util.go @@ -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. diff --git a/payment-channel-cc/main.go b/payment-channel-cc/main.go index 5c7e035..d11cc4b 100644 --- a/payment-channel-cc/main.go +++ b/payment-channel-cc/main.go @@ -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. diff --git a/payment-channel-cc/stellarUtil/token.go b/payment-channel-cc/stellarUtil/token.go index 4e163a4..d42ef87 100644 --- a/payment-channel-cc/stellarUtil/token.go +++ b/payment-channel-cc/stellarUtil/token.go @@ -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 (