Skip to content

Docs fix spelling issues #35

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

Open
wants to merge 9 commits into
base: main
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ layout:

***

Phala Network make trustless available and affordable for all developers.
Phala Network makes trustless available and affordable for all developers.

Phala Network is a next-generation **cloud platform** that provides a **low-cost, user-friendly trustless environment**, making zero-trust computing accessible to a broad range of developers. By leveraging a **hybrid infrastructure** including Trusted Execution Environments (TEEs), blockchain, Multi-Party Computation (MPC), and Zero-Knowledge Proof (ZKP), Phala delivers flexible, open-source, and affordable **verification** solutions for any developer, in any type of program.

Expand Down
4 changes: 2 additions & 2 deletions agent-wars-legacy/agent-war-tokenomics.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ We introduce a one-time payment process for agent creation where all tokens will

### You own the X account

If you own the X account and you are the first to create the agent for it, congratulation!
If you own the X account and you are the first to create the agent for it, congratulations!

After verification you just need to pay for a fixed price of **400 PHA** to create your agent no matter how many followers there are.

Expand Down Expand Up @@ -50,7 +50,7 @@ Even if you are not the agent creator, you can still benefit from agent getting

The price of agent key increases with the increasing supply of the keys. The more buyers there are, the higher the price will become. The key selling income will go to agent creator, and 10% will be taken as trading fee.

Everyone is free to buy a unlimited number of keys of a certain agent. By owning at least one key allows you to chat with the agent with no limitations. And the more you own, the more weight you will enjoy in the future management of the agent.
Everyone is free to buy an unlimited number of keys of a certain agent. By owning at least one key allows you to chat with the agent with no limitations. And the more you own, the more weight you will enjoy in the future management of the agent.

Both buy and sell price follow the curve of

Expand Down
4 changes: 2 additions & 2 deletions agent-wars-legacy/getting-started/buy-and-sell-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ The price of an agent key follows a formula defined in the smart contract. The k
| 500 | 2974 | 446.10 |
| 1000 | 4009 | 601.35 |

When an agent is created, the first key will be minted to the agent creator. Once created, anyone can buy and sell keys at any time, following the bonding curve. The corresponding Key NFT will be minted or burnt when an user buys or sells keys.
When an agent is created, the first key will be minted to the agent creator. Once created, anyone can buy and sell keys at any time, following the bonding curve. The corresponding Key NFT will be minted or burnt when a user buys or sells keys.

{% hint style="info" %}
The bonding curve is defined based on PHA token. The table above shows the corresponding USD value assuming PHA is at $0.15.

The smart contract supports buying and selling in ETH or other token. When using tokens other than PHA, it automatically uses Uniswap v3 on Base to swap against PHA. For example, when buying keys with ETH, the smart contract will receive ETH from the user, and instantly swap to the corresponding PHA based on the bonding curve.

Swapping is based on Uniswap. So the process may subject to additional trading fee, price fluctuation, and potential MEV risk.
Swapping is based on Uniswap. So the process may be subject to additional trading fee, price fluctuation, and potential MEV risk.
{% endhint %}

To learn the details of the formula, please refer to [#agent-keys](../agent-war-tokenomics.md#agent-keys "mention").
4 changes: 2 additions & 2 deletions agent-wars-legacy/getting-started/wallet-setup-and-get-pha.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wallet Setup & Get PHA

Agent Wars is deployed on the [Base chain](https://www.base.org/), a popular high performance Ethereum L2 built by Coinbase. You will need to have two tokens to participate:
Agent Wars is deployed on the [Base chain](https://www.base.org/), a popular high-performance Ethereum L2 built by Coinbase. You will need to have two tokens to participate:

* **ETH**: needed to pay the gas fee on Base
* **PHA**: used to buy keys and create agents
Expand Down Expand Up @@ -55,7 +55,7 @@ PHA is bridged from Ethereum to Base chain via [Wormhole](https://wormhole.com/)

Note that the bridging operation between Ethereum and Base takes around 15 mins. To get PHA on Ethereum, you can buy it from centralized exchanges (Binance, OKX, Kucoin, etc), and decentralized exchanges (Uniswap, 1inch, etc).

If you closed the web page after finishing the transfer step but haven't claimed it on the destination blockchain, you can use the "Redeem" tab in the Portal Bridge (Advanced Tool). You will need to find the tx id of your transfering tx from a blockchain explorer. The redeem tool will recover the transaction and guide you to redeem the PHA on the destination chain. Learn more at [their official docs](https://portalbridge.com/docs/tutorials/how-to-use-recovery-workflow).
If you closed the web page after finishing the transfer step but haven't claimed it on the destination blockchain, you can use the "Redeem" tab in the Portal Bridge (Advanced Tool). You will need to find the tx id of your transferring tx from a blockchain explorer. The redeem tool will recover the transaction and guide you to redeem the PHA on the destination chain. Learn more at [their official docs](https://portalbridge.com/docs/tutorials/how-to-use-recovery-workflow).

</details>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default async function main(request: string) {

For the `getLocation()` function, we will need to call an API to get the location based on [https://ipapi.co/](https://ipapi.co/). Traditionally, devs will not have access to the internet, but with Phala's AI Agent Contracts, devs now can make async HTTP calls to bring more data for fine tuning their agents.&#x20;

The implementation is simple and we will add this following code.
The implementation is simple and we will add the following code.

```typescript
async function getLocation() {
Expand Down Expand Up @@ -311,7 +311,7 @@ If we don't see a `finish_reason: "stop"` within our five iterations, we'll retu

## Update GET() and POST()

Now we need to call our `agent(openai, userInput)` in our `GET` and `POST` calls that will pass in a users prompt that can be accessed in the `chatQuery` property. The code change is minimial and our functions look like the following.
Now we need to call our `agent(openai, userInput)` in our `GET` and `POST` calls that will pass in a user's prompt that can be accessed in the `chatQuery` property. The code change is minimial and our functions look like the following.

```typescript
async function GET(req: Request): Promise<Response> {
Expand Down
4 changes: 2 additions & 2 deletions compute-providers/basic-info/worker-rewards.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Each individual’s $$V$$ is updated at every block:

When a worker gets a payout $$w(V_t)$$, they will receive the amount immediately in their Phala wallet. The payout follows _**Payout Schedule**_ and cannot exceed the _**Subsidy Budget**_.

Finally, once the worker decides to stop mining, they will wait for a Cooling Down period $\delta$. They will receive an one-time final payout after the cooldown.
Finally, once the worker decides to stop mining, they will wait for a Cooling Down period $\delta$. They will receive a one-time final payout after the cooldown.

| Block number | $t$ | $t+1$ | $\dots$ | $T$ | $\dots$ | $T+\delta$ |
| ------------- | ------------ | ------------- | ------- | ------------ | ------------------------------- | ------------------------ |
Expand Down Expand Up @@ -181,7 +181,7 @@ $$
\text{share}_{\text{Baseline}} = V_t.
$$

$$\Sigma \text{share}$$ contains the share of workers which are running on Phala or Khala with the same subsidy ratio.
$$\Sigma \text{share}$$ contains the share of workers who are running on Phala or Khala with the same subsidy ratio.

Proposed algorithm:

Expand Down
2 changes: 1 addition & 1 deletion compute-providers/gatekeeper/collator.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Call `collatorSelection.setInvulnerables(list)`, where `list` is the full list o

## Apply for a public collator <a href="#apply-for-a-public-collator" id="apply-for-a-public-collator"></a>

To become a public collator, you will need to put a fixed amount of the deposit. The deposit can be found at `collatorSelection.candidacyBond()`. Up to a certain number of the public collators are allowed (the genesis collators are not included). The number can be found at `collatorSelection.desiredCandidates()`, and the current candidates can be found at `collatorSelection.candidates()`. As of writing, the bond is 1000 PHA, and the desired candidate number is 12.
To become a public collator, you will need to put in a fixed amount of the deposit. The deposit can be found at `collatorSelection.candidacyBond()`. Up to a certain number of the public collators are allowed (the genesis collators are not included). The number can be found at `collatorSelection.desiredCandidates()`, and the current candidates can be found at `collatorSelection.candidates()`. As of writing, the bond is 1000 PHA, and the desired candidate number is 12.

After the collator account and the node is setup correctly, submit a proposal by calling `collatorSelection.registerAsCandidate()` from the account. Once it’s submitted, you will need to wait for two sessions to become a collator.

Expand Down
8 changes: 4 additions & 4 deletions compute-providers/gatekeeper/gatekeeper.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ To set up a Gatekeeper, you should follow the steps below:
2. Prepare a server with proper Intel SGX support
3. Deploy a worker stack: full node, pherry, and pRuntime
4. Make a council proposal to add the worker to the Gatekeeper list
5. Finally, you Gatkeeper should be up and running. As the opereator, you should keep monitoring.
5. Finally, your Gatkeeper should be up and running. As the operator, you should keep monitoring.

## Prepare the Gatekeeper operator account <a href="#prepare-the-gatekeeper-operator-account" id="prepare-the-gatekeeper-operator-account"></a>

To operate a Gatekeeper, an account with some PHA balance is required. The Gatekeeper program runs by pruntime in Secure Enclaves. It communicates with the blockchain in two directions. It reads the events from the blockchain, runs the algorithm, and periodically writes back to the blockchain by sending transactions. An account with some balances is used to pay the transaction fee.

You may already have an account. Or you can create the account on Polkadot.js Extension, or some other wallets. In either way, you will need to keep the mnemonic (sometimes called SURI), or the raw private key, because it will be used in the next step.

It’s suggested to have at least 10 PHA in the account. The Gatekeepers may consume the transacion fee in different speed. It can burn up to 5-10 PHA per day, but can also have nearly zero transaction per day. Gatekeepers generate messages constantly, but only the first one who submits the message will be charged (other transactions are just de-duped). So theoritically each Gatekeeper has an even chance to pay for the transaction fee.
It’s suggested to have at least 10 PHA in the account. The Gatekeepers may consume the transaction fee in different speed. It can burn up to 5-10 PHA per day, but can also have nearly zero transaction per day. Gatekeepers generate messages constantly, but only the first one who submits the message will be charged (other transactions are just de-duped). So theoretically each Gatekeeper has an even chance to pay for the transaction fee.

## Server requirements <a href="#server-requirements" id="server-requirements"></a>

Expand All @@ -28,7 +28,7 @@ It’s suggested to have at least 10 PHA in the account. The Gatekeepers may con
A bandwidth of 50 Mbps or faster is recommended. Otherwise the initial block download will take a very long time. A public IP address is recommended because otherwise you may got too few peer connections, causing the full node got stuck for some period. A stable network is always required. Once Gatekeeper online detection is on, any detected offline event may cause significant slash. (So far it’s still under the development.)
3. Intel SGX compatible hardware with a confidence level >= 3

Gatekeeper runs its pRuntime inside the Secure Encalve (Intel SGX), which is the same requirement of mining on Khala Network. Please refer to the mining guide to learn more about Intel SGX compatability and the confidence score. Gatekeepers manage highly sensitive data. Therefore it requires the highest confidence level (1, 2, or 3).
Gatekeeper runs its pRuntime inside the Secure Encalve (Intel SGX), which is the same requirement of mining on Khala Network. Please refer to the mining guide to learn more about Intel SGX compatibility and the confidence score. Gatekeepers manage highly sensitive data. Therefore it requires the highest confidence level (1, 2, or 3).

Although SGX is a feature in CPU, some configuration in BIOS is still needed. Please refer to the mining guide to tune the BIOS when necessary.
4. Linux OS
Expand All @@ -40,7 +40,7 @@ It’s suggested to have at least 10 PHA in the account. The Gatekeepers may con

## **SGX virtualization (vSGX)**

vSGX is supported. VMWare and KVM based vSGX are being tested successfully. However, the more instances to virtualize, the less EPC size each VM can get. Smaller EPC can cause a decrease of the performance. Please use with caution.
vSGX is supported. VMWare and KVM based vSGX are being tested successfully. However, the more instances to virtualize, the less EPC size each VM can get. Smaller EPC can cause a decrease in the performance. Please use it with caution.

## Deploy the full stack <a href="#deploy-the-full-stack" id="deploy-the-full-stack"></a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

Before you go further, please ensure that your have correct setup your hardware, BIOS and operating system according to the previous section.
Before you go further, please ensure that you have correctly setup your hardware, BIOS and operating system according to the previous section.

## Download the Khala Scripts <a href="#download-the-phala-scripts" id="download-the-phala-scripts"></a>

Expand Down