From 0a49c7b927daa7da24df4aaaf93bdfdd29dd8701 Mon Sep 17 00:00:00 2001 From: Colin Lowenberg Date: Thu, 3 Jun 2021 18:43:15 +0000 Subject: [PATCH] GitBook: [docs-2.0] 38 pages modified --- README.md | 22 +- SUMMARY.md | 43 +- cli/akash.md | 43 - .../design.md | 21 +- {design => decentralized-cloud}/escrow.md | 0 .../general-commands.md | 34 +- .../marketplace.md | 23 +- {design => decentralized-cloud}/mtls.md | 0 {documentation => decentralized-cloud}/sdl.md | 0 design/faq.md | 55 - documentation/faq.md | 2 +- {guides => guides-1}/akashnet-relayer.md | 0 guides-1/awesome-akash.md | 120 ++ guides-1/helium-validator.md | 69 + {guides => guides-1}/multi-tier-app.md | 4 +- guides-1/postgresql-restore-backup.md | 68 + guides-1/ruby-on-rails-with-sia-and-auth0.md | 93 ++ guides/akashnet-2-software-upgrade.md | 88 -- guides/deploy-tool.md | 855 ------------ guides/deploy.md | 4 +- guides/deploy/README.md | 1212 ----------------- guides/guides.md | 8 +- guides/upgrade-mainnet.md | 179 --- .../README.md => providers/provider.md | 159 ++- {guides/node => validators}/validator.md | 4 +- 25 files changed, 533 insertions(+), 2573 deletions(-) delete mode 100644 cli/akash.md rename design/README.md => decentralized-cloud/design.md (64%) rename {design => decentralized-cloud}/escrow.md (100%) rename {guides => decentralized-cloud}/general-commands.md (91%) rename {design => decentralized-cloud}/marketplace.md (84%) rename {design => decentralized-cloud}/mtls.md (100%) rename {documentation => decentralized-cloud}/sdl.md (100%) delete mode 100644 design/faq.md rename {guides => guides-1}/akashnet-relayer.md (100%) create mode 100644 guides-1/awesome-akash.md create mode 100644 guides-1/helium-validator.md rename {guides => guides-1}/multi-tier-app.md (97%) create mode 100644 guides-1/postgresql-restore-backup.md create mode 100644 guides-1/ruby-on-rails-with-sia-and-auth0.md delete mode 100644 guides/akashnet-2-software-upgrade.md delete mode 100644 guides/deploy-tool.md delete mode 100644 guides/deploy/README.md delete mode 100644 guides/upgrade-mainnet.md rename guides/provider/README.md => providers/provider.md (84%) rename {guides/node => validators}/validator.md (98%) diff --git a/README.md b/README.md index a0c5c8d8..c38bc7be 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Introduction -Welcome to the documentation and user guides for [Akash](https://github.com/ovrclk/akash), the decentralized cloud platform. Akash -- "open space, sky" in ancient Sanskrit -- is the world’s first distributed peer-to-peer open cloud computing marketplace; our aim is to materialize the vision of an open cloud that’s as boundless and free as the sky. +Welcome to the support documentation and user guides for [Akash](https://github.com/ovrclk/akash), the decentralized cloud platform. Akash -- "open space, sky" in ancient Sanskrit -- is the world’s first distributed peer-to-peer open cloud computing marketplace; our aim is to materialize the vision of an open cloud that’s as boundless and free as the sky. -For details about what [Akash](https://github.com/ovrclk/akash) can do and what makes it tick, see [Features and Design](design/). +For details about what [Akash](https://github.com/ovrclk/akash) can do and what makes it tick, see [Features and Design](decentralized-cloud/design.md). ## Guides @@ -15,18 +15,18 @@ For details about what [Akash](https://github.com/ovrclk/akash) can do and what * [Run an Akash Node](guides/node/) * [RPC Service](guides/node/rpc-service.md) * [API Service](guides/node/api-service.md) - * [Run a Validator](guides/node/validator.md) -* [Become a Provider](guides/provider.md) -* [Common Commands](guides/general-commands.md) -* [Upgrade to Akashnet-2](guides/upgrade-mainnet.md) -* [Using the Deploy Tool](guides/deploy-tool.md) -* [Multi-Tiered Deployment](guides/multi-tier-app.md) -* [Software Upgrade: Akashnet-2-upgrade-1](guides/akashnet-2-software-upgrade.md) -* [Akashnet-2 IBC Connections](guides/akashnet-relayer.md) + * [Run a Validator](validators/validator.md) +* [Become a Provider](providers/provider.md) +* [Common Commands](decentralized-cloud/general-commands.md) +* [Upgrade to Akashnet-2]() +* [Using the Deploy Tool]() +* [Multi-Tiered Deployment](guides-1/multi-tier-app.md) +* [Software Upgrade: Akashnet-2-upgrade-1]() +* [Akashnet-2 IBC Connections](guides-1/akashnet-relayer.md) ## Documentation -* [Stack Definition Language](documentation/sdl.md) +* [Stack Definition Language](decentralized-cloud/sdl.md) * [Akash CLI reference](documentation/akash.md) * [FAQ](documentation/faq.md) diff --git a/SUMMARY.md b/SUMMARY.md index 1f99b759..a82cb0a9 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -1,12 +1,17 @@ # Table of contents * [Introduction](README.md) -* [Features and Design](design/README.md) - * [Marketplace](design/marketplace.md) - * [Escrow](design/escrow.md) - * [mTLS](design/mtls.md) -## Guides +## Decentralized Cloud + +* [Marketplace](decentralized-cloud/marketplace.md) +* [Escrow](decentralized-cloud/escrow.md) +* [mTLS](decentralized-cloud/mtls.md) +* [Stack Definition Language](decentralized-cloud/sdl.md) +* [Command Line Interface](decentralized-cloud/general-commands.md) +* [Features](decentralized-cloud/design.md) + +## Getting Started * [Overview](guides/guides.md) * [Choosing a Network](guides/version.md) @@ -17,18 +22,26 @@ * [Run an Akash Node](guides/node/README.md) * [RPC Service](guides/node/rpc-service.md) * [API Service](guides/node/api-service.md) - * [Run a Validator](guides/node/validator.md) -* [Become a Provider](guides/provider.md) -* [Common Commands](guides/general-commands.md) -* [Upgrade to Akashnet-2](guides/upgrade-mainnet.md) -* [Using the Deploy Tool](guides/deploy-tool.md) -* [Multi-Tiered Deployment](guides/multi-tier-app.md) -* [Software Upgrade: Akashnet-2-upgrade-1](guides/akashnet-2-software-upgrade.md) -* [Inter-Blockchain \(IBC\) Connections](guides/akashnet-relayer.md) ## Documentation -* [Stack Definition Language](documentation/sdl.md) * [Akash CLI reference](documentation/akash.md) -* [FAQ](documentation/faq.md) +* [Frequently Asked Questions](documentation/faq.md) + +## Providers + +* [Becoming a Provider](providers/provider.md) + +## Validators + +* [Running a Validator](validators/validator.md) + +## Guides + +* [Awesome Akash](guides-1/awesome-akash.md) +* [Multi-Tiered Deployment](guides-1/multi-tier-app.md) +* [Helium Validator](guides-1/helium-validator.md) +* [PostgreSQL restore/backup](guides-1/postgresql-restore-backup.md) +* [Ruby on Rails with Sia and Auth0](guides-1/ruby-on-rails-with-sia-and-auth0.md) +* [Inter-Blockchain \(IBC\) Connections](guides-1/akashnet-relayer.md) diff --git a/cli/akash.md b/cli/akash.md deleted file mode 100644 index 8b8a2f87..00000000 --- a/cli/akash.md +++ /dev/null @@ -1,43 +0,0 @@ -## akash - -Akash Blockchain Application - -### Synopsis - -Akash CLI Utility. - -Akash is a peer-to-peer marketplace for computing resources and -a deployment platform for heavily distributed applications. -Find out more at https://akash.network - -### Options - -``` - -h, --help help for akash -``` - -### SEE ALSO - -* [akash ](akash_.md) - -* [akash ](akash_.md) - -* [akash add-genesis-account](akash_add-genesis-account.md) - Add a genesis account to genesis.json -* [akash collect-gentxs](akash_collect-gentxs.md) - Collect genesis txs and output a genesis.json file -* [akash debug](akash_debug.md) - Tool for helping with debugging your application -* [akash deploy](akash_deploy.md) - Akash deploy tool commands -* [akash events](akash_events.md) - Prints out akash events in real time -* [akash export](akash_export.md) - Export state to JSON -* [akash gentx](akash_gentx.md) - Generate a genesis tx carrying a self delegation -* [akash init](akash_init.md) - Initialize private validator, p2p, genesis, and application configuration files -* [akash keys](akash_keys.md) - Manage your application's keys -* [akash migrate](akash_migrate.md) - Migrate genesis to a specified target version -* [akash provider](akash_provider.md) - Akash provider commands -* [akash query](akash_query.md) - Querying subcommands -* [akash start](akash_start.md) - Run the full node -* [akash status](akash_status.md) - Query remote node for status -* [akash tendermint](akash_tendermint.md) - Tendermint subcommands -* [akash tx](akash_tx.md) - Transactions subcommands -* [akash unsafe-reset-all](akash_unsafe-reset-all.md) - Resets the blockchain database, removes address book files, and resets data/priv_validator_state.json to the genesis state -* [akash validate-genesis](akash_validate-genesis.md) - validates the genesis file at the default location or at the location passed as an arg -* [akash version](akash_version.md) - Print the application binary version information - -###### Auto generated by spf13/cobra on 18-Feb-2021 diff --git a/design/README.md b/decentralized-cloud/design.md similarity index 64% rename from design/README.md rename to decentralized-cloud/design.md index 0bce80a3..12706972 100644 --- a/design/README.md +++ b/decentralized-cloud/design.md @@ -1,4 +1,4 @@ -# Features and Design +# Features ## Features and Design @@ -9,28 +9,13 @@ The [Akash](https://github.com/ovrclk/akash) DeCloud is comprised of two main co The **Network** is built with [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) - it is a [tendermint](https://github.com/tendermint/tendermint)-based blockchain application. -The **Platform** is a set of [cloud management services](./#provider-services) that leverage [Kubernetes](https://kubernetes.io) to run workloads. +The **Platform** is a set of [cloud management services](design.md#provider-services) that leverage [Kubernetes](https://kubernetes.io) to run workloads. The software to run the **Network**, the **Platform**, and the command-line client used to interact with them are all currently distributed in the `akash` application. ### Workflow - Life of a Deployment -Deploying applications onto [Akash](https://github.com/ovrclk/akash) involves two types of users: -1. The **Tenant**: the entity that deploys the application. -2. The **Provider**: the entity that hosts the application. - -Given that there are live providers on the network, the lifecycle of a typical application deployment is as follows: - -1. The tenant describes their desired deployment in \[SDL\], called a [deployment](marketplace.md#deployment). -2. The tenant submits that definition to the blockchain. -3. Their submission generates an [order](marketplace.md#order) on the marketplace. -4. Providers that would like to fulfill that order [bid](marketplace.md#bid) on it. -5. After some period of time, a winning [bid](marketplace.md#bid) for the [order](marketplace.md#order) is chosen, and a [lease](marketplace.md#lease) is created. -6. Once a [lease](marketplace.md#lease) has been created, the tenant submits a [manifest](../documentation/sdl.md) to the provider. -7. The provider executes workloads as instructed by the [manifest](../documentation/sdl.md). -8. The workload is running - if it is a web application it can be visited, etc... -9. The provider or tenant eventually closes the [lease](marketplace.md#lease), shutting down the workload. ## Features @@ -44,7 +29,7 @@ Tenants define workloads requirements, as well as regional and pricing parameter ### Networking -Networking - allowing connectivity to and between workloads - can be configured via the [SDL](../documentation/sdl.md) for a deployment. +Networking - allowing connectivity to and between workloads - can be configured via the [SDL](sdl.md) for a deployment. By default, workloads in a deployment group are isolated - nothing else is allowed to connect to them. This restriction can be relaxed by enabling diff --git a/design/escrow.md b/decentralized-cloud/escrow.md similarity index 100% rename from design/escrow.md rename to decentralized-cloud/escrow.md diff --git a/guides/general-commands.md b/decentralized-cloud/general-commands.md similarity index 91% rename from guides/general-commands.md rename to decentralized-cloud/general-commands.md index b0a3b8db..45fa3b32 100644 --- a/guides/general-commands.md +++ b/decentralized-cloud/general-commands.md @@ -1,4 +1,36 @@ -# Common Commands +# Command Line Interface + +## The Akash CLI + +The Akash command line utility + +```text + -h, --help help for akash +``` + +## Akash Commands + +* [akash ](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_.md) - +* [akash ](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_.md) - +* [akash add-genesis-account](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_add-genesis-account.md) - Add a genesis account to genesis.json +* [akash collect-gentxs](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_collect-gentxs.md) - Collect genesis txs and output a genesis.json file +* [akash debug](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_debug.md) - Tool for helping with debugging your application +* [akash deploy](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_deploy.md) - Akash deploy tool commands +* [akash events](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_events.md) - Prints out akash events in real time +* [akash export](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_export.md) - Export state to JSON +* [akash gentx](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_gentx.md) - Generate a genesis tx carrying a self delegation +* [akash init](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_init.md) - Initialize private validator, p2p, genesis, and application configuration files +* [akash keys](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_keys.md) - Manage your application's keys +* [akash migrate](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_migrate.md) - Migrate genesis to a specified target version +* [akash provider](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_provider.md) - Akash provider commands +* [akash query](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_query.md) - Querying subcommands +* [akash start](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_start.md) - Run the full node +* [akash status](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_status.md) - Query remote node for status +* [akash tendermint](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_tendermint.md) - Tendermint subcommands +* [akash tx](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_tx.md) - Transactions subcommands +* [akash unsafe-reset-all](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_unsafe-reset-all.md) - Resets the blockchain database, removes address book files, and resets data/priv\_validator\_state.json to the genesis state +* [akash validate-genesis](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_validate-genesis.md) - validates the genesis file at the default location or at the location passed as an arg +* [akash version](https://github.com/ovrclk/docs/tree/ed6bc0143968bc6e4e92c26c5dad6427f048bc2d/cli/akash_version.md) - Print the application binary version information ## Send Tokens diff --git a/design/marketplace.md b/decentralized-cloud/marketplace.md similarity index 84% rename from design/marketplace.md rename to decentralized-cloud/marketplace.md index 550c2c0f..161c7750 100644 --- a/design/marketplace.md +++ b/decentralized-cloud/marketplace.md @@ -1,23 +1,42 @@ # Marketplace +The Akash Marketplace is an auction for compute resources. It is the mechanism by which users acquire resources on the Akash Platform. + * [Overview](marketplace.md#overview) * [Payments](marketplace.md#payments) * [On-Chain Parameters](marketplace.md#on-chain-parameters) * [Transactions](marketplace.md#transactions) * [Models](marketplace.md#models) -The Akash Marketplace is an auction for compute resources. It is the mechanism by which users acquire resources on the Akash Platform. - ## Overview The Akash Marketplace revolves around [Deployments](marketplace.md#deployment), which fully describe the resources that a tenant is requesting from the network. [Deployments](marketplace.md#deployment) contain [Groups](marketplace.md#group), which is a grouping of resources that are meant to be leased together from a single provider. +Deploying applications onto [Akash](https://github.com/ovrclk/akash) involves two types of users: + +1. The **Tenant**: the entity that deploys the application. +2. The **Provider**: the entity that hosts the application. + The general workflow is: 1. A tenant creates orders. 2. Providers bid on orders. 3. Tenants choose winning bids and create leases. +### Lifecycle of a Deployment + +Given that there are live providers on the network, the lifecycle of a typical application deployment is as follows: + +1. The tenant describes their desired deployment in \[SDL\], called a [deployment](marketplace.md#deployment). +2. The tenant submits that definition to the blockchain. +3. Their submission generates an [order](marketplace.md#order) on the marketplace. +4. Providers that would like to fulfill that order [bid](marketplace.md#bid) on it. +5. After some period of time, a winning [bid](marketplace.md#bid) for the [order](marketplace.md#order) is chosen, and a [lease](marketplace.md#lease) is created. +6. Once a [lease](marketplace.md#lease) has been created, the tenant submits a [manifest](sdl.md) to the provider. +7. The provider executes workloads as instructed by the [manifest](sdl.md). +8. The workload is running - if it is a web application it can be visited, etc... +9. The provider or tenant eventually closes the [lease](marketplace.md#lease), shutting down the workload. + ## Payments Leases are paid from deployment owner \(tenant\) to the provider through a deposit & withdraw mechanism. diff --git a/design/mtls.md b/decentralized-cloud/mtls.md similarity index 100% rename from design/mtls.md rename to decentralized-cloud/mtls.md diff --git a/documentation/sdl.md b/decentralized-cloud/sdl.md similarity index 100% rename from documentation/sdl.md rename to decentralized-cloud/sdl.md diff --git a/design/faq.md b/design/faq.md deleted file mode 100644 index 5c90050e..00000000 --- a/design/faq.md +++ /dev/null @@ -1,55 +0,0 @@ -# Frequently Asked Questions (FAQ) - -If there is something you'd like to see in here that isn't already, please reach out (_link to channels_) to one of the mods and we'll get it added! - -### Table of Contents - -[Product](#Product) -[Supermini](#Supermini) - - - - -## Product - -**Can Akash provide Name Server Services?** - -One issue with using name servers is that DNS will be exposed on a random ephemeral port instead of 53. We have plans to add IP addresses as a resource of the lease but it is not available yet. - -**Do I need to redeploy if I want to update the deployment?** - -It depends what you'd like to update. Akash Groups are translated into Kubernetes Deployments, this means that only a few fields from the Akash SDL are mutable. -For example image, command, args, env and exposed ports can be modified, but compute resources and placement criteria cannot. - -**How can I (someone wanting to deploy an application on Akash) be sure that the provider won't/didn't try to modify my application?** - -At this time we don't have secure enclave support. There are some technical limitations to TEE and the like. Our audited attributes system is meant to approach the problem from a different angle. -Why would you trust digital ocean, or aws, or any other cloud provider in the first place? some metric of trust. The audited attributes feature allows you to deploy only to providers that have been "signed off" on by an entity that you have confidence in. - -**Is there also a way to decentralize docker registry? So it would not be a single point of failure, if selected one (centralized) goes down?** - -Yes, this is something we've talked about for a long time but haven't had a chance to dig into much. It could be a bittorrent-style thing or it could be on IPFS, etc... We intend to explore all of this but we're focusing on getting people onto the platform with the assumption that their docker containers are more or less reachable for the time being. - -**Are there plans to add support for persistent volumes?** - -Yes. All storage is ephemeral for now, but we will work on persistent storage in the future. - -**Is there GPU support?** - -It is on the roadmap, however, GPU workloads aren't supported just yet - there are some technical limitations related to GPU sharing and security with our current Kubernetes backend. We are actively working on it. - -**Can Akash be used with private images or do they have to be public?** - -Images need to be publicly accessible at this time. - - - -## Supermini - -**When can I get the Supermini and can it be shipped outside the US?** - -Currently there is no further information about the supermini, its availability in the US and Europe, or dates of availability for subsequent orders. In the meantime, feel free to sign up to the waitlist! https://akash.network/supermini/ - -**How much money can the Supermini make me?** - -The yield from running a Supermini as a provider on the Akash Network will be a function of demand/network usage - meaning it will depend on how many applications are being deployed on the network. We are focused on on building this demand over the coming months. diff --git a/documentation/faq.md b/documentation/faq.md index 9055cc9a..45ed5532 100644 --- a/documentation/faq.md +++ b/documentation/faq.md @@ -1,4 +1,4 @@ -# FAQ +# Frequently Asked Questions If there is something you'd like to see in here that isn't already, please reach out \(_link to channels_\) to one of the mods and we'll get it added! diff --git a/guides/akashnet-relayer.md b/guides-1/akashnet-relayer.md similarity index 100% rename from guides/akashnet-relayer.md rename to guides-1/akashnet-relayer.md diff --git a/guides-1/awesome-akash.md b/guides-1/awesome-akash.md new file mode 100644 index 00000000..43d9b194 --- /dev/null +++ b/guides-1/awesome-akash.md @@ -0,0 +1,120 @@ +# Awesome Akash + +**Repository**: [ovrclk/awesome-akash](https://github.com/ovrclk/awesome-akash) + +Awesome Akash is a curated list of awesome resources people can use to familiarize themselves with [Akash](https://akash.network/) and includes examples of several applications they can deploy on the platform. Please submit a pull request if you know any resources that might be helpful to other developers. + +Instructions on how to deploy the SDL files in this repository can be found [here](https://docs.akash.network/guides/deploy). + +Join our [discord](https://discord.akash.network/) if you have questions or concerns. Our team is always eager to hear from you. Also, follow [@akashnet\_](https://twitter.com/akashnet_) to stay in the loop with updates and announcements. + +## Table of Contents + +### Official + +* [Lunie Wallet for Cosmos SDK](https://github.com/ovrclk/awesome-akash/blob/master/lunie-lite) +* [Cosmos SDK Node](https://github.com/ovrclk/akash-on-akash) + +### DeFi + +Awesome DeFi apps you can deploy on Akash + +* [Serum DEX UI](https://github.com/ovrclk/awesome-akash/blob/master/serum) +* [Uniswap](https://github.com/ovrclk/awesome-akash/blob/master/uniswap) +* [dFed](https://github.com/ovrclk/awesome-akash/blob/master/dfed) +* [Pancake Swap](https://github.com/ovrclk/awesome-akash/blob/master/pancake-swap) +* [Augur](https://github.com/ovrclk/awesome-akash/blob/master/augur) +* [Bancor](https://github.com/ovrclk/awesome-akash/blob/master/Bancor) +* [Balancer](https://github.com/ovrclk/awesome-akash/blob/master/Balancer) +* [Luaswap](https://github.com/ovrclk/awesome-akash/blob/master/luaswap) +* [SushiSwap](https://github.com/ovrclk/awesome-akash/blob/master/sushiswap) +* [Uma Protocol](https://github.com/ovrclk/awesome-akash/blob/master/uma-protocol) +* [Yearn.finance](https://github.com/ovrclk/awesome-akash/blob/master/Yearn.finance) +* [ThorChain BEPSwap](https://github.com/ovrclk/awesome-akash/blob/master/Thorchain-BEPSwap) +* [Curve](https://github.com/ovrclk/awesome-akash/blob/master/curve) +* [Synthetix.Exchange](https://github.com/ovrclk/awesome-akash/blob/master/synthetix.exchange) +* [Ren Protocol](https://github.com/ovrclk/awesome-akash/blob/master/renprotocol) +* [yfii](https://github.com/ovrclk/awesome-akash/blob/master/yfii) + +### Blogging + +* [SteemCN](https://github.com/ovrclk/awesome-akash/blob/master/steemcn) +* [Ghost](https://github.com/ovrclk/awesome-akash/blob/master/ghost) +* [Grav](https://github.com/ovrclk/awesome-akash/blob/master/Grav) +* [Wordpress](https://github.com/ovrclk/awesome-akash/blob/master/wordpress) +* [Confluence](https://github.com/ovrclk/awesome-akash/blob/master/confluence) +* [Drupal](https://github.com/ovrclk/awesome-akash/blob/master/drupal) +* [Wiki.js](https://github.com/ovrclk/awesome-akash/blob/master/wikijs) + +### Games + +* [Tetris](https://github.com/ovrclk/awesome-akash/blob/master/tetris) +* [Pac-Man](https://github.com/ovrclk/awesome-akash/blob/master/pacman) +* [Supermario](https://github.com/ovrclk/awesome-akash/blob/master/supermario) +* [Minesweeper](https://github.com/ovrclk/awesome-akash/blob/master/minesweeper) +* [Tetris2](https://github.com/ovrclk/awesome-akash/blob/master/tetris2) +* [MemoryGame](https://github.com/ovrclk/awesome-akash/blob/master/Memorygame) +* [DOOM](https://github.com/ovrclk/awesome-akash/blob/master/doom) +* [Snake Game](https://github.com/ovrclk/awesome-akash/blob/master/snake-game) + +### Databases and Administration + +* [pgAdmin](https://github.com/ovrclk/awesome-akash/blob/master/pgadmin4) +* [mongoDB](https://github.com/ovrclk/awesome-akash/blob/master/mongoDB) +* [postgresSQL](https://github.com/ovrclk/awesome-akash/blob/master/postgres) +* [adminer](https://github.com/ovrclk/awesome-akash/blob/master/adminer) +* [MySQL](https://github.com/ovrclk/awesome-akash/blob/master/MySQL) +* [CouchDB](https://github.com/ovrclk/awesome-akash/blob/master/couchdb) +* [InfluxDB](https://github.com/ovrclk/awesome-akash/blob/master/influxdb) + +### Hosting + +* [Caddy](https://github.com/ovrclk/awesome-akash/blob/master/caddy) +* [Grafana](https://github.com/ovrclk/awesome-akash/blob/master/grafana) + +### Continuous Integration + +* [Jenkins](https://github.com/ovrclk/awesome-akash/blob/master/jenkins) +* [Bitbucket](https://github.com/ovrclk/awesome-akash/blob/master/bitbucket) + +### Project Management + +* [Jira Software](https://github.com/ovrclk/awesome-akash/blob/master/jira) +* [Redmine](https://github.com/ovrclk/awesome-akash/blob/master/redmine) + +### Tools + +* [DEGO Stats](https://github.com/ovrclk/awesome-akash/blob/master/dego-stats) +* [authsteem](https://github.com/ovrclk/awesome-akash/blob/master/authsteem) +* [microbox](https://github.com/ovrclk/awesome-akash/blob/master/microbox) +* [Mintr](https://github.com/ovrclk/awesome-akash/blob/master/mintr) +* [Folding@home](https://github.com/ovrclk/awesome-akash/blob/master/folding-at-home) +* [owncloud](https://github.com/ovrclk/awesome-akash/blob/master/owncloud) +* [Quill editor](https://github.com/ovrclk/awesome-akash/blob/master/quill-editor) +* [Periodic Table Creator](https://github.com/ovrclk/awesome-akash/blob/master/Periodic-Table-Creator) +* [dart-hello](https://github.com/ovrclk/awesome-akash/blob/master/dart) + +### Wallet + +* [MyetherWallet](https://github.com/ovrclk/awesome-akash/blob/master/MyetherWallet) +* [tronwallet](https://github.com/ovrclk/awesome-akash/blob/master/tronwallet) + +### Built with Cosmos-SDK + +* [Dharani](https://github.com/ovrclk/awesome-akash/blob/master/Dharani) +* [Big Dipper](https://github.com/ovrclk/awesome-akash/blob/master/big-dipper) + +### Media + +* [FreeFlix Nucleus](https://github.com/ovrclk/awesome-akash/blob/master/freeflix-nucleus) + +### Data Visualization + +* [UFO Sightings](https://github.com/ovrclk/awesome-akash/blob/master/ufo-data-vis) + +### Chat + +* [Mattermost](https://github.com/ovrclk/awesome-akash/blob/master/mattermost) + +### Video Conferencing + diff --git a/guides-1/helium-validator.md b/guides-1/helium-validator.md new file mode 100644 index 00000000..5901a80b --- /dev/null +++ b/guides-1/helium-validator.md @@ -0,0 +1,69 @@ +# Helium Validator + + + +**Repository:** [**tombeynon/helium-on-akash**](https://github.com/tombeynon/helium-on-akash)\*\*\*\* + +This repository includes everything needed to run a Helium validator on Akash. The container will connect to an S3 bucket to upload/download the swarm\_key on boot. + +The main files to understand are: + +* `Dockerfile` - Installs AWS CLI on top of the [Helium validator docker image](https://quay.io/team-helium/validator) and sets boot.sh to run whenever the container starts +* `boot.sh` - Downloads the swarm\_key from S3 \(if it exists\), starts the miner and prints the address. It then uploads the swarm\_key if it didn't download it earlier \(new miner\). +* `deploy.yml` - Example/working Akash deployment configuration. This is setup to use my image which may or may not be up to date. See below to create and host your own image if needed + +## Requirements + +* [S3 bucket and IAM user](https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-walkthroughs-managing-access-example1.html#grant-permissions-to-user-in-your-account-step1), with access key and secret +* [Dockerhub account](https://hub.docker.com/signup) to host your own container image, if required +* [Testnet wallet](https://docs.helium.com/mine-hnt/validators/validator-deployment-guide#create-testnet-wallet) to stake to your validator and claim it + +## Run the container locally + +```text +docker run --publish 2154:2154/tcp -e AWS_ACCESS_KEY=mykey -e AWS_SECRET_KEY=mysecret -e S3_KEY_PATH=mybucket/miner1/swarm_key tombeynon/helium-on-akash +``` + +## Deployment + +You can deploy the validator on Akash using the example deploy.yml. Note that to use your own image which you can keep up to date, check the next section. + +Either clone this repository or create a `deploy.yml` file. Enter your S3 bucket and IAM credentials into the `env` section. If you have a swarm\_key already, make sure this is uploaded to S3 in the same location as S3\_KEY\_PATH. + +Deploy as [per the docs](https://docs.akash.network/guides/deploy) or using a [deploy UI](https://github.com/tombeynon/akash-deploy). + +Once the container is deployed, check the logs to see your address once the server starts \(can take a while\). If your swarm\_key didn't exist in S3 before, the new one should have been uploaded. Subsequent deploys using the same S3 details will now use the same swarm\_key. + +## Build your own image + +There are a couple of reasons to run your own image: + +* Akash requires a version specific tag to update the container image. If you use e.g. `latest`, updating the deployment won't pull the latest version of the tag. Helium currently publishes their docker images using the `latest` format only, so to tag the image as required we need to publish our own. +* Testnet moves quickly and I might not keep my image up to date + +Create a dockerhub account first, then build the image as follows: + +```text +git clone git@github.com:tombeynon/helium-on-akash.git +cd helium-on-akash +docker build . -t mydockerhubuser/helium-on-akash:v0.0.1 +docker push mydockerhubuser/helium-on-akash:v0.0.1 +``` + +You can then change the `image` value in deploy.yml to your repository and version above. + +To update the miner on Akash, run the above to build it with the latest Helium image, incrementing the version number. Then close and re-deploy on Akash using the new version number. This process could be scripted relatively easily. + +## Caveats + +* Updating the container isn't ideal, this could be improved in the future +* Currently only the swarm\_key is synced to S3, meaning the entire blockchain needs to be downloaded each time you run the miner. It takes about 30 minutes currently with the suggested deploy.yml +* There is a delay between 'Starting miner...' and the logs for the miner showing. The miner is running during this time, just the logs don't show. They appear after 5-10 minutes. +* The miner currently shows as relay on the Helium explorer, this might be possible to improve? + +## References + +* [https://docs.helium.com/mine-hnt/validators/validator-deployment-guide](https://docs.helium.com/mine-hnt/validators/validator-deployment-guide) +* [https://explorer.helium.wtf/validators](https://explorer.helium.wtf/validators) +* [https://testnet-api.helium.wtf/v1/validators/{{ADDRESS}}](https://testnet-api.helium.wtf/v1/validators/%7B%7BADDRESS%7D%7D) + diff --git a/guides/multi-tier-app.md b/guides-1/multi-tier-app.md similarity index 97% rename from guides/multi-tier-app.md rename to guides-1/multi-tier-app.md index 2a6fc16a..a89a1e08 100644 --- a/guides/multi-tier-app.md +++ b/guides-1/multi-tier-app.md @@ -6,7 +6,7 @@ In this guide, we will deploy a multi-tier web application on Akash. The example ### Before We Begin -This guide is to be considered an extenstion of the [Deploy an Application](deploy.md) guide. Please ensure you have successfully completed all steps leading up to the "Create the Deployment Configuration" step in said guide, as they will not be discussed here. +This guide is to be considered an extenstion of the [Deploy an Application](../guides/deploy.md) guide. Please ensure you have successfully completed all steps leading up to the "Create the Deployment Configuration" step in said guide, as they will not be discussed here. ## Create the Deployment Configuration @@ -175,7 +175,7 @@ Similar to the `profiles` entries, we must specify deployment criteria for both #### Deployment -Now that we have the SDL configured, lets deploy this application and see what happens. A more detailed guide on this process can be found in the [Deploy an Application](deploy.md) guide. +Now that we have the SDL configured, lets deploy this application and see what happens. A more detailed guide on this process can be found in the [Deploy an Application](../guides/deploy.md) guide. **Create the Deployment** diff --git a/guides-1/postgresql-restore-backup.md b/guides-1/postgresql-restore-backup.md new file mode 100644 index 00000000..956ed6ff --- /dev/null +++ b/guides-1/postgresql-restore-backup.md @@ -0,0 +1,68 @@ +# PostgreSQL restore/backup + +**Repository**: [ovrclk/akash-postgres-restore](https://github.com/ovrclk/akash-postgres-restore) + +An auto-restoring Postgres server running on Akash, with backups taken on a configurable schedule. Backups are stored on decentralised storage using Filebase. + +Ultimately this is a two container setup, one PostgreSQL server and one scheduler container to restore the database on boot, and run a cronjob to back it up. + +## Usage + +* Setup a [Filebase](https://filebase.com/) account and bucket \(or any S3 compatible storage host\). +* Set the environment variables in the [deploy.yml](https://github.com/ovrclk/akash-postgres-restore/blob/master/deploy.yml) and deploy on Akash +* Use the URL and port Akash gives you to connect to the Postgres server, with the credentials you provided in the environment variables. For example cluster.ewr1p0.mainnet.akashian.io:31234 + +### Using with an app container + +Alternatively add your own app container to the deploy.yml and expose the Postgres 5432 port to your application only for a local server. + +For example: + +```text +services: + app: + image: myappimage:v1 + depends_on: + - service: postgres + cron: + image: ghcr.io/ovrclk/akash-postgres-restore:v0.0.4 + env: + - POSTGRES_PASSWORD=password + ... + depends_on: + - service: postgres + postgres: + image: postgres:12.6 + env: + - POSTGRES_PASSWORD=password + expose: + - port: 5432 + to: + - service: app + - service: cron + +``` + +### Environment variables + +* `POSTGRES_USER=postgres` - your Postgres server username +* `POSTGRES_PASSWORD=password` - your Postgres server password +* `POSTGRES_HOST=postgres` - postgres server host, whatever you named it in deploy.yml +* `POSTGRES_PORT=5432` - postgres port, will be 5432 unless you aliased it in deploy.yml +* `POSTGRES_DATABASE=akash_postgres` - name of your database +* `BACKUP_PATH=bucketname/path` - bucket and path for your deployments. Make sure directories exist first +* `BACKUP_KEY=key` - your Filebase access key +* `BACKUP_SECRET=secret` - your Filebase secret +* `BACKUP_PASSPHRASE=secret` - a passphrase to encrypt your backups with +* `BACKUP_HOST=https://s3.filebase.com` - the S3 backup host, this defaults to Filebase but can be any S3 compatible host +* `BACKUP_SCHEDULE=*/15 * * * *` - the cron schedule for backups. Defaults to every 15 minutes +* `BACKUP_RETAIN=7 days` - how many days to keep backups for + +## Development + +You can run the application locally using Docker compose. + +Copy the `.env.sample` file to `.env` and populate + +Run `docker-compose up` to build and run the application + diff --git a/guides-1/ruby-on-rails-with-sia-and-auth0.md b/guides-1/ruby-on-rails-with-sia-and-auth0.md new file mode 100644 index 00000000..6d248508 --- /dev/null +++ b/guides-1/ruby-on-rails-with-sia-and-auth0.md @@ -0,0 +1,93 @@ +# Ruby on Rails with Sia and Auth0 + +**Repository**: [ovrclk/akash-on-rails](https://github.com/ovrclk/akash-on-rails) +**Demo**: [pin.akash.host](https://pin.akash.host/) + +This is an example Rails Pinterest clone hosted on Akash. There are a few extra features to make the most of decentralised hosting: + +* Database backup/restore to [Sia](https://sia.tech/) via [Filebase](https://filebase.com/) +* User image uploads to [Sia](https://sia.tech/) via [Filebase](https://filebase.com/) +* [Auth0](https://auth0.com/) user authentication +* [Cloudflare](https://www.cloudflare.com/) DNS and SSL +* Scheduled tasks using [Whenever](https://github.com/javan/whenever) + +## Architecture + +### App container + +* Runs the rails server and hosts the actual website. +* Connects to the Postgres container for a persistent database +* Hosts files on [Filebase](https://filebase.com/) \([Sia](https://sia.tech/), [Skynet](https://siasky.net/) and [Storj](https://www.storj.io/) hosting currently\) +* Uses [Auth0](https://auth0.com/) for user login and registration + +### Cron container + +* Auto-restores the Postgres database on boot, achieving persistent database through re-deploys +* Auto-backup of the database to [Filebase](https://filebase.com/) every 15 minutes +* Crontab is defined using [Whenever](https://github.com/javan/whenever) in [`schedule.rb`](https://github.com/ovrclk/akash-on-rails/blob/master/config/schedule.rb) +* Runs the same docker image as the rails application, but running `cron` instead of the rails server +* A [standalone database backup/restore container](https://github.com/ovrclk/akash-postgres-restore) is also available + +### Postgres container + +* Runs a standard Postgres server docker image + +## Usage + +Ultimately this repository is designed to provide a sensible example of hosting a rails application on Akash. There are a few ways to use it: + +### Run the application as-is on Akash with your own storage and [Auth0](https://auth0.com/) account + +* Setup a free [Cloudflare](https://www.cloudflare.com/) account and add your domain and set nameservers +* Setup a [Filebase](https://filebase.com/) account and bucket. + * Add a `backups` folder to your bucket. + * You will need your bucket name, client ID and secret +* Sign up for an [Auth0](https://auth0.com/) account and setup an App. + * Callback URL: [https://yourdomain.com/auth/auth0/callback](https://yourdomain.com/auth/auth0/callback) + * Logout URL: [https://yourdomain.com](https://yourdomain.com/) + * You will need your [Auth0](https://auth0.com/) domain, client ID and secret +* Using the example deploy.yml, populate the environment variables with the values from [Filebase](https://filebase.com/) and [Auth0](https://auth0.com/) +* Deploy on Akash and get your app URL +* Point your domain to your app URL using a CNAME in [Cloudflare](https://www.cloudflare.com/) +* Configure 'Full' SSL mode in [Cloudflare](https://www.cloudflare.com/) +* Sign in to your website using [Auth0](https://auth0.com/). The first user created will be made an administrator + +### Use the relevant files in your own project + +* [Dockerfile](https://github.com/ovrclk/akash-on-rails/blob/master/Dockerfile) + * Rails ready Dockerfile + * Installs the aws CLI tool to interact with [Filebase](https://filebase.com/) +* [scripts/run-app.sh](https://github.com/ovrclk/akash-on-rails/blob/master/scripts/run-app.sh) + * Precompiles rails assets + * Runs the rails server +* [scripts/run-scheduler.sh](https://github.com/ovrclk/akash-on-rails/blob/master/scripts/run-scheduler.sh) + * Creates and restores the database + * Runs rake db:migrate and db:seed + * Sets the crontab using [Whenever](https://github.com/javan/whenever) and runs the cron service +* [scripts/restore-postgres.sh](https://github.com/ovrclk/akash-on-rails/blob/master/scripts/restore-postgres.sh) + * Downloads latest backup from [Filebase](https://filebase.com/) + * Restore the DB if a backup was found +* [scripts/backup-postgres.sh](https://github.com/ovrclk/akash-on-rails/blob/master/scripts/backup-postgres.sh) + * Backs up the database to [Filebase](https://filebase.com/) + * Deletes backups older than KEEP\_BACKUPS +* [config/schedule.rb](https://github.com/ovrclk/akash-on-rails/blob/master/config/schedule.rb) + * [Whenever](https://github.com/javan/whenever) cron schedule file to run scripts/backup-postgres.sh every 15 minutes +* [config/initializers/shrine.rb](https://github.com/ovrclk/akash-on-rails/blob/master/config/initializers/shrine.rb) + * Configures Shrine within the application to use [Filebase](https://filebase.com/) as an S3 host +* [deploy.yml](https://github.com/ovrclk/akash-on-rails/blob/master/deploy.yml) + * Akash deploy manifest + +### Clone the repository and use as a base for a new project + +* Clone the repository to your own Github account +* Rename any occurence of AkashOnRails, akash-on-rails and akash\_on\_rails to your own app name +* Change any app/models, app/controllers, app/views as required + +## Development + +You can run the application locally using Docker compose. + +Copy the `.env.sample` file to `.env` and populate + +Run `docker-compose up` to build and run the application + diff --git a/guides/akashnet-2-software-upgrade.md b/guides/akashnet-2-software-upgrade.md deleted file mode 100644 index 4b6a468e..00000000 --- a/guides/akashnet-2-software-upgrade.md +++ /dev/null @@ -1,88 +0,0 @@ -# Software Upgrade: Akashnet-2-upgrade-1 - -## TL;DR - -Software upgrades allows any cosmos based network to soft-upgrade the network to a new version. In general, for any state breaking changes, there will be a migration script to migrate the chain data and we generally hard fork the blockchain network. For soft-upgrades, `x/upgrade` module has a special function called upgrade-handler which handles all the migrations required. Here is the upgrade handler for `akashnet-2-upgrade-1`: [https://github.com/ovrclk/akash/blob/147aaceb41eaf11ec49f3c151301a11bb361ae5f/app/app.go\#L266-L271](https://github.com/ovrclk/akash/blob/147aaceb41eaf11ec49f3c151301a11bb361ae5f/app/app.go#L266-L271). - -It handles 2 migrations: - -* Fix vesting account delegation issues -* Set staking historical events to `10000`, which is required for IBC. - -For more details on soft-upgrades [click here](https://docs.cosmos.network/master/modules/upgrade/) - -## What validators need to do before the upgrade time? - -* Nothing, just sit back and relax. The `software-upgrade` proposal will force the binary \(current version, `akash-v0.10.x`\) to halt at specified height, i.e., 455200 - -## What validators need to do at the time of upgrade \(i.e., at block height `455200`\) - -### 1. Cross check your consensus height: - -```bash -akash status 2>&1 | jq -r '.SyncInfo.latest_block_height' -``` - -It should be 455199 - -### 2. Stop your akash service - -```bash -sudo service akash stop -``` - -### 3. Get/Install new version - -**Option-1: Using pre-build binaries** - -Download pre-built binaries from: [https://github.com/ovrclk/akash/releases/tag/v0.12.1](https://github.com/ovrclk/akash/releases/tag/v0.12.1) - -**Option-2: Build from source** - -* Requires go1.16+ - - ```bash - git clone https://github.com/ovrclk/akash - cd akash - git fetch - git checkout v0.12.1 - MAINNET=true make install - ``` - -### 4. Check your new akash version - -```bash -$ akash version --long -name: akash -server_name: akash -version: v0.12.1 -commit: 53182423582000bf63fa674245a5008c5b466bf1 -build_tags: osusergo,netgo,ledger,mainnet,static_build -go: go version go1.16.1 linux/amd64 -... -``` - -### 5. Start your akash service - -```bash -sudo service akash start -``` - -That's it. You should be able to check new blocks coming up. - -## What if the upgrade fails? - -Since we are not hard-forking the network, it should be simple to revert back. - -* Stop akash service -* Re-install akash `v0.10.2` - - ```bash - cd akash - git checkout v0.10.2 - MAINNET=true make install - ``` - -* Edit akash service file and change `akash start` to `akash start --unsafe-skip-upgrades 455200` -* Start akash service - diff --git a/guides/deploy-tool.md b/guides/deploy-tool.md deleted file mode 100644 index 4b48c2ae..00000000 --- a/guides/deploy-tool.md +++ /dev/null @@ -1,855 +0,0 @@ -# Using the Deploy Tool - -{% hint style="info" %} -The Deploy tool is still under developement and may result in errors. The recommended method for deploying applications on Akash is using the process outlined [here](deploy.md). -{% endhint %} - -In this guide, we'll deploy a single-tier web application on Akash. Akash is a permissionless and censorship-resistant cloud network that guarantees sovereignty over your data and your applications. With Akash, you’re in complete control of all aspects of the life cycle of an application with no middleman. - -In this guide, we'll setup [Lunie Light](https://github.com/ovrclk/lunie-light), a non-custodial, web wallet for Akash on Akash. Lunie Light is a staking interface for proof-of-stake blockchains in the Cosmos ecosystem — built for speed, simplicity, and ease-of-use. - -## Before We Begin - -This is a technical guide, best suited to a reader with basic Linux command line knowledge. The audience for this guide is intended for includes: - -* Application developers with little or no systems administration experience, wanting to deploy applications on the decentralized cloud. -* System administrators with little or no experience with infrastructure automation, wanting to learn more. -* Infrastructure automation engineers that want to explore decentralized cloud. -* Anyone who wants to get a feel for the current state of the decentralized cloud ecosystem. - -We encourage to take a look at [Variables guide](https://github.com/ovrclk/docs/tree/b65f668b212ad1976fb976ad84a9104a9af29770/variables.md) to understand usage of environment variables as well cli flags. - -You'll need to know information about the network you're connecting your node to. See [Choosing a Network](version.md) for how to obtain any network-related information. - -Make sure to have Akash client installed on your workstation, check [install guide](install.md) for instructions. - -You'll need an account with funds to pay for your deployment. See the [funding guide](https://github.com/ovrclk/docs/tree/b65f668b212ad1976fb976ad84a9104a9af29770/guides/wallet/funding.md) for creating a key and funding your account. - -### Set up your Environment - -We will be using shell variables throughout this guide for convenience and clarity. Ensure you have the below set of variables defined on your shell, you can use `export VARNAME=...`: - -| Name | Description | -| :--- | :--- | -| `AKASH_NODE` | Akash network configuration base URL. See [here](version.md#RPC-Node). | -| `AKASH_CHAIN_ID` | Chain ID of the Akash network connecting to. See [here](version.md#Chain-ID). | -| `AKASH_ACCOUNT_ADDRESS` | The address of your account. See [here](https://github.com/ovrclk/docs/tree/b65f668b212ad1976fb976ad84a9104a9af29770/guides/wallet/README.md#account-address). | -| `AKASH_KEYRING_BACKEND` | Keyring backend to use for local keys. See [here](https://github.com/ovrclk/docs/tree/b65f668b212ad1976fb976ad84a9104a9af29770/guides/wallet/README.md) | -| `AKASH_KEY_NAME` | The name of the key you will be deploying from. See [here](https://github.com/ovrclk/docs/tree/b65f668b212ad1976fb976ad84a9104a9af29770/guides/wallet/README.md) if you haven't yet setup a key | - -Verify you have correct `$AKASH_NODE`, that you have populated while [configuring the connection](https://github.com/ovrclk/docs/tree/b65f668b212ad1976fb976ad84a9104a9af29770/guides/version/README.md) using `export AKASH_NODE=$(curl -s "$AKASH_NET/rpc-nodes.txt" | shuf -n 1)`. - -```bash -echo $AKASH_NODE $AKASH_CHAIN_ID $AKASH_KEYRING_BACKEND - -http://147.75.195.69:26657 edgenet-4 os -``` - -Your values may differ depending on the network you're connecting to, `http://147.75.195.69:26657` and `edgenet-4` are details for [edgenet](https://github.com/ovrclk/net/tree/master/edgenet). - -Verify you have the key set up and your account has sufficient balances, see the [funding guide](https://github.com/ovrclk/docs/tree/b65f668b212ad1976fb976ad84a9104a9af29770/guides/wallet/funding.md) otherwise: - -My local key is named `alice`, the below command should return the name you've used: - -```bash -echo $AKASH_KEY_NAME - -alice -``` - -Populate `AKASH_ACCOUNT_ADDRESS` from `AKASH_KEY_NAME` and verify: - -```bash -export AKASH_ACCOUNT_ADDRESS="$(akash keys show $AKASH_KEY_NAME -a)" - -echo $AKASH_ACCOUNT_ADDRESS - -akash1j8s87w3fctz7nlcqtkl5clnc805r240443eksx -``` - -Check your account has sufficient balance by running: - -```bash -akash query bank balances $AKASH_ACCOUNT_ADDRESS -``` - -You should see a response similar to: - -```text -balances: -- amount: "93000637" - denom: uakt -pagination: - next_key: null - total: "0" -``` - -Please note the balance indicated is is denominated in uAKT \(AKT x 10^-6\), in the above example, the account has a balance of _93 AKT_. We're now setup to deploy. - -## Create The Deployment Configuration - -Create a deployment configuration [deploy.yml](https://github.com/ovrclk/docs/tree/b65f668b212ad1976fb976ad84a9104a9af29770/guides/deploy.yml) to deploy the `ovrclk/lunie-light` for [Lunie Light](https://github.com/ovrclk/lunie-light) Node app container using [SDL](https://github.com/ovrclk/docs/tree/b65f668b212ad1976fb976ad84a9104a9af29770/sdl/README.md): - -```bash -cat > deploy.yml < deploy.yml -``` - -You may use the sample deployment file as-is or modify it for your own needs as desscribed in our [SDL \(Stack Definition Language\)](https://github.com/ovrclk/docs/tree/b65f668b212ad1976fb976ad84a9104a9af29770/guides/documentation/sdl/README.md) documentation. A typical modification would be to reference your own image instead of our demo app image. - -{% hint style="info" %} -Please note if you are running on the testnet, you are limited in the amount of testnet resources you may request. -{% endhint %} - -### Mainnet - Audited Attributes - -On the `akashnet-2` network, to ensure tenants have smooth and reliable service from their provider, it is recommended to use the following audited attributes in their deployment: - -```bash - attributes: - host: akash - signedBy: - anyOf: - - "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63" -``` - ---or-- - -```bash - attributes: - datacenter: equinix-metal-ewr1 - signedBy: - anyOf: - - "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63" -``` - -Please note that all of the following can be substituted in the `datacenter` field above and should be chosen based on your needs: - -| Datacenter | Location | -| :--- | :--- | -| `equinix-metal-ewr1` | New Jersey, United States | -| `equinix-metal-sjc1` | California, United States | - -## Create the Deployment - -To create a deployment, a [certificate](../design/mtls.md) must first be created. To do this, run: - -```text -akash tx cert create client --chain-id $AKASH_CHAIN_ID --keyring-backend $AKASH_KEYRING_BACKEND --from $AKASH_KEY_NAME --node $AKASH_NODE --fees 5000uakt -``` - -You should see a response similar to: - -```javascript -{ - "body": { - "messages": [ - { - "@type": "/akash.cert.v1beta1.MsgCreateCertificate", - "owner": "akash1vns5ka3x69ekm3ecp8my8d5zfu8j23p5qew0w3", - "cert": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJ3RENDQVdXZ0F3SUJBZ0lJRm1pcUJWcWZDVmt3Q2dZSUtvWkl6ajBFQXdJd1NqRTFNRE1HQTFVRUF4TXMKWVd0aGMyZ3hkbTV6Tld0aE0zZzJPV1ZyYlRObFkzQTRiWGs0WkRWNlpuVTRhakl6Y0RWeFpYY3dkek14RVRBUApCZ1ZuZ1FVQ0JoTUdkakF1TUM0eE1CNFhEVEl4TURNd01qSXpNak15TmxvWERUSXlNRE13TWpJek1qTXlObG93ClNqRTFNRE1HQTFVRUF4TXNZV3RoYzJneGRtNXpOV3RoTTNnMk9XVnJiVE5sWTNBNGJYazRaRFY2Wm5VNGFqSXoKY0RWeFpYY3dkek14RVRBUEJnVm5nUVVDQmhNR2RqQXVNQzR4TUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowRApBUWNEUWdBRUtaSTlmWGVPVzRCYXRwcU1mb1VTekx2b01lWGlpbEZTMnJhZlhKdUNObUlMVjJMaWhIZW5JdjJTCjV5Uzh1Zkh5QmNMSUI5aFE1VE81THRHSUpPdzIvYU0xTURNd0RnWURWUjBQQVFIL0JBUURBZ1F3TUJNR0ExVWQKSlFRTU1Bb0dDQ3NHQVFVRkJ3TUNNQXdHQTFVZEV3RUIvd1FDTUFBd0NnWUlLb1pJemowRUF3SURTUUF3UmdJaApBSjJzQ3ZodGNzWkRXUkQ2MU03ZkVCRUk5eEt5Z0UzRkd3K2tIYVhZYXl0TUFpRUE4cUZtb3FEc1Z0ZzhPSHc1Ck5iOEljd0hiNHVkc0RpTzRxaWhoL0owNWZKaz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=", - "pubkey": "LS0tLS1CRUdJTiBFQyBQVUJMSUMgS0VZLS0tLS0KTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFS1pJOWZYZU9XNEJhdHBxTWZvVVN6THZvTWVYaQppbEZTMnJhZlhKdUNObUlMVjJMaWhIZW5JdjJTNXlTOHVmSHlCY0xJQjloUTVUTzVMdEdJSk93Mi9RPT0KLS0tLS1FTkQgRUMgUFVCTElDIEtFWS0tLS0tCg==" - } - ], - "memo": "", - "timeout_height": "0", - "extension_options": [], - "non_critical_extension_options": [] - }, - "auth_info": { - "signer_infos": [], - "fee": { - "amount": [], - "gas_limit": "200000", - "payer": "", - "granter": "" - } - }, - "signatures": [] -} -``` - -:warning: **certificate needs to be created only once per account** and can be used across all deployments. - -To deploy on Akash, run: - -```bash -akash deploy create deploy.yml --from $AKASH_KEY_NAME --fees 5000uakt -``` - -You should see a response similar to: - -```javascript -I[2021-03-10|16:53:46.160] tx sent successfully hash=780A5FE292F00057BDD0EFB5333096E328BE3899F219EF52C938286FD28FBF43 code=0 codespace= action=create-deployment dseq=27977 -I[2021-03-10|16:53:53.611] deployment created addr=akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj dseq=27977 -I[2021-03-10|16:53:53.611] order for deployment created addr=akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj dseq=27977 oseq=1 -I[2021-03-10|16:53:59.600] bid for order created addr=akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj dseq=27977 oseq=1 price=100uakt -D[2021-03-10|16:53:59.600] Processing bid -D[2021-03-10|16:53:59.600] All groups have at least one bid -I[2021-03-10|16:54:14.600] Done waiting on bids qty=1 -I[2021-03-10|16:54:14.601] Winning bid gseq=1 price=100uakt provider=akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz -I[2021-03-10|16:54:17.735] All expected leases created addr=akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj dseq=27977 -I[2021-03-10|16:54:17.735] lease for order created addr=akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj dseq=27977 oseq=1 price=100uakt -I[2021-03-10|16:54:17.735] Waiting on leases to be ready leaseQuantity=1 -D[2021-03-10|16:54:17.735] Checking status of lease lease=akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/27977/1/1/akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz -I[2021-03-10|16:54:18.235] sending manifest to provider action=send-manifest provider=akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz dseq=27977 -D[2021-03-10|16:54:18.353] Could not get lease status lease=akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/27977/1/1/akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz err="remote server returned 404" -I[2021-03-10|16:54:26.299] service ready lease=akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/27977/1/1/akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz service=web -I[2021-03-10|16:54:26.299] lease ready leaseID=akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/27977/1/1/akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz -{ - "name": "web", - "available": 1, - "total": 1, - "uris": [ - "5tito0kgehbrjefr7ae9ko1pfs.ingress.ams1p0.mainnet.akashian.io" - ], - "observed_generation": 1, - "replicas": 1, - "updated_replicas": 1, - "ready_replicas": 1, - "available_replicas": 1 -} -``` - -In this step, you post your deployment, and the Akash marketplace matches you with a provider via auction - the URI in the output is randomly generated. To create a deployment use akash deployment. The syntax for the deployment is `akash deploy create --from `. - -## View your Lease - -You can check the status of your lease by running: - -```bash -akash query market lease list --owner $AKASH_ACCOUNT_ADDRESS --node $AKASH_NODE --state active -``` - -You should see a response similar to: - -```text -leases: -- escrow_payment: - account_id: - scope: deployment - xid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/27977 - balance: - amount: "0" - denom: uakt - owner: akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz - payment_id: 1/1/akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz - rate: - amount: "100" - denom: uakt - state: open - withdrawn: - amount: "0" - denom: uakt - lease: - created_at: "27983" - lease_id: - dseq: "27977" - gseq: 1 - oseq: 1 - owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj - provider: akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz - price: - amount: "100" - denom: uakt - state: active -pagination: - next_key: null - total: "0" -``` - -In the above example, we can see that a lease is created using _100 uakt_ or _0.00000100 AKT_ per block to execute the container. - -For convenience and clarity for future referencing, we can extract the below set of values to shell variables that we will be using to reference the deployment: - -| Attribute | Value | -| :--- | :--- | -| `AKASH_PROVIDER` | `akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz` | -| `AKASH_DSEQ` | `27977` | - -Verify we have the right values populated by running: - -```bash -echo $AKASH_PROVIDER $AKASH_DSEQ - -akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz 27977 -``` - -## View Deployment - -Once your lease has been created and you have the relevant information above, you can retrieve the access details by running the below: - -```bash -akash provider lease-status --log_level=info --dseq $AKASH_DSEQ --from $AKASH_KEY_NAME --home ~/.akash --provider $AKASH_PROVIDER --keyring-backend $AKASH_KEYRING_BACKEND --node $AKASH_NODE -``` - -You should see a response similar to: - -```javascript -{ - "services": { - "web": { - "name": "web", - "available": 1, - "total": 1, - "uris": [ - "5tito0kgehbrjefr7ae9ko1pfs.ingress.ams1p0.mainnet.akashian.io" - ], - "observed_generation": 1, - "replicas": 1, - "updated_replicas": 1, - "ready_replicas": 1, - "available_replicas": 1 - } - }, - "forwarded_ports": {} -} -``` - -You can access the application by visiting the hostnames mapped to your deployment. In above example, it's [http://5tito0kgehbrjefr7ae9ko1pfs.ingress.ams1p0.mainnet.akashian.io](http://5tito0kgehbrjefr7ae9ko1pfs.ingress.ams1p0.mainnet.akashian.io) - -## View your logs - -You can view your application logs to debug issues or watch progress like so: - -```bash -akash \ - --home "$AKASH_HOME" \ - --node "$AKASH_NODE" \ - provider lease-logs \ - --dseq "$AKASH_DSEQ" \ - --gseq "$AKASH_GSEQ" \ - --oseq "$AKASH_OSEQ" \ - --provider "$AKASH_PROVIDER" \ - --from "$AKASH_KEY_NAME" -``` - -## Update your deployment - -Updating active deployments is a two step process. First, edit your deployment YAML file with the desired changes. - -{% hint style="info" %} -Akash Groups are translated into Kubernetes Deployments, this means that only a few fields from the Akash SDL are mutable. For example image, command, args, env and exposed ports can be modified, but compute resources and placement criteria cannot. -{% endhint %} - -1. Update your deployment by running: - - ```bash - akash tx deployment update deploy.yml --dseq $AKASH_DSEQ --from $AKASH_KEY_NAME --chain-id $AKASH_CHAIN_ID --node $AKASH_NODE --fees=5000uakt - ``` - - After confirming your transaction, you should see a response similar to this: - - ```javascript - { - "height":"98503", - "txhash":"94FEF5ACB39145BB41ECB1FC224480ED5C80414D0757FC07C844B16EC246D304", - "codespace":"", - "code":0, - "data":"0A130A117570646174652D6465706C6F796D656E74", - "raw_log":"[{\"events\":[{\"type\":\"akash.v1\",\"attributes\":[{\"key\":\"module\",\"value\":\"deployment\"},{\"key\":\"action\",\"value\":\"deployment-updated\"},{\"key\":\"version\",\"value\":\"2b86f778de8cc9df415490efa162c58e7a0c297fbac9cdb8d6c6600eda56f17e\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"98199\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"update-deployment\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000uakt\"}]}]}]", - "logs":[ - { - "msg_index":0, - "log":"", - "events":[ - { - "type":"akash.v1", - "attributes":[ - { - "key":"module", - "value":"deployment" - }, - { - "key":"action", - "value":"deployment-updated" - }, - { - "key":"version", - "value":"2b86f778de8cc9df415490efa162c58e7a0c297fbac9cdb8d6c6600eda56f17e" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"98199" - } - ] - }, - { - "type":"message", - "attributes":[ - { - "key":"action", - "value":"update-deployment" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - } - ] - }, - { - "type":"transfer", - "attributes":[ - { - "key":"recipient", - "value":"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"amount", - "value":"5000uakt" - } - ] - } - ] - } - ], - "info":"", - "gas_wanted":"200000", - "gas_used":"58833", - "tx":null, - "timestamp":"" - } - ``` - - Note the `code: 0` shown in the successful deployment update output above. - -2. Send the updated manifest by running: - - ```bash - akash provider send-manifest deploy.yml --keyring-backend=os --node $AKASH_NODE --from=$AKASH_KEY_NAME --provider=$AKASH_PROVIDER --dseq $AKASH_DSEQ --log_level=info --home ~/.akash - ``` - -Between the first and second step, the prior deployment's containers will continue to run until the new manifest file is received, validated, and new container group operational. After health checks on updated group are passing; the prior containers will be terminated - this process may take a couple minutes to complete. - -## Add funds to your Deployment - -You will eventually need to add funds to the escrow account associated with your deployment to keep it running. If the account becomes overdrawn due to lack of funds, the deployment will permanently close and require you to complete the deploy process again. This in turn will also assign a new, random URI for the deployment. - -Deposit additional funds to your escrow account by running: - -```bash -akash tx deployment deposit --from $AKASH_KEY_NAME --chain-id $AKASH_CHAIN_ID --keyring-backend=$AKASH_KEYRING_BACKEND --node $AKASH_NODE 10000uakt --dseq $AKASH_DSEQ --fees=5000uakt -``` - -After confirming the transaction, you should see a response similar to: - -```javascript -{ - "height":"141905", - "txhash":"DBB5AE97701172506B46B59C46095BC17CF4474E07AABF912D43DC36F57B1E69", - "codespace":"", - "code":0, - "data":"0A140A126465706F7369742D6465706C6F796D656E74", - "raw_log":"[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"deposit-deployment\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000uakt\"},{\"key\":\"recipient\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"10000uakt\"}]}]}]", - "logs":[ - { - "msg_index":0, - "log":"", - "events":[ - { - "type":"message", - "attributes":[ - { - "key":"action", - "value":"deposit-deployment" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - } - ] - }, - { - "type":"transfer", - "attributes":[ - { - "key":"recipient", - "value":"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"amount", - "value":"5000uakt" - }, - { - "key":"recipient", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"amount", - "value":"10000uakt" - } - ] - } - ] - } - ], - "info":"", - "gas_wanted":"200000", - "gas_used":"71665", - "tx":null, - "timestamp":"" -} -``` - -## Close your deployment - -When you are done with your application, close the deployment. This will deprovision your container and stop the token transfer. This is a critical step to conserve both your tokens and testnet server capacity. - -Close deployment using deployment by creating a `deployment-close` transaction: - -```text -akash tx deployment close --node $AKASH_NODE --chain-id $AKASH_CHAIN_ID --dseq $AKASH_DSEQ --owner $AKASH_ACCOUNT_ADDRESS --from $AKASH_KEY_NAME --keyring-backend $AKASH_KEYRING_BACKEND -y --fees 5000uakt -``` - -You should see a response simlar to below as a confirmation your deployment is closed: - -```javascript -{ - "height":"28587", - "txhash":"8EB6E5E7891F9D650569BDE94E6DD4B03AB76D368D259CED46D3C91130F44B90", - "codespace":"", - "code":0, - "data":"0A120A10636C6F73652D6465706C6F796D656E74", - "raw_log":"[{\"events\":[{\"type\":\"akash.v1\",\"attributes\":[{\"key\":\"module\",\"value\":\"deployment\"},{\"key\":\"action\",\"value\":\"deployment-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"27977\"},{\"key\":\"module\",\"value\":\"deployment\"},{\"key\":\"action\",\"value\":\"group-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"27977\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"module\",\"value\":\"market\"},{\"key\":\"action\",\"value\":\"order-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"27977\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"oseq\",\"value\":\"1\"},{\"key\":\"module\",\"value\":\"market\"},{\"key\":\"action\",\"value\":\"bid-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"27977\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"oseq\",\"value\":\"1\"},{\"key\":\"provider\",\"value\":\"akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz\"},{\"key\":\"price-denom\",\"value\":\"uakt\"},{\"key\":\"price-amount\",\"value\":\"100\"},{\"key\":\"module\",\"value\":\"market\"},{\"key\":\"action\",\"value\":\"lease-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"27977\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"oseq\",\"value\":\"1\"},{\"key\":\"provider\",\"value\":\"akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz\"},{\"key\":\"price-denom\",\"value\":\"uakt\"},{\"key\":\"price-amount\",\"value\":\"100\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"close-deployment\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000uakt\"},{\"key\":\"recipient\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"amount\",\"value\":\"4939600uakt\"},{\"key\":\"recipient\",\"value\":\"akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"amount\",\"value\":\"60400uakt\"},{\"key\":\"recipient\",\"value\":\"akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"amount\",\"value\":\"50000000uakt\"}]}]}]", - "logs":[ - { - "msg_index":0, - "log":"", - "events":[ - { - "type":"akash.v1", - "attributes":[ - { - "key":"module", - "value":"deployment" - }, - { - "key":"action", - "value":"deployment-closed" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"27977" - }, - { - "key":"module", - "value":"deployment" - }, - { - "key":"action", - "value":"group-closed" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"27977" - }, - { - "key":"gseq", - "value":"1" - }, - { - "key":"module", - "value":"market" - }, - { - "key":"action", - "value":"order-closed" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"27977" - }, - { - "key":"gseq", - "value":"1" - }, - { - "key":"oseq", - "value":"1" - }, - { - "key":"module", - "value":"market" - }, - { - "key":"action", - "value":"bid-closed" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"27977" - }, - { - "key":"gseq", - "value":"1" - }, - { - "key":"oseq", - "value":"1" - }, - { - "key":"provider", - "value":"akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz" - }, - { - "key":"price-denom", - "value":"uakt" - }, - { - "key":"price-amount", - "value":"100" - }, - { - "key":"module", - "value":"market" - }, - { - "key":"action", - "value":"lease-closed" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"27977" - }, - { - "key":"gseq", - "value":"1" - }, - { - "key":"oseq", - "value":"1" - }, - { - "key":"provider", - "value":"akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz" - }, - { - "key":"price-denom", - "value":"uakt" - }, - { - "key":"price-amount", - "value":"100" - } - ] - }, - { - "type":"message", - "attributes":[ - { - "key":"action", - "value":"close-deployment" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - } - ] - }, - { - "type":"transfer", - "attributes":[ - { - "key":"recipient", - "value":"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"amount", - "value":"5000uakt" - }, - { - "key":"recipient", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"amount", - "value":"4939600uakt" - }, - { - "key":"recipient", - "value":"akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"amount", - "value":"60400uakt" - }, - { - "key":"recipient", - "value":"akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"amount", - "value":"50000000uakt" - } - ] - } - ] - } - ], - "info":"", - "gas_wanted":"200000", - "gas_used":"184841", - "tx":null, - "timestamp":"" -} -``` - -Additionally, you can also query the market to check if your lease is closed: - -```text -akash query market lease list --owner $AKASH_ACCOUNT_ADDRESS --node $AKASH_NODE --dseq $AKASH_DSEQ -``` - -You should see a response similar to: - -```text -leases: -- escrow_payment: - account_id: - scope: deployment - xid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/27977 - balance: - amount: "0" - denom: uakt - owner: akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz - payment_id: 1/1/akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz - rate: - amount: "100" - denom: uakt - state: closed - withdrawn: - amount: "60400" - denom: uakt - lease: - created_at: "27983" - lease_id: - dseq: "27977" - gseq: 1 - oseq: 1 - owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj - provider: akash1ccktptfkvdc67msasmesuy5m7gpc76z75kukpz - price: - amount: "100" - denom: uakt - state: closed -pagination: - next_key: null - total: "0" -``` - -As you can notice from the above, you lease will be marked `closed`. - diff --git a/guides/deploy.md b/guides/deploy.md index e0090adf..fad19e32 100644 --- a/guides/deploy.md +++ b/guides/deploy.md @@ -83,7 +83,7 @@ pagination: Please note the balance indicated is denominated in uAKT \(AKT x 10^-6\), in the above example, the account has a balance of _93 AKT_. We're now setup to deploy. {% hint style="info" %} -Your account must have a minimum balance of 5 AKT to create a deployment. This 5 AKT funds the escrow account associated with the deployment and is used to pay the provider for their services. It is recommended you have more than this minimum balance to pay for transaction fees. For more information on escrow accounts, see [here](../design/escrow.md) +Your account must have a minimum balance of 5 AKT to create a deployment. This 5 AKT funds the escrow account associated with the deployment and is used to pay the provider for their services. It is recommended you have more than this minimum balance to pay for transaction fees. For more information on escrow accounts, see [here](../decentralized-cloud/escrow.md) {% endhint %} ## Create The Deployment Configuration @@ -178,7 +178,7 @@ Please note that all of the following can be substituted in the `datacenter` fie ## Create the Deployment -To create a deployment, a [certificate](../design/mtls.md) must first be created. To do this, run: +To create a deployment, a [certificate](../decentralized-cloud/mtls.md) must first be created. To do this, run: ```text akash tx cert create client --chain-id $AKASH_CHAIN_ID --keyring-backend $AKASH_KEYRING_BACKEND --from $AKASH_KEY_NAME --node $AKASH_NODE --fees 5000uakt diff --git a/guides/deploy/README.md b/guides/deploy/README.md deleted file mode 100644 index e1dc3098..00000000 --- a/guides/deploy/README.md +++ /dev/null @@ -1,1212 +0,0 @@ -# Deploy an Application - -In this guide, we'll deploy a single-tier web application on Akash. Akash is a permissionless and censorship-resistant cloud network that guarantees sovereignty over your data and your applications. With Akash, you’re in complete control of all aspects of the life cycle of an application with no middleman. - -In this guide, we'll setup [Lunie Light](https://github.com/ovrclk/lunie-light), a non-custodial, web wallet for Akash on Akash. Lunie Light is a staking interface for proof-of-stake blockchains in the Cosmos ecosystem — built for speed, simplicity, and ease-of-use. - -## Before We Begin - -This is a technical guide, best suited to a reader with basic Linux command line knowledge. The audience for this guide is intended for includes: - -* Application developers with little or no systems administration experience, wanting to deploy applications on the decentralized cloud. -* System administrators with little or no experience with infrastructure automation, wanting to learn more. -* Infrastructure automation engineers that want to explore decentralized cloud. -* Anyone who wants to get a feel for the current state of the decentralized cloud ecosystem. - -We encourage to take a look at [Variables guide](../variables.md) to understand usage of environment variables as well cli flags. - -You'll need to know information about the network you're connecting your node to. See [Choosing a Network](/guides/version.md) for how to obtain any network-related information. - -Make sure to have Akash client installed on your workstation, check [install guide](../install.md) for instructions. - -You'll need an account with funds to pay for your deployment. See the [funding guide](../wallet/funding.md) for creating a key and funding your account. - -### Set up your Environment - -We will be using shell variables throughout this guide for convenience and clarity. Ensure you have the below set of variables defined on your shell, you can use `export VARNAME=...`: - -|Name|Description| -|---|---| -|`AKASH_NODE`| Akash network configuration base URL. See [here](../version.md#RPC-Node).| -|`AKASH_CHAIN_ID`| Chain ID of the Akash network connecting to. See [here](../version.md#Chain-ID).| -|`AKASH_ACCOUNT_ADDRESS`| The address of your account. See [here](../wallet/README.md#account-address).| -|`AKASH_KEYRING_BACKEND`| Keyring backend to use for local keys. See [here](../wallet/README.md)| -|`AKASH_KEY_NAME` | The name of the key you will be deploying from. See [here](../wallet/README.md) if you haven't yet setup a key| - -Verify you have correct `$AKASH_NODE`, that you have populated while [configuring the connection](../version.md) using `export AKASH_NODE=$(curl -s "$AKASH_NET/rpc-nodes.txt" | shuf -n 1)`. - -```sh -echo $AKASH_NODE $AKASH_CHAIN_ID $AKASH_KEYRING_BACKEND - -http://147.75.195.69:26657 edgenet-4 os -``` - -Your values may differ depending on the network you're connecting to, `http://147.75.195.69:26657` and `edgenet-4` are details for [edgenet](https://github.com/ovrclk/net/tree/master/edgenet). - -Verify you have the key set up and your account has sufficient balances, see the [funding guide](../wallet/funding.md) otherwise: - -My local key is named `alice`, the below command should return the name you've used: - -```sh -echo $AKASH_KEY_NAME - -alice -``` - -Populate `AKASH_ACCOUNT_ADDRESS` from `AKASH_KEY_NAME` and verify: - -```sh -export AKASH_ACCOUNT_ADDRESS="$(akash keys show $AKASH_KEY_NAME -a)" - -echo $AKASH_ACCOUNT_ADDRESS - -akash1j8s87w3fctz7nlcqtkl5clnc805r240443eksx -``` - -Check your account has sufficient balance by running: - -```sh -akash query bank balances --node $AKASH_NODE $AKASH_ACCOUNT_ADDRESS -``` - -You should see a response similar to: - -``` -balances: -- amount: "93000637" - denom: uakt -pagination: - next_key: null - total: "0" -``` - -Please note the balance indicated is denominated in uAKT (AKT x 10^-6), in the above example, the account has a balance of *93 AKT*. We're now setup to deploy. - -{% hint style="warn" %} - -Your account must have a minimum balance of 5 AKT to create a deployment. This 5 AKT funds the escrow account associated with the deployment and is used to pay the provider for their services. It is recommended you have more than this minimum balance to pay for transaction fees. For more information on escrow accounts, see [here](/design/escrow.md) - -{% endhint %} - -## Create The Deployment Configuration - -Create a deployment configuration [deploy.yml](deploy.yml) to deploy the `ovrclk/lunie-light` for [Lunie Light](https://github.com/ovrclk/lunie-light) Node app container using [SDL](/sdl/README.md): - -```sh -cat > deploy.yml < deploy.yml -``` - -You may use the sample deployment file as-is or modify it for your own needs as desscribed in our [SDL (Stack Definition Language)](documentation/sdl) documentation. A typical modification would be to reference your own image instead of our demo app image. - -{% hint style="warn" %} - -Please note if you are running on the testnet, you are limited in the amount of testnet resources you may request. - -{% endhint %} - -### Mainnet - Audited Attributes - -On the `akashnet-2` network, to ensure tenants have smooth and reliable service from their provider, it is recommended to use the following audited attributes in their deployment: - -```sh - attributes: - host: akash - signedBy: - anyOf: - - "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63" -``` ---or-- - -```sh - attributes: - datacenter: equinix-metal-ewr1 - signedBy: - anyOf: - - "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63" -``` - -Please note that all of the following can be substituted in the `datacenter` field above and should be chosen based on your needs: - -|Datacenter|Location| -|---|---| -|`equinix-metal-ewr1`| New Jersey, United States| -|`equinix-metal-sjc1`| California, United States| - - -## Create the Deployment - -To create a deployment, a [certificate](/design/mtls.md) must first be created. To do this, run: - -``` -akash tx cert create client --chain-id $AKASH_CHAIN_ID --keyring-backend $AKASH_KEYRING_BACKEND --from $AKASH_KEY_NAME --node $AKASH_NODE --fees 5000uakt -``` - -You should see a response similar to: -```json -{ - "body": { - "messages": [ - { - "@type": "/akash.cert.v1beta1.MsgCreateCertificate", - "owner": "akash1vns5ka3x69ekm3ecp8my8d5zfu8j23p5qew0w3", - "cert": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJ3RENDQVdXZ0F3SUJBZ0lJRm1pcUJWcWZDVmt3Q2dZSUtvWkl6ajBFQXdJd1NqRTFNRE1HQTFVRUF4TXMKWVd0aGMyZ3hkbTV6Tld0aE0zZzJPV1ZyYlRObFkzQTRiWGs0WkRWNlpuVTRhakl6Y0RWeFpYY3dkek14RVRBUApCZ1ZuZ1FVQ0JoTUdkakF1TUM0eE1CNFhEVEl4TURNd01qSXpNak15TmxvWERUSXlNRE13TWpJek1qTXlObG93ClNqRTFNRE1HQTFVRUF4TXNZV3RoYzJneGRtNXpOV3RoTTNnMk9XVnJiVE5sWTNBNGJYazRaRFY2Wm5VNGFqSXoKY0RWeFpYY3dkek14RVRBUEJnVm5nUVVDQmhNR2RqQXVNQzR4TUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowRApBUWNEUWdBRUtaSTlmWGVPVzRCYXRwcU1mb1VTekx2b01lWGlpbEZTMnJhZlhKdUNObUlMVjJMaWhIZW5JdjJTCjV5Uzh1Zkh5QmNMSUI5aFE1VE81THRHSUpPdzIvYU0xTURNd0RnWURWUjBQQVFIL0JBUURBZ1F3TUJNR0ExVWQKSlFRTU1Bb0dDQ3NHQVFVRkJ3TUNNQXdHQTFVZEV3RUIvd1FDTUFBd0NnWUlLb1pJemowRUF3SURTUUF3UmdJaApBSjJzQ3ZodGNzWkRXUkQ2MU03ZkVCRUk5eEt5Z0UzRkd3K2tIYVhZYXl0TUFpRUE4cUZtb3FEc1Z0ZzhPSHc1Ck5iOEljd0hiNHVkc0RpTzRxaWhoL0owNWZKaz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=", - "pubkey": "LS0tLS1CRUdJTiBFQyBQVUJMSUMgS0VZLS0tLS0KTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFS1pJOWZYZU9XNEJhdHBxTWZvVVN6THZvTWVYaQppbEZTMnJhZlhKdUNObUlMVjJMaWhIZW5JdjJTNXlTOHVmSHlCY0xJQjloUTVUTzVMdEdJSk93Mi9RPT0KLS0tLS1FTkQgRUMgUFVCTElDIEtFWS0tLS0tCg==" - } - ], - "memo": "", - "timeout_height": "0", - "extension_options": [], - "non_critical_extension_options": [] - }, - "auth_info": { - "signer_infos": [], - "fee": { - "amount": [], - "gas_limit": "200000", - "payer": "", - "granter": "" - } - }, - "signatures": [] -} -``` - -:warning: **certificate needs to be created only once per account** and can be used across all deployments. - -To deploy on Akash, run: - -```sh -akash tx deployment create deploy.yml --from $AKASH_KEY_NAME --node $AKASH_NODE --chain-id $AKASH_CHAIN_ID --fees 5000uakt -y -``` - -You should see a response similar to: -```json -{ - "height":"140325", - "txhash":"2AF4A01B9C3DE12CC4094A95E9D0474875DFE24FD088BB443238AC06E36D98EA", - "codespace":"", - "code":0, - "data":"0A130A116372656174652D6465706C6F796D656E74", - "raw_log":"[{\"events\":[{\"type\":\"akash.v1\",\"attributes\":[{\"key\":\"module\",\"value\":\"deployment\"},{\"key\":\"action\",\"value\":\"deployment-created\"},{\"key\":\"version\",\"value\":\"2b86f778de8cc9df415490efa162c58e7a0c297fbac9cdb8d6c6600eda56f17e\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"module\",\"value\":\"market\"},{\"key\":\"action\",\"value\":\"order-created\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"oseq\",\"value\":\"1\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"create-deployment\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000uakt\"},{\"key\":\"recipient\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000000uakt\"}]}]}]", - "logs":[ - { - "msg_index":0, - "log":"", - "events":[ - { - "type":"akash.v1", - "attributes":[ - { - "key":"module", - "value":"deployment" - }, - { - "key":"action", - "value":"deployment-created" - }, - { - "key":"version", - "value":"2b86f778de8cc9df415490efa162c58e7a0c297fbac9cdb8d6c6600eda56f17e" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"140324" - }, - { - "key":"module", - "value":"market" - }, - { - "key":"action", - "value":"order-created" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"140324" - }, - { - "key":"gseq", - "value":"1" - }, - { - "key":"oseq", - "value":"1" - } - ] - }, - { - "type":"message", - "attributes":[ - { - "key":"action", - "value":"create-deployment" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - } - ] - }, - { - "type":"transfer", - "attributes":[ - { - "key":"recipient", - "value":"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"amount", - "value":"5000uakt" - }, - { - "key":"recipient", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"amount", - "value":"5000000uakt" - } - ] - } - ] - } - ], - "info":"", - "gas_wanted":"200000", - "gas_used":"94653", - "tx":null, - "timestamp":"" -} -``` -For convenience and clarity for future referencing, we can extract the below set of values to shell variables that we will be using to reference the deployment: - -| Attribute | Value | -| --- | --- | -| `AKASH_DSEQ` | `140324` | -| `AKASH_OSEQ` | `1` | -| `AKASH_GSEQ` | `1` | - -Verify we have the right values populated by running: - -```sh -echo $AKASH_DSEQ $AKASH_OSEQ $AKASH_GSEQ - -140324 1 1 -``` - -In this step, you post your deployment, the Akash marketplace matches you with a provider via auction. To create a deployment use akash deployment. The syntax for the deployment is `akash tx deployment create --from `. - -## Verify Deployment Creation - -Check that the deployment was created by running: - -```sh -akash query deployment get --owner $AKASH_ACCOUNT_ADDRESS --node $AKASH_NODE --dseq $AKASH_DSEQ -``` -You should see a response similar to: -```sh -deployment: - created_at: "140325" - deployment_id: - dseq: "140324" - owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj - state: active - version: K4b3eN6Myd9BVJDvoWLFjnoMKX+6yc241sZgDtpW8X4= -escrow_account: - balance: - amount: "5000000" - denom: uakt - id: - scope: deployment - xid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/140324 - owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj - settled_at: "140325" - state: open - transferred: - amount: "0" - denom: uakt -groups: -- created_at: "140325" - group_id: - dseq: "140324" - gseq: 1 - owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj - group_spec: - name: westcoast - requirements: - attributes: - - key: host - value: akash - signed_by: - all_of: [] - any_of: - - akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63 - resources: - - count: 1 - price: - amount: "1000" - denom: uakt - resources: - cpu: - attributes: [] - units: - val: "100" - endpoints: - - kind: SHARED_HTTP - memory: - attributes: [] - quantity: - val: "536870912" - storage: - attributes: [] - quantity: - val: "536870912" - state: open -``` - -## Verify Order Creation - -After a short time, you should see an order created for this deployment with the following command: - -```sh -akash query market order get --node $AKASH_NODE --owner $AKASH_ACCOUNT_ADDRESS --dseq $AKASH_DSEQ --oseq $AKASH_OSEQ --gseq $AKASH_GSEQ -``` - -You should see a response similar to: - -``` -created_at: "140325" -order_id: - dseq: "140324" - gseq: 1 - oseq: 1 - owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj -spec: - name: westcoast - requirements: - attributes: - - key: host - value: akash - signed_by: - all_of: [] - any_of: - - akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63 - resources: - - count: 1 - price: - amount: "1000" - denom: uakt - resources: - cpu: - attributes: [] - units: - val: "100" - endpoints: - - kind: SHARED_HTTP - memory: - attributes: [] - quantity: - val: "536870912" - storage: - attributes: [] - quantity: - val: "536870912" -state: open -``` - -## View your Bids - -After a short time, you should see bids from providers for this deployment with the following command: - -```sh -akash query market bid list --owner=$AKASH_ACCOUNT_ADDRESS --node $AKASH_NODE --dseq $AKASH_DSEQ -``` - -You should see a response similar to: - -``` -bids: -- bid: - bid_id: - dseq: "140324" - gseq: 1 - oseq: 1 - owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj - provider: akash10cl5rm0cqnpj45knzakpa4cnvn5amzwp4lhcal - created_at: "140326" - price: - amount: "1" - denom: uakt - state: open - escrow_account: - balance: - amount: "50000000" - denom: uakt - id: - scope: bid - xid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/140324/1/1/akash10cl5rm0cqnpj45knzakpa4cnvn5amzwp4lhcal - owner: akash10cl5rm0cqnpj45knzakpa4cnvn5amzwp4lhcal - settled_at: "140326" - state: open - transferred: - amount: "0" - denom: uakt -- bid: - bid_id: - dseq: "140324" - gseq: 1 - oseq: 1 - owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj - provider: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 - created_at: "140326" - price: - amount: "1" - denom: uakt - state: open - escrow_account: - balance: - amount: "50000000" - denom: uakt - id: - scope: bid - xid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/140324/1/1/akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 - owner: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 - settled_at: "140326" - state: open - transferred: - amount: "0" - denom: uakt - -``` - -Note that there are bids from multiple different providers. In this case, both providers happen to be willing to accept a price of *1 uAKT*. This means that the lease can be created using *1 uAKT* or *0.000001 AKT* per block to execute the container. - -For this example, we will choose `akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7`. - -For convenience and clarity for future referencing, we can extract the below value to a shell variable that we will be using to reference the deployment: - -| Attribute | Value | -| --- | --- | -| `AKASH_PROVIDER` | `akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7` | - -Verify we have the right value populated by running: - -```sh -echo $AKASH_PROVIDER - -akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 -``` - -## Create your Lease - -Create a lease for the bid from the chosen provider above by running: - -```sh -akash tx market lease create --chain-id $AKASH_CHAIN_ID --node $AKASH_NODE --owner $AKASH_ACCOUNT_ADDRESS --dseq $AKASH_DSEQ --gseq $AKASH_GSEQ --oseq $AKASH_OSEQ --provider $AKASH_PROVIDER --from $AKASH_KEY_NAME --fees 5000uakt -``` - -After confirming your transaction, you should see a response similar to: - -```json - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - } - ] - }, - { - "type":"transfer", - "attributes":[ - { - "key":"recipient", - "value":"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"amount", - "value":"5000uakt" - }, - { - "key":"recipient", - "value":"akash10cl5rm0cqnpj45knzakpa4cnvn5amzwp4lhcal" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"amount", - "value":"50000000uakt" - } - ] - } - ] - } - ], - "info":"", - "gas_wanted":"200000", - "gas_used":"131168", - "tx":null, - "timestamp":"" -} -``` - -## Wait for your Lease - -You can check the status of your lease by running: - -```sh -akash query market lease list --owner $AKASH_ACCOUNT_ADDRESS --node $AKASH_NODE --dseq $AKASH_DSEQ -``` - -You should see a response similar to: - -``` -leases: -- escrow_payment: - account_id: - scope: deployment - xid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/140324 - balance: - amount: "0" - denom: uakt - owner: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 - payment_id: 1/1/akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 - rate: - amount: "1" - denom: uakt - state: open - withdrawn: - amount: "0" - denom: uakt - lease: - created_at: "141415" - lease_id: - dseq: "140324" - gseq: 1 - oseq: 1 - owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj - provider: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 - price: - amount: "1" - denom: uakt - state: active -``` - -{% hint style="warn" %} - -Please note that once the lease is created, the provider will begin debiting your deployment's escrow account, even if you have not completed the deployment process by uploading the manifest in the following step. - -{% endhint %} - -## Upload Manifest - -Upload the manifest using the values from above step: - -```sh -akash provider send-manifest deploy.yml --node $AKASH_NODE --dseq $AKASH_DSEQ --provider $AKASH_PROVIDER --home ~/.akash --from $AKASH_KEY_NAME -``` - -You should expect no output from the above command. - -Now that the manifest is uploaded, your image is deployed. You can retrieve the access details by running the below: - -```sh -akash provider lease-status --node $AKASH_NODE --home ~/.akash --dseq $AKASH_DSEQ --from $AKASH_KEY_NAME --provider $AKASH_PROVIDER -``` - -You should see a response similar to: - -```json -{ - "services": { - "web": { - "name": "web", - "available": 1, - "total": 1, - "uris": [ - "rga3h05jetf9h3p6dbk62m19ck.ingress.ewr1p0.mainnet.akashian.io" - ], - "observed_generation": 1, - "replicas": 1, - "updated_replicas": 1, - "ready_replicas": 1, - "available_replicas": 1 - } - }, - "forwarded_ports": {} -} -``` - -You can access the application by visiting the hostnames mapped to your deployment. In above example, its http://rga3h05jetf9h3p6dbk62m19ck.ingress.ewr1p0.mainnet.akashian.io - -## Update your deployment - -Updating active deployments is a two step process. First, edit your deployment YAML file with the desired changes. - -{% hint style="warn" %} - -Akash Groups are translated into Kubernetes Deployments, this means that only a few fields from the Akash SDL are mutable. For example image, command, args, env and exposed ports can be modified, but compute resources and placement criteria cannot. - -{% endhint %} - - 1. Update your deployment by running: - ```sh - akash tx deployment update deploy.yml --dseq $AKASH_DSEQ --from $AKASH_KEY_NAME --chain-id $AKASH_CHAIN_ID --node $AKASH_NODE --fees=5000uakt - ``` - After confirming your transaction, you should see a response similar to this: - ```json - { - "height":"98503", - "txhash":"94FEF5ACB39145BB41ECB1FC224480ED5C80414D0757FC07C844B16EC246D304", - "codespace":"", - "code":0, - "data":"0A130A117570646174652D6465706C6F796D656E74", - "raw_log":"[{\"events\":[{\"type\":\"akash.v1\",\"attributes\":[{\"key\":\"module\",\"value\":\"deployment\"},{\"key\":\"action\",\"value\":\"deployment-updated\"},{\"key\":\"version\",\"value\":\"2b86f778de8cc9df415490efa162c58e7a0c297fbac9cdb8d6c6600eda56f17e\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"98199\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"update-deployment\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000uakt\"}]}]}]", - "logs":[ - { - "msg_index":0, - "log":"", - "events":[ - { - "type":"akash.v1", - "attributes":[ - { - "key":"module", - "value":"deployment" - }, - { - "key":"action", - "value":"deployment-updated" - }, - { - "key":"version", - "value":"2b86f778de8cc9df415490efa162c58e7a0c297fbac9cdb8d6c6600eda56f17e" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"98199" - } - ] - }, - { - "type":"message", - "attributes":[ - { - "key":"action", - "value":"update-deployment" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - } - ] - }, - { - "type":"transfer", - "attributes":[ - { - "key":"recipient", - "value":"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"amount", - "value":"5000uakt" - } - ] - } - ] - } - ], - "info":"", - "gas_wanted":"200000", - "gas_used":"58833", - "tx":null, - "timestamp":"" -} - ``` - - Note the `code: 0` shown in the successful deployment update output above. - - - 2. Send the updated manifest by running: - - ```sh - akash provider send-manifest deploy.yml --keyring-backend $AKASH_KEYRING_BACKEND --node $AKASH_NODE --from $AKASH_KEY_NAME --provider $AKASH_PROVIDER --dseq $AKASH_DSEQ --log_level info --home ~/.akash - ``` - -Between the first and second step, the prior deployment's containers will continue to run until the new manifest file is received, validated, and new container group operational. After health checks on updated group are passing; the prior containers will be terminated - this process may take a couple minutes to complete. - -## Add funds to your Deployment - -You will eventually need to add funds to the escrow account associated with your deployment to keep it running. If the account becomes overdrawn due to lack of funds, the deployment will permanently close and require you to complete the deploy process again. This in turn will also assign a new, random URI for the deployment. - -Deposit additional funds to your escrow account by running: - -```sh -akash tx deployment deposit --from $AKASH_KEY_NAME --chain-id $AKASH_CHAIN_ID --keyring-backend $AKASH_KEYRING_BACKEND --node $AKASH_NODE 10000uakt --dseq $AKASH_DSEQ --fees=5000uakt -``` - -After confirming the transaction, you should see a response similar to: - -```json -{ - "height":"141905", - "txhash":"DBB5AE97701172506B46B59C46095BC17CF4474E07AABF912D43DC36F57B1E69", - "codespace":"", - "code":0, - "data":"0A140A126465706F7369742D6465706C6F796D656E74", - "raw_log":"[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"deposit-deployment\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000uakt\"},{\"key\":\"recipient\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"10000uakt\"}]}]}]", - "logs":[ - { - "msg_index":0, - "log":"", - "events":[ - { - "type":"message", - "attributes":[ - { - "key":"action", - "value":"deposit-deployment" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - } - ] - }, - { - "type":"transfer", - "attributes":[ - { - "key":"recipient", - "value":"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"amount", - "value":"5000uakt" - }, - { - "key":"recipient", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"amount", - "value":"10000uakt" - } - ] - } - ] - } - ], - "info":"", - "gas_wanted":"200000", - "gas_used":"71665", - "tx":null, - "timestamp":"" -} -``` - -## Close your deployment - -When you are done with your application, close the deployment. This will deprovision your container and stop the token transfer. This is a critical step to conserve both your tokens and testnet server capacity. - -Close deployment using deployment by creating a `deployment-close` transaction: - -``` -akash tx deployment close --node $AKASH_NODE --chain-id $AKASH_CHAIN_ID --dseq $AKASH_DSEQ --owner $AKASH_ACCOUNT_ADDRESS --from $AKASH_KEY_NAME --keyring-backend $AKASH_KEYRING_BACKEND -y --fees 5000uakt -``` - -You should see a response simlar to below as a confirmation your deployment is closed: - -```json -{ - "height":"141928", - "txhash":"406B359910E4AD0944DA3C00D66B79179849B1A894C73A8CAA3CA0D93E44A1AA", - "codespace":"", - "code":0, - "data":"0A120A10636C6F73652D6465706C6F796D656E74", - "raw_log":"[{\"events\":[{\"type\":\"akash.v1\",\"attributes\":[{\"key\":\"module\",\"value\":\"deployment\"},{\"key\":\"action\",\"value\":\"deployment-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"module\",\"value\":\"deployment\"},{\"key\":\"action\",\"value\":\"group-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"module\",\"value\":\"market\"},{\"key\":\"action\",\"value\":\"order-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"oseq\",\"value\":\"1\"},{\"key\":\"module\",\"value\":\"market\"},{\"key\":\"action\",\"value\":\"bid-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"oseq\",\"value\":\"1\"},{\"key\":\"provider\",\"value\":\"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7\"},{\"key\":\"price-denom\",\"value\":\"uakt\"},{\"key\":\"price-amount\",\"value\":\"1\"},{\"key\":\"module\",\"value\":\"market\"},{\"key\":\"action\",\"value\":\"lease-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"oseq\",\"value\":\"1\"},{\"key\":\"provider\",\"value\":\"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7\"},{\"key\":\"price-denom\",\"value\":\"uakt\"},{\"key\":\"price-amount\",\"value\":\"1\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"close-deployment\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000uakt\"},{\"key\":\"recipient\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"amount\",\"value\":\"5009487uakt\"},{\"key\":\"recipient\",\"value\":\"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"amount\",\"value\":\"513uakt\"},{\"key\":\"recipient\",\"value\":\"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"amount\",\"value\":\"50000000uakt\"}]}]}]", - "logs":[ - { - "msg_index":0, - "log":"", - "events":[ - { - "type":"akash.v1", - "attributes":[ - { - "key":"module", - "value":"deployment" - }, - { - "key":"action", - "value":"deployment-closed" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"140324" - }, - { - "key":"module", - "value":"deployment" - }, - { - "key":"action", - "value":"group-closed" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"140324" - }, - { - "key":"gseq", - "value":"1" - }, - { - "key":"module", - "value":"market" - }, - { - "key":"action", - "value":"order-closed" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"140324" - }, - { - "key":"gseq", - "value":"1" - }, - { - "key":"oseq", - "value":"1" - }, - { - "key":"module", - "value":"market" - }, - { - "key":"action", - "value":"bid-closed" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"140324" - }, - { - "key":"gseq", - "value":"1" - }, - { - "key":"oseq", - "value":"1" - }, - { - "key":"provider", - "value":"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7" - }, - { - "key":"price-denom", - "value":"uakt" - }, - { - "key":"price-amount", - "value":"1" - }, - { - "key":"module", - "value":"market" - }, - { - "key":"action", - "value":"lease-closed" - }, - { - "key":"owner", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"dseq", - "value":"140324" - }, - { - "key":"gseq", - "value":"1" - }, - { - "key":"oseq", - "value":"1" - }, - { - "key":"provider", - "value":"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7" - }, - { - "key":"price-denom", - "value":"uakt" - }, - { - "key":"price-amount", - "value":"1" - } - ] - }, - { - "type":"message", - "attributes":[ - { - "key":"action", - "value":"close-deployment" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - } - ] - }, - { - "type":"transfer", - "attributes":[ - { - "key":"recipient", - "value":"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8" - }, - { - "key":"sender", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"amount", - "value":"5000uakt" - }, - { - "key":"recipient", - "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"amount", - "value":"5009487uakt" - }, - { - "key":"recipient", - "value":"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"amount", - "value":"513uakt" - }, - { - "key":"recipient", - "value":"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7" - }, - { - "key":"sender", - "value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u" - }, - { - "key":"amount", - "value":"50000000uakt" - } - ] - } - ] - } - ], - "info":"", - "gas_wanted":"200000", - "gas_used":"184707", - "tx":null, - "timestamp":"" -} -``` -Additionally, you can also query the market to check if your lease is closed: - -``` -akash query market lease list --owner $AKASH_ACCOUNT_ADDRESS --node $AKASH_NODE --dseq $AKASH_DSEQ -``` - -You should see a response similar to: - -``` -leases: -- escrow_payment: - account_id: - scope: deployment - xid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/140324 - balance: - amount: "0" - denom: uakt - owner: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 - payment_id: 1/1/akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 - rate: - amount: "1" - denom: uakt - state: closed - withdrawn: - amount: "513" - denom: uakt - lease: - created_at: "141415" - lease_id: - dseq: "140324" - gseq: 1 - oseq: 1 - owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj - provider: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 - price: - amount: "1" - denom: uakt - state: closed -pagination: - next_key: null - total: "0" -``` - -As you can notice from the above, you lease will be marked `closed`. - -## View your logs - -You can view your application logs to debug issues or watch progress like so: - -```sh -akash \ - --home "$AKASH_HOME" \ - --node "$AKASH_NODE" \ - provider lease-logs \ - --dseq "$AKASH_DSEQ" \ - --gseq "$AKASH_GSEQ" \ - --oseq "$AKASH_OSEQ" \ - --provider "$AKASH_PROVIDER" \ - --from "$AKASH_KEY_NAME" -``` \ No newline at end of file diff --git a/guides/guides.md b/guides/guides.md index b4e5f774..83b285b0 100644 --- a/guides/guides.md +++ b/guides/guides.md @@ -22,9 +22,7 @@ Because of this, it is important to type the commands into a terminal that the v * [Run an Akash Node](node/) * [RPC Service](node/rpc-service.md) * [API Service](node/api-service.md) - * [Run a Validator](node/validator.md) -* [Become a Provider](provider.md) -* [Common Commands](general-commands.md) -* [Upgrade to Akashnet-2](upgrade-mainnet.md) -* [Using the Deploy Tool](deploy-tool.md) + * [Run a Validator](../validators/validator.md) +* [Become a Provider](../providers/provider.md) +* [Common Commands](../decentralized-cloud/general-commands.md) diff --git a/guides/upgrade-mainnet.md b/guides/upgrade-mainnet.md deleted file mode 100644 index 6dc21e1c..00000000 --- a/guides/upgrade-mainnet.md +++ /dev/null @@ -1,179 +0,0 @@ -# Upgrade to Akashnet-2 - -## Akashnet-2 Upgrade Procedure - -### What validators need to do before the upgrade time? - -1. Verify you are currently running the correct version of Akash - -```bash -$ akashd version --long -name: akash -server_name: akashd -client_name: akashctl -version: 0.8.3 -commit: 11a6e4dfba545073f79732088735f93a5408995c -build_tags: netgo,ledger,mainnet -go: go version go1.15.5 linux/amd64 -``` - -1. Set halt-time to ensure your validator node stops at the right time and date: March 08 2021 at 1500 UTC. - -```bash -$ perl -i -pe 's/^halt-time =.*/halt-time = 1615215600/' ~/.akashd/config/app.toml -``` - -or you can manually update `app.toml` using `nano` or `vm` - -1. Stop your `akashd` binary or systemd process -2. Restart your `akashd` binary or systemd process - -### Instructions for upgrade, after the node stops \(i.e., after 1500UTC on 8th March, 2021\) - -1. Stop your `akashd` binary or systemd process -2. Check the last block height signed - -Check the last block height signed by your validator: - -```bash -$ cat ~/.akashd/data/priv_validator_state.json | jq '.height' -``` - -Take the state export from this height \(decision on the final height will be coordinated on the mainnet-validator discord channel\): - -1. Export the `akashnet-1` state - -```bash -akashd export --for-zero-height --height > old_genesis_export.json -``` - -1. Fix migration issue by executing following command \(This is yet to be fixed on cosmos-sdk: [https://github.com/cosmos/cosmos-sdk/issues/8776](https://github.com/cosmos/cosmos-sdk/issues/8776)\) - -```bash -cat old_genesis_export.json | jq '.app_state.auth.accounts= [.app_state.auth.accounts[] | if (.value.public_key!=null and .value.public_key!="") then (.value.public_key.value= (.value.public_key.value | if type=="string" then . else (.threshold = (.threshold| tonumber)) end)) else . end ]' > old_genesis_updated.json -``` - -1. Verify the SHA256 of the \(sorted\) exported genesis file: - -```bash -$ jq -S -c -M '' old_genesis_updated.json | shasum -a 256 -``` - -Compare this value with other validators of the network over on \#validators-mainnet on the [discord server](https://discord.gg/CuGPqaUW). It's important that everyone can create the same genesis file export. - -HASH: \[TBD\] - -1. Install Akash [v0.10.1](https://github.com/ovrclk/akash/releases/tag/v0.10.1) - -**Note**: Building the new binary requires Go 1.15+ - -```bash -git clone https://github.com/ovrclk/akash -cd akash -git checkout v0.10.1 -MAINNET=true make install -``` - -1. Verify you have the correct version: - -```bash - $ akash version --long - name: akash - server_name: akash - version: 0.10.1 - commit: c39715e1f9c13ec85eefbfb295031e995db45591 - build_tags: netgo,ledger,mainnet - go: go version go1.15.5 linux/amd64 -``` - -**Note**: `akashd` and `akashctl` are merged into a single binary, `akash` now. - -1. Migrate exported state from the current v0.8.3 version to the new v0.10.1 version: - -```bash -$ akash migrate v0.40 old_genesis_updated.json --chain-id=akashnet-2 --genesis-time 2021-03-08T15:00:00Z > 040_migrated_genesis.json -``` - -1. Migrate command adds a warning to the exported file regarding `max_bytes` in the `evidence` module which we will modify in the next step. Remove the warning: - -```bash -$ sed -i '/Warning/d' 040_migrated_genesis.json -``` - -1. Update the evidence params as below: - -```bash -$ sed -i 's/{"max_age_duration":"172800000000000","max_age_num_blocks":"100000"}/{"max_age_duration":"172800000000000","max_age_num_blocks":"100000","max_bytes":"1048576"}/g' 040_migrated_genesis.json -``` - -1. Add IBC and Akash parameters to the genesis file: - -```bash -$ cat 040_migrated_genesis.json | jq '.app_state |= . + {"ibc":{"client_genesis":{"clients":[],"clients_consensus":[],"create_localhost":false},"connection_genesis":{"connections":[],"client_connection_paths":[]},"channel_genesis":{"channels":[],"acknowledgements":[],"commitments":[],"receipts":[],"send_sequences":[],"recv_sequences":[],"ack_sequences":[]}},"transfer":{"port_id":"transfer","denom_traces":[],"params":{"send_enabled":false,"receive_enabled":false}},"capability":{"index":"1","owners":[]}} + {"deployment":{"deployments":[],"params":{"deployment_min_deposit":{"denom":"uakt","amount":"5000000"}}},"market":{"orders":[],"leases":[],"params":{"bid_min_deposit":{"denom":"uakt","amount":"50000000"},"order_max_bids": 20}}} + {"provider":{"providers":[]}} + {"cert":{"certificates":[]}} + {"audit":{"attributes":[]}} + {"escrow":{"accounts":[],"payments":[]}}' > new_genesis.json -``` - -1. Verify the SHA256 of the final genesis JSON: - -```bash -$ jq -S -c -M '' new_genesis.json | shasum -a 256 -``` - -HASH: TBA - -1. Creating a new home directory for `akash` - -```bash -$ akash init --chain-id akashnet-2 -``` - -1. Update the fast-sync option to `v2` in `config.toml` - -```bash -version = "v2" -``` - -1. Make the following changes in `app.toml` - -Configure `minimum-gas-prices` - this is very important for the security of the network. - -```text -# The minimum gas prices a validator is willing to accept for processing a -# transaction. A transaction's fees must meet the minimum of any denomination -# specified in this config (e.g. 0.25token1;0.0001token2). -minimum-gas-prices = "0.025uakt" -``` - -Configure `state-sync`. State sync snapshots allow other nodes to rapidly join the network without replaying historical blocks. - -```text -[state-sync] - -## snapshot-interval specifies the block interval at which local state sync snapshots are - -## taken (0 to disable). Must be a multiple of pruning-keep-every. - -snapshot-interval = 500 - -## snapshot-keep-recent specifies the number of recent snapshots to keep and serve \(0 to keep all\). - -snapshot-keep-recent = 2 -``` - -1. Copying `node_key.json` and `priv_val_key.json` and new genesis to the new home directory \(Only applicable for the ones who are using the file-based FilePV implementation for their consensus keys\) - -```text -$ cp .akashd/config/node_key.json .akash/config/node_key.json -$ cp .akashd/config/priv_validator_key.json .akash/config/priv_validator_key.json -$ cp new_genesis.json .akash/config/genesis.json -``` - -1. Add Peers to `.akash/config/config.toml` -2. Update systemd Edit your systemd file to use `akash` instead of `akashd` and also rename the service file to `akash` -3. Start your validator - -```bash -sudo service akash start -``` - -Note Migrate keys or recover using mnemonic \(For all non-ledger users\) `akashctl keys export ` `akash keys import ` or `akash keys add --recover` - diff --git a/guides/provider/README.md b/providers/provider.md similarity index 84% rename from guides/provider/README.md rename to providers/provider.md index 988074e8..ad836b00 100644 --- a/guides/provider/README.md +++ b/providers/provider.md @@ -1,6 +1,8 @@ -# Become a provider +# Becoming a Provider -## Prerequisits +## Become a provider + +### Prerequisits To run a provider on the Akash network, you need the following @@ -13,12 +15,11 @@ To run a provider on the Akash network, you need the following * Access to an Akash blockchain RPC node * An RPC node is necessary because the Akash provider does not directly participate in the blockchain network. Instead it uses an external node to manage all interactionwith the blockchain. Any accessible RPC node can be used. Anyone running an Akash provider is strongly reccommended to run a node on the Akash network co-located with the provider. It is _not_ necessary for this node to act as a validator. More than one provider can access the same RPC node. -## Kubernetes Cluster Setup +### Kubernetes Cluster Setup -The setup of a Kubernetes cluster is the responsibility of whoever sets up a provider on the Akash network. This section of this document provides best practices and ecommendations for setting up a Kubernetes cluster. This document is not a comprehensive guide to operating a Kubernetes cluster. +The setup of a Kubernetes cluster is the responsibility of whoever sets up a provider on the Akash network. This section of this document provides best practices and ecommendations for setting up a Kubernetes cluster. This document is not a comprehensive guide to operating a Kubernetes cluster. -The general set of actions which must be carried out to setup a Kubernetes cluster for -a provider is +The general set of actions which must be carried out to setup a Kubernetes cluster for a provider is 1. Clone the Kubespray project 2. Setup your Ansible inventory for the nodes that makeup the cluster @@ -29,40 +30,41 @@ a provider is At ths point you would be left with a Kubernetes cluster that is ready to be a provider but not yet on the network. -The recommended method for setting up a Kubernetes cluster is to use the [Kubespray](https://github.com/kubernetes-sigs/kubespray) project. This project is a collection of ansible resources for setting up a Kubernetes cluster. +The recommended method for setting up a Kubernetes cluster is to use the [Kubespray](https://github.com/kubernetes-sigs/kubespray) project. This project is a collection of ansible resources for setting up a Kubernetes cluster. -The recommended minimum number of machines is three. One machine hosts the Kubernetes master node & provider, with the other machines hosting the compute nodes. It is possible however to provision a single-machine cluster if you -choose to, but this configuration is not recommended. +The recommended minimum number of machines is three. One machine hosts the Kubernetes master node & provider, with the other machines hosting the compute nodes. It is possible however to provision a single-machine cluster if you choose to, but this configuration is not recommended. -## Getting kubespray & setup +### Getting kubespray & setup Get the [latest](https://github.com/kubernetes-sigs/kubespray/releases) official release of Kubespray. You need a working Ansible installation as well, with the additional Python dependencies specified in the `requirements.txt` document. It is recommended you install this using a Python virtual environment created with the `virtualenv` tool. -``` +```text virtualenv --python=python3 venv ``` -``` + +```text . venv/bin/activate ``` -``` + +```text pip3 install -r requirements.txt ``` -## Accessing nodes +### Accessing nodes -Ansible works by remotely configuring machines using SSH. Each node in your cluster must be accessible using SSH with an SSH key. The user that you connect remotely as must either be `root` or be capable of escalating privileges to `root` using the `sudo` command. +Ansible works by remotely configuring machines using SSH. Each node in your cluster must be accessible using SSH with an SSH key. The user that you connect remotely as must either be `root` or be capable of escalating privileges to `root` using the `sudo` command. If you need to copy your SSH private key to the nodes you can do so using the `ssh-copy-id` command on most Linux machines. -## Configuring inventory +### Configuring inventory The Ansible inventory determines what machines Ansible configures for the Kubernetes cluster. Configuration files for Ansible can be created in multiple formats, but this guide only shows how to define an inventory as a YAML file. -Example single node configuration (not recommended) +Example single node configuration \(not recommended\) -``` +```text all: vars: cluster_id: "1.0.0.1" @@ -89,7 +91,6 @@ all: kube-master: kube-node: calico-rr: - ``` This Ansible inventory file defines a single node file with a host named "mynode". The name "mynode" is the name internally assigned by Ansible to the node. The value specified at the key `ansible_host` under that file defines how the host is reached by Ansible. In this example the node's IP address is used, but a hostname may also be used. @@ -100,7 +101,7 @@ One important detail is the value `cluster_id` which is assigned to all nodes by Example multinode configuration, with a single master -``` +```text all: vars: cluster_id: "1.0.0.1" @@ -135,18 +136,17 @@ all: kube-master: kube-node: calico-rr: - ``` -This examples defines 3 separate hosts `mymaster`, `mynode0`, and `mynode1`. +This examples defines 3 separate hosts `mymaster`, `mynode0`, and `mynode1`. The `inventory` directory in the Kubespray project contains an existing directory called `sample`. The `sample` directory should be copied to a name of your choosing. In this guide we assume the `sample` directory has been copied to a directory called `defi`. The YAML file you create should be placed in the `defi` directory. -## Running Kubespray +### Running Kubespray Assuming you have created an inventory file placed at `inventory/defi/myinventory.yaml`, `cd` back up into `/kubespray/` run Kubespray with the following command: -``` +```text ansible-playbook -i inventory/defi/myinventory.yaml -b -v --private-key=~/.ssh/id_rsa cluster.yml ``` @@ -154,18 +154,17 @@ Note that this will run for some time before it is complete. When complete, thje The `--private-key` option lets Ansible know what SSH private key to authenticate with. If you're using a different private key be sure and update this parameter to point at the location of the private key used to access all hosts in the cluster. -The playbook `cluster.yml` contains all the necessary steps to build the Kubernetes cluster. When the cluster is complete, on the master node there should be a file stored at `/root/.kube/config` which is used to connect to and authenticate with the Kubernetes. Treat this file as a secret password which you do not share. A copy of this file must be used to configure the Akash provider. +The playbook `cluster.yml` contains all the necessary steps to build the Kubernetes cluster. When the cluster is complete, on the master node there should be a file stored at `/root/.kube/config` which is used to connect to and authenticate with the Kubernetes. Treat this file as a secret password which you do not share. A copy of this file must be used to configure the Akash provider. +#### Known issues -### Known issues +When the above example is followed, Kubespray uses Calico for the networking of Kubernetes.It is an extremely common error to have Kubespray fail on a step where a script named `calioctl.sh` is being run. This appears to be a bug in Kubespray. The only solution known at this time is to wait around 3 minutes then rerun Kubespray. On the second run, Kubespray complete successfully. -When the above example is followed, Kubespray uses Calico for the networking of Kubernetes.It is an extremely common error to have Kubespray fail on a step where a script named `calioctl.sh` is being run. This appears to be a bug in Kubespray. The only solution known at this time is to wait around 3 minutes then rerun Kubespray. On the second run, Kubespray complete successfully. - -### Dense Provider considerations +#### Dense Provider considerations Kubernetes uses a networking model that assigns a single IP address to each deployed pod. Each node in a Kubernetes cluster has a range of IP addresses available to it. This means that there is a limit to the number of pods that can be hosted on a single node. -For providers with small nodes, this pods per node limit is not a concern. For providers running nodes with dense compute configurations (for example, multisocket CPU servers) this can become a limiting factor to utilization of the node. +For providers with small nodes, this pods per node limit is not a concern. For providers running nodes with dense compute configurations \(for example, multisocket CPU servers\) this can become a limiting factor to utilization of the node. To increase the pods per node limit, 3 steps need to be taken: @@ -175,9 +174,9 @@ To increase the pods per node limit, 3 steps need to be taken: In this example, these values can be configured in `kubespray/inventory/defi/group_vars/k8s_cluster/k8s-cluster.yml` -### Add the Akash Custom Resource Definition +#### Add the Akash Custom Resource Definition -On the remote machine, navigate to `/root/.kube` and open `config` using your preferred editor. Ensure that the `server` field is populated with the actual server IP (including port number), as Kubespray often incorrectly fills it with `127.0.0.1`. +On the remote machine, navigate to `/root/.kube` and open `config` using your preferred editor. Ensure that the `server` field is populated with the actual server IP \(including port number\), as Kubespray often incorrectly fills it with `127.0.0.1`. Save this `config` file and copy it to your local machine. @@ -185,74 +184,71 @@ On your local machine,set the `KUBECONFIG` environmental variable to the path of Akash uses a custom resource definition to store each deployment in Kubernetes. You must load this CRD by downloading the following file: -Files: -1. [https://raw.githubusercontent.com/ovrclk/akash/master/pkg/apis/akash.network/v1/crd.yaml] +Files: 1. \[[https://raw.githubusercontent.com/ovrclk/akash/master/pkg/apis/akash.network/v1/crd.yaml](https://raw.githubusercontent.com/ovrclk/akash/master/pkg/apis/akash.network/v1/crd.yaml)\] -and applying it by using the `kubectl` command like this +and applying it by using the `kubectl` command like this -``` +```text kubectl apply -f ./crd.yaml ``` If you receive an error resembling this -``` +```text The connection to the server 127.0.0.1:34473 was refused - did you specify the right host or port? ``` -then the `KUBECONFIG` variable is likely set incorrectly. -### Add Networking Configuration +then the `KUBECONFIG` variable is likely set incorrectly. -Akash supplies networking configuration which must be applied to the Kubernetes cluster. You must load this file by downloading it and applying it +#### Add Networking Configuration -Files: -1. [https://raw.githubusercontent.com/ovrclk/akash/master/_docs/kustomize/networking/network-policy-default-ns-deny.yaml] +Akash supplies networking configuration which must be applied to the Kubernetes cluster. You must load this file by downloading it and applying it -You can apply it using the `kubectl` command like this +Files: 1. \[[https://raw.githubusercontent.com/ovrclk/akash/master/\_docs/kustomize/networking/network-policy-default-ns-deny.yaml](https://raw.githubusercontent.com/ovrclk/akash/master/_docs/kustomize/networking/network-policy-default-ns-deny.yaml)\] -``` +You can apply it using the `kubectl` command like this + +```text kubectl apply -f ./network-policy-default-ns-deny.yaml ``` -### Create Kubernetes Ingress Controller +#### Create Kubernetes Ingress Controller -Akash requires that a Kubernetes ingress controller be created. You must load this file by downloading it and applying it +Akash requires that a Kubernetes ingress controller be created. You must load this file by downloading it and applying it -Files: -1. [https://raw.githubusercontent.com/ovrclk/akash/master/_run/ingress-nginx.yaml] +Files: 1. \[[https://raw.githubusercontent.com/ovrclk/akash/master/\_run/ingress-nginx.yaml](https://raw.githubusercontent.com/ovrclk/akash/master/_run/ingress-nginx.yaml)\] -You can apply it using the `kubectl` command like this +You can apply it using the `kubectl` command like this -``` +```text kubectl apply -f ./ingress-nginx.yaml ``` Additionally, exactly one node needs to be labeled with a label specific to this ingress declaration: -``` +```text kubectl label nodes name_of_the_node_goes_here akashRole=ingress ``` This will cause the NGINX ingress to live only on that node. When the wildcard domain is created, it needs to point at this node's IP address. -### Configure gVisor +#### Configure gVisor -Files: -1. [https://raw.githubusercontent.com/ovrclk/operations/master/infra/roles/kubernetes-gvisor-class/files/gvisor_runtime_class?token=ALSBDWBUBQCMW2TIPDDXZALAV4E3A] +Files: 1. \[[https://raw.githubusercontent.com/ovrclk/operations/master/infra/roles/kubernetes-gvisor-class/files/gvisor\_runtime\_class?token=ALSBDWBUBQCMW2TIPDDXZALAV4E3A](https://raw.githubusercontent.com/ovrclk/operations/master/infra/roles/kubernetes-gvisor-class/files/gvisor_runtime_class?token=ALSBDWBUBQCMW2TIPDDXZALAV4E3A)\] -``` +```text kubectl apply -f ./gvisor-runtime.yaml ``` TODO - convert above to file and move to public Akash repo -# Provider Setup & Configuration +## Provider Setup & Configuration The akash provider is started by running `akash provider run`. The command is configurable entirely through the command line switches. For each command line switch, an environmental variable may also be used instead. This may be preferred for production operations. For example, the akash provider supports the command line switch `--chain-id`. To convert a command line switch to its environmental variable equivalent, the leading dashes are removed, any other dashes become underscores, all characters are converted to uppercase, and the prefix `AKASH_` is added. So instead of using the command line switch `--chain-id` you would use `AKASH_CHAIN_ID` instead. -## Configuration Considerations +### Configuration Considerations The necessary steps to running an Akash provider are @@ -265,31 +261,31 @@ The necessary steps to running an Akash provider are This section documents configuration you may want to consider customizing when setting up a provider. You may choose to run the Akash provider process via any means you choose. However, Akash has already built Ansible playbooks to help the end user with the steps necessary to run the Akash provider. -## Public Hostname Configuration +### Public Hostname Configuration There are 3 important public hostnames that a provider must configure. The **provider host** is the publicly accessible hostname of the provider. This is specified in the configuration file using the `host` key when `akash tx provider create` or `akash tx provider update` is ran. This value is stored on the blockchain. It is used whenever a lease owner needs to communicate directly with the provider for things such as sending a manifest or getting a lease status. -The **cluster ingress host** is the publicly accessible hostname of the Kubernetes cluster. The Kubernetes cluster hosts an Ingress Controller, which is one way that leases in the cluster may be exposed to the outside world. It is currently recommended to [assign](#Create-Kubernetes-Ingress-Controller) exactly one node in your cluster to the Ingress Controller role. +The **cluster ingress host** is the publicly accessible hostname of the Kubernetes cluster. The Kubernetes cluster hosts an Ingress Controller, which is one way that leases in the cluster may be exposed to the outside world. It is currently recommended to [assign](provider.md#Create-Kubernetes-Ingress-Controller) exactly one node in your cluster to the Ingress Controller role. At this time only HTTP is supported for the Ingress Controller. The hostname should resolve to an IP which directs traffic to the Kubernetes ingress controller IP on your network. This value is specified using the `--deployment-ingress-domain` switch. It is not stored on the blockchain. -The **cluster public hostname** is the publicly accessible hostname of the Kubernetes cluster. Is is not required, nor is it desirable to expose an entire cluster to the internet. The Kubernetes cluster supports a feature called a "NodePort" service. This allows UDP and TCP traffic to be forwarded from the cluster directly to a container on any node in the cluster. By default Kubernetes uses the port range `30000-32767` for this. It is recommended that traffic from the internet only be able to access this port range. This hostname should be configured to resolve to an IP that directs traffic to any of the nodes in the Kubernetes cluster. Kubernetes automatically routes the IP traffic to the correct container. This value is set using the `--cluster-public-hostname` command line switch. It _may_ be different that the **cluster ingress host** but that is not required. This value is not stored on the blockchain. +The **cluster public hostname** is the publicly accessible hostname of the Kubernetes cluster. Is is not required, nor is it desirable to expose an entire cluster to the internet. The Kubernetes cluster supports a feature called a "NodePort" service. This allows UDP and TCP traffic to be forwarded from the cluster directly to a container on any node in the cluster. By default Kubernetes uses the port range `30000-32767` for this. It is recommended that traffic from the internet only be able to access this port range. This hostname should be configured to resolve to an IP that directs traffic to any of the nodes in the Kubernetes cluster. Kubernetes automatically routes the IP traffic to the correct container. This value is set using the `--cluster-public-hostname` command line switch. It _may_ be different that the **cluster ingress host** but that is not required. This value is not stored on the blockchain. -### Blocking hostnames +#### Blocking hostnames -A Kubernetes ingress controller is used to expose HTTP traffic from a lease to the outside world. By default, a lease may request any hostname it wants. This hostname is published in the DNS entries maintained by Kubernetes. It may be desirable to block some domains from being used by a lease. +A Kubernetes ingress controller is used to expose HTTP traffic from a lease to the outside world. By default, a lease may request any hostname it wants. This hostname is published in the DNS entries maintained by Kubernetes. It may be desirable to block some domains from being used by a lease. The command line switch `--deployment-blocked-hostnames` command line switch allows blocking a domain. To block a single domain, specify it exactly. For example `--deployment-blocked-hostnames=akash.network` blocks a lease from requesting a hostname of `akash.network`. To block a domain and all subdomains, precede the hostname with the dot character. For example, `--deployment-blocked-hostnames=.bobsdeficloud.com` would block `bobsdeficloud.com`, `www.bobsdeficloud.com` as well as any other subdomains. This command line switch may be given any number of times to install mutliple blocks. -## Creating the Provider on the Blockchain +### Creating the Provider on the Blockchain On your remote machine, download the Akash software and import/create your Akash provider key & ensure the assosciated account is adequately funded - details on how to perform said tasks will not be covered in this guide. -### Configure Akash Provider +#### Configure Akash Provider ```bash cat < provider.yaml @@ -299,11 +295,12 @@ attributes: value: us-west-demo-$(whoami) EOF ``` + Note that `PROVIDER_DOMAIN` is the IP address of the provider remote machine. You may optionally declare a list of attributes associated with your provider by adding the following information to `provider.yaml` -``` +```text attributes: - key: region value: us-west @@ -311,7 +308,7 @@ attributes: value: nameOfYourOrganization ``` -### Create Akash Provider +#### Create Akash Provider Register your provider on the Akash Network: @@ -321,15 +318,15 @@ _Replace `--from` flag value with your own_ akash tx provider create provider.yaml --from $AKASH_PROVIDER_KEY --home=$AKASH_HOME --keyring-backend=$AKASH_KEYRING_BACKEND --node=$AKASH_NODE --chain-id=$AKASH_CHAIN_ID --fees 5000uakt ``` -### Create the provider certificate +#### Create the provider certificate You must issue a transaction to the blockchain to create a certificate associated with your provider. `akash tx cert create server $PROVIDER_DOMAIN --chain-id $AKASH_CHAIN_ID --keyring-backend $AKASH_KEYRING_BACKEND --from $AKASH_PROVIDER_KEY --home=$AKASH_HOME --node=$AKASH_NODE --fees 5000uakt` -### Starting the Provider +#### Starting the Provider -#### Mandatory provider configuration +**Mandatory provider configuration** You must configure the following parameters on the command line when starting the provider @@ -352,9 +349,9 @@ The provider must have a wallet accessible under the directory specified by `--h Example command to start a provider: -`akash provider run --home $AKASH_HOME --chain-id $AKASH_CHAIN_ID --node $AKASH_NODE --keyring-backend=test --from $AKASH_PROVIDER_KEY --fees 5000uakt --kubeconfig $KUBECONFIG --cluster-k8s true --deployment-ingress-domain $PROVIDER_DOMAIN --deployment-ingress-static-hosts true --cluster-public-hostname _optional_ --bid-price-strategy scale --bid-price-cpu-scale 500` +`akash provider run --home $AKASH_HOME --chain-id $AKASH_CHAIN_ID --node $AKASH_NODE --keyring-backend=test --from $AKASH_PROVIDER_KEY --fees 5000uakt --kubeconfig $KUBECONFIG --cluster-k8s true --deployment-ingress-domain $PROVIDER_DOMAIN --deployment-ingress-static-hosts true --cluster-public-hostname _optional_ --bid-price-strategy scale --bid-price-cpu-scale 500` -### Cluster resources overcommit +#### Cluster resources overcommit By default the akash provider asks Kubernetes to reserve _all_ resources on a 1 for 1 basis. Since not all leases are expected to see 100% resource utilization, it makes sense to allow resource overcommit. The following flags may be set @@ -366,7 +363,7 @@ Any flag not specified is equivalent to having a value of zero. Each flag is a positive integer number. The number given is the percentage of overcommit to consider when making bids. Specifying `--overcommit-pct-cpu=50` tells the Akash provider to commit 50% more CPU than is actuall available. -### Bid pricing +#### Bid pricing When the akash provider considers bidding on a lease, it must compute a bid price. The bid pricing strategy is set with the switch `--bid-price-strategy`. By default the `scale` strategy is used. This strategy computes bid prices using a set of linear scales based off the requested CPU, memory, and storage. @@ -379,7 +376,7 @@ When the `scale` strategy is used, at least one of the following command line sw The actual bid price is computed by multiplying the configured scale with the resources requested in the lease. -The `scale` strategy is not likely to be sufficient for all providers. Since some providers may want to use complex pricing strategies (or not bid at all) the `script` strategy can be used. The `script` strategy invokes an external script to compute a bid price and uses that as a result. The following command line switches are used to control the script invocation: +The `scale` strategy is not likely to be sufficient for all providers. Since some providers may want to use complex pricing strategies \(or not bid at all\) the `script` strategy can be used. The `script` strategy invokes an external script to compute a bid price and uses that as a result. The following command line switches are used to control the script invocation: * `--bid-price-script-path` - Path to executable script, must be set * `--bid-price-script-process-limit` - Maximum number of concurrent executions of the script @@ -394,8 +391,7 @@ The pricing configuration script must be a file on the same filesystem as the pr The data written to standard out has the following structure -``` - +```text [ { "memory": 2048 @@ -419,11 +415,11 @@ The key `"endpoint-quantity"` defines the number of exposed ports the lease is r The pricing script may make any computations it needs to compute a price. The price is written to standard out as a JSON number. This should be a whole number, representing the bid quantity in `uakt`. If the decision is made that no bid should be placed, the number 0 should be used for the bid quantity. -#### Example script +**Example script** The following script shows an example implementation of a bid pricing script using the Python 3 language. -``` +```text #!/usr/bin/env python3 import math @@ -448,19 +444,18 @@ for group in order_data: group_count = group['count'] price = group['cpu'] * uakt_per_millicpu + group['memory']/MEGA * uakt_per_memory_megabyte + group['storage']/MEGA * uakt_per_storage_megabyte bid_price += group['count'] * price - + # Disable bidding if there is a large container if group['memory'] > memory_cutoff: bid = False - + bid_price = math.ceil(bid_price) # Convert bid to an integer - + # A result must always be written to standard out if bid: json.dump(bid_price, sys.stdout) else: # Indicate not to bid json.dump(0, sys.stdout) - +``` -``` \ No newline at end of file diff --git a/guides/node/validator.md b/validators/validator.md similarity index 98% rename from guides/node/validator.md rename to validators/validator.md index 50f61890..cc3d96c8 100644 --- a/guides/node/validator.md +++ b/validators/validator.md @@ -1,6 +1,6 @@ -# Run a Validator +# Running a Validator -Before setting up your validator node, make sure you've already gone through the [Full Node Setup](./) guide. +Before setting up your validator node, make sure you've already gone through the [Full Node Setup](../guides/node/) guide. > NOTE: it is not required to create a validator on Akash testnets unless specified in a challenge or otherwise. The akash team runs a centralized validator set to enable for easy and consistent testnet operations for developers trying out the platform for the first time.