Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change testnet3 to testnet and add endpoint #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions auction/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2GUmKbVsuc1NSj28pa1WTQuZaK5f1DQJAT6vPcHyWokG

ENDPOINT=https://api.explorer.aleo.org/v1
9 changes: 6 additions & 3 deletions auction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ Swap in the private key and address of the first bidder to `.env`.

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env
```

Expand All @@ -100,8 +101,9 @@ Swap in the private key of the second bidder to `.env`.

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env
```

Expand All @@ -119,8 +121,9 @@ Swap in the private key of the auctioneer to `.env`.

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2GUmKbVsuc1NSj28pa1WTQuZaK5f1DQJAT6vPcHyWokG
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env
```

Expand Down
18 changes: 12 additions & 6 deletions auction/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,19 @@ Let's take the role of the first bidder - we'll swap in the private key and addr
We're going to run the transition function "place_bid", slotting in the first bidder's public address and the amount that is being bid. The inputs are the user's public address and the amount being bid.

echo '
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
' > .env

leo run place_bid aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px 10u64
"

# Swap in the private key of the first bidder to .env.
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

# Have the first bidder place a bid of 10.
Expand All @@ -78,17 +80,19 @@ echo "
Now we're going to place another bid as the second bidder, so let's switch our keys to the second bidder and run the same transition function, this time with the second bidder's keys, public address, and different amount.

echo '
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
ENDPOINT=https://api.explorer.aleo.org/v1
' > .env

leo run place_bid aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t 90u64
"

# Swap in the private key of the second bidder to .env.
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

# Have the second bidder place a bid of 90.
Expand All @@ -112,8 +116,9 @@ echo "
Now, let's take the role of the auctioneer, so we can determine which bid wins. Let's swap our keys to the auctioneer and run the resolve command on the output of the two bids from before. The resolve command takes the two output records from the bids as inputs and compares them to determine which bid wins.

echo '
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2GUmKbVsuc1NSj28pa1WTQuZaK5f1DQJAT6vPcHyWokG
ENDPOINT=https://api.explorer.aleo.org/v1
' > .env

leo run resolve '{
Expand All @@ -133,8 +138,9 @@ leo run resolve '{

# Swaps in the private key of the auctioneer to .env.
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2GUmKbVsuc1NSj28pa1WTQuZaK5f1DQJAT6vPcHyWokG
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

# Have the auctioneer select the winning bid.
Expand Down
4 changes: 2 additions & 2 deletions basic_bank/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1

9 changes: 6 additions & 3 deletions basic_bank/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ Let's make some bank transactions. We'll take the role of the bank and issue 100

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

leo run issue aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t 100u64
Expand All @@ -84,8 +85,9 @@ Now, let's have the user deposit 50 of their tokens with the bank. We'll take th

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

leo run deposit "{
Expand All @@ -109,8 +111,9 @@ Now, let's have the bank withdraw all tokens after 15 periods. Let's switch to t

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

leo run withdraw aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t 50u64 1234u64 15u64
Expand Down
18 changes: 12 additions & 6 deletions basic_bank/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ echo "
Let's make some bank transactions. We'll take the role of the bank and issue 100 tokens to the user. We swap the private key into .env and run the issue transition function. The inputs are simply the recipient of the issuance and the amount.

echo '
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
' > .env

leo run issue aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t 100u64
"

# Swap in the private key of the bank to .env.
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

# Have the bank issue 100 tokens to the user.
Expand Down Expand Up @@ -83,8 +85,9 @@ echo "
Now, let's have the user deposit 50 of their tokens with the bank. We'll take the role of the user and call the deposit function, having the user use the output record that was issued to them by the bank. The inputs are the output record from the issue transition and the amount the user wishes to deposit.

echo '
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
ENDPOINT=https://api.explorer.aleo.org/v1
' > .env

leo run deposit '{
Expand All @@ -96,8 +99,9 @@ leo run deposit '{

# Swap in the private key of the user to .env.
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

# Have the user deposit 50 tokens into the bank.
Expand Down Expand Up @@ -199,17 +203,19 @@ echo "
Now, let's have the bank withdraw all tokens after 15 periods. Let's switch to the bank role, and call the withdraw transition function. The inputs are the recipient's address, amount, rate, and periods.

echo '
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
' > .env

leo run withdraw aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t 50u64 1234u64 15u64

"
# Swap in the private key of the bank to .env.
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

# Have the bank withdraw all of the user's tokens with compound interest over 15 periods at 12.34%.
Expand Down
5 changes: 2 additions & 3 deletions battleship/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH

ENDPOINT=https://api.explorer.aleo.org/v1
18 changes: 12 additions & 6 deletions battleship/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ With Player 1's private key, they initialize the board with the placement of 4 s

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

leo run initialize_board 34084860461056u64 551911718912u64 7u64 1157425104234217472u64 aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t
Expand Down Expand Up @@ -156,8 +157,9 @@ We switch our .env to Player 2's private key and similarly run initialize_board

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

leo run initialize_board 31u64 2207646875648u64 224u64 9042383626829824u64 aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px
Expand Down Expand Up @@ -248,8 +250,9 @@ We switch the .env back to Player 1, and we run the transition function play.

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

leo run play "{
Expand Down Expand Up @@ -304,8 +307,9 @@ We switch the .env back to Player 2, and we run the transition function play.

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

leo run play "{
Expand Down Expand Up @@ -365,8 +369,9 @@ We switch the .env back to Player 1, and we run the transition function play.

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

leo run play "{
Expand Down Expand Up @@ -433,8 +438,9 @@ We switch the .env back to Player 2, and we run the transition function play.

```bash
echo "
NETWORK=testnet3
NETWORK=testnet
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
ENDPOINT=https://api.explorer.aleo.org/v1
" > .env

leo run play "{
Expand Down
Loading