Skip to content

Commit

Permalink
Merge pull request #8 from AlgoRealm/cli-refactor
Browse files Browse the repository at this point in the history
Cli refactor
  • Loading branch information
cusma authored Dec 5, 2022
2 parents e4bb40e + 1d238e4 commit ca74063
Show file tree
Hide file tree
Showing 11 changed files with 1,372 additions and 882 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# AlgoRealm artifacts
*.gtxn
60 changes: 30 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ When nothing but Entropy was there.
Then came the cryptographic Proof,
And took it care.
Verifiability of randomness,
Verifiability of Randomness,
Since genesis block,
Brings Consensus over realm vastness,
So Algorand never fork.
So Algorand shall not fork.
```

## Become a Majesty of Algorand
Expand All @@ -30,6 +30,10 @@ The more generous you are, the harder will be to be dethroned.

Join [AlgoRealm channel](https://t.me/algorealm)!

## Play with AlgoRealm CLI Web Emulator

Play [AlgoRealm on CLI web emulator](https://algorealm.vercel.app/console) by [@aorumbayev](https://github.com/aorumbayev).

## Play with AlgoRealm CLI


Expand Down Expand Up @@ -59,32 +63,34 @@ AlgoRealm, only generous heart will ever rule over Algorand. (by cusma)

Usage:
algorealm.py poem
algorealm.py dynasty
algorealm.py dynasty [--test]
algorealm.py claim-majesty (--crown | --sceptre) <majesty-name> <microalgos> [--test]
algorealm.py claim-card
algorealm.py buy-order <microalgos> [--notify]
algorealm.py verify-order <seller-address>
algorealm.py claim-crown <mnemonic> <majesty-name> <microalgos>
algorealm.py claim-sceptre <mnemonic> <majesty-name> <microalgos>
algorealm.py claim-card <mnemonic>
algorealm.py buy-order <mnemonic> <microalgos> [--notify]
algorealm.py sell-card <mnemonic>
algorealm.py sell-card
algorealm.py [--help]

Commands:
poem AlgoRealm's poem.
dynasty Print the glorious dynasty of AlgoRealm's Majesties.
verify-order Verify the partially signed AlgoRealm Card buy order.
claim-crown Claim the Crown of Entropy, become the Randomic Majesty of Algorand.
claim-sceptre Claim the Sceptre of Proof, become the Verifiable Majesty of Algorand.
claim-majesty Claim the Crown of Entropy or the Sceptre of Proof, become Majesty of Algorand.
claim-card Brake the spell and claim the AlgoRealm Card by AlgoWorld.
buy-order Place an order for the AlgoRealm Card.
verify-order Verify the partially signed AlgoRealm Card buy order.
sell-card Sell the AlgoRealm Card (paying a 10% royalty).

Options:
-n --notify Notify the Seller about your buy order on-chain.
-h --help
-n, --notify Notify the Seller about your buy order on-chain.
-t, --test TestNet mode
-h, --help
```

⚠️ Keep your `<mnemonic>` safe! Although you will only use it on you local machine, is it strongly recommended to make use of a dedicated account just to play AlgoRealm!

> In case you want to give a try, you can play AlgoRealm on TestNet adding `-t`
> to CLI commands.
### 3. AlgoRealm Dynasty

Who are the Majesties of the Algorand realm?
Expand Down Expand Up @@ -140,14 +146,10 @@ on Block: 14989913 donating: 4 microALGOs to the Rewards Pool.
Chose your `<majesty-name>` and become part of the Dynasty! Remember that to dethrone the current Majesties you must donate to the Algorand's Rewards Pool more `<microalgos>` than the last donation.

```shell
$ python3 algorealm.py claim-crown <mnemonic> <majesty-name> <microalgos>
$ python3 claim-majesty (--crown | --sceptre) <majesty-name> <microalgos> [--test]
```

```shell
$ python3 algorealm.py claim-sceptre <mnemonic> <majesty-name> <microalgos>
```

⚠️ Enter the the `<mnemonic>` formatting it as: `"word_1 word_2 word_3 ... word_25"` and keep it safe!
⚠️ Enter the the `mnemonic` formatting it as: `"word_1 word_2 word_3 ... word_25"` and keep it safe!

### 5. Claim the AlgoRealm Special Card

Expand All @@ -162,24 +164,24 @@ Only the generous heart of the [Great Majesty of Algorand](https://github.com/cu
The AlgoRealm Card can be claimed **starting from block 16,250,000** using the command `claim-card`: hold strong both the Crown and the Sceptre and keep the throne until there!

```shell
$ python3 algorealm.py claim-card <mnemonic>
$ python3 algorealm.py claim-card [--test]
```

⚠️ Enter the the `<mnemonic>` formatting it as: `"word_1 word_2 word_3 ... word_25"` and keep it safe!
⚠️ Enter the the `mnemonic` formatting it as: `"word_1 word_2 word_3 ... word_25"` and keep it safe!

### 6. Place a buy-order

As a **Buyer** you can easily place a **buy-order** proposal to the **Seller** using the `buy-order` command. You just need to choose the `<microalgos>` amount for the buy order proposal.

Using the `--notify` option the **Seller** will receive a notification on-chain, being acknowledge about the new buy-order proposal.
Using the `--notify` option the **Seller** will receive a notification on-chain, being acknowledged about the new buy-order proposal.

```shell
$ python3 algorealm.py buy-order <mnemonic> <microalgos> [--notify]
$ python3 algorealm.py buy-order <microalgos> [--notify] [--test]
```

⚠️ Enter the the `<mnemonic>` formatting it as: `"word_1 word_2 word_3 ... word_25"` and keep it safe!
⚠️ Enter the the `mnemonic` formatting it as: `"word_1 word_2 word_3 ... word_25"` and keep it safe!

As result, a *Partially Signed Trade Group Transaction* is created as `trade.gtx` file in the `algorealm.py` CLI directory. Note that there is **no counter-party risk** in this operation: as a **Buyer** you can safely send the `trade.gtxn` file to the **Seller**, being sure that the trade will be executed **if and only if** the Seller will transfers the AlgoRealm Special Card to you.
As result, a *Partially Signed Trade Group Transaction* is created as `trade.gtx` file in the `algorealm.py` CLI directory. Note that there is **no counter-party risk** in this operation: as a **Buyer** you can safely send the `trade.gtxn` file to the **Seller**, being sure that the trade will be executed **if and only if** the Seller will transfer the AlgoRealm Special Card to you.

### 7. Verify a buy-order

Expand All @@ -188,7 +190,7 @@ As a **Seller** you can review and verify the buy-order proposal, validating the
The `verify-order` command requires your `<seller-address>` as argument.

```shell
$ python3 algorealm.py verify-order <seller-address>
$ python3 algorealm.py verify-order <seller-address>
```

Some compliancy checks are performed over the `trade.gtx` file before displaying the buy-order summary:
Expand All @@ -213,11 +215,10 @@ If you agree with the buy-order proposal you can sell the AlgoRealm Special Card
As a **Seller**, if you agree with the buy-order proposal, you can sell your AlgoRealm Special Card using the command `sell-card`.

```shell
$ python3 algorealm.py sell-card <mnemonic>
$ python3 algorealm.py sell-card [--test]
```

⚠️ Enter the the `<mnemonic>` formatting it as: `"word_1 word_2 word_3 ... word_25"` and keep it safe!

⚠️ Enter the the `mnemonic` formatting it as: `"word_1 word_2 word_3 ... word_25"` and keep it safe!


## Play with goal CLI
Expand Down Expand Up @@ -355,7 +356,6 @@ Here you find the [AlgoRealm slide deck](https://docs.google.com/presentation/d/

Join [AlgoRealm channel](https://t.me/algorealm)!


## ⭐️ Stargazers

Special thanks to everyone who forked or starred the repository ❤️
Expand Down
Loading

0 comments on commit ca74063

Please sign in to comment.