Skip to content

Latest commit

 

History

History
416 lines (294 loc) · 6.95 KB

README.md

File metadata and controls

416 lines (294 loc) · 6.95 KB

Dev Environment: "Lite" configuration

The Lite development environment builds a single-node network for testing blockchain operations.

An Akash Provider Daemon may optionally be run, but it will not execute workloads for leases that it acquires.

The instructions below will illustrate how to:

See commands for a full list of utilities meant for interacting with the network.

Setup

Four keys and accounts are created. The key names are:

Key Name Use
main Primary account (creating deployments, etc...)
provider The provider account (bidding on orders, etc...)
validator The sole validator for the created network
other Misc. account to (receives tokens, etc...)

Most make commands are configurable and have defaults to make it such that you don't need to override them for a simple pass-through of this example.

Name Default Description
KEY_NAME main standard key name
PROVIDER_KEY_NAME provider name of key to use for provider
DSEQ 1 deployment sequence
GSEQ 1 group sequence
OSEQ 1 order sequence
PRICE 10uakt price to bid

Runbook

The following steps will bring up a network and allow for interacting with it.

Running through the entire runbook requires three terminals. Each command is marked t1-t3 to indicate a suggested terminal number.

If at any time you'd like to start over with a fresh chain, simply run:

t1

make clean init

Initialize

The following command will

  • build akash
  • create configuration directories
  • create a genesis file with accounts and single validator.

t1

make init

Run local network

In a separate terminal, the following command will run the akash node:

t2

make node-run

You can check the status of the network with:

t1

make node-status

You should see blocks being produced - the block height should be increasing.

You can now view genesis accounts that were created:

t1

make query-accounts

Create a provider

Create a provider on the network with the following command:

t1

make provider-create

View the on-chain representation of the provider with:

t1

make query-provider

Run provider services

NOTE: running a provider is optional. If you want to bid on orders yourself, skip this step.

In a separate terminal, run the following command

t3

make provider-run

Query the provider service gateway for its status:

t1

make provider-status

Create a deployment

Create a deployment from the main account with:

t1

make deployment-create

This particular deployment is created from the sdl file in this directory (deployment.yaml).

Check that the deployment was created. Take note of the dseq - deployment sequence:

t1

make query-deployments

After a short time, you should see an order created for this deployment with the following command:

t1

make query-orders

Create a bid

NOTE: if you are running provider services, skip the first step here - it is handled by the provider daemon.

Create a bid for the order from the provider:

t1

make bid-create

You should be able to see the bid with

t1

make query-bid

Eventually a lease will be generated. You can see it with:

t1

make query-leases

if you are running provider services, query the provider gateway:

t1

make provider-status

Create a lease

Create a lease for the bid from the provider:

t1

make lease-create

You should be able to see the lease with

t1

make query-leases

Withdraw from the lease

Withdraw some funds from the lease

t1

make lease-withdraw

You should be able to see the escrow payment change in

t1

make query-leases

and

t1

make query-accounts

Terminate lease

There are a number of ways that a lease can be terminated.

Provider closes the bid:

t1

make bid-close

Tenant closes the order

t1

make lease-close

Tenant closes the deployment

t1

make deployment-close

Commands

Querying

Query commands fetch and display information from the blockchain.

Accounts

Query all accounts:

make query-accounts

Query individual accounts:

make query-account-main
make query-account-provider
make query-account-validator
make query-account-other

Deployments

Query all deployments:

make query-deployments

Query a single deployment:

DSEQ=4 make query-deployment

Orders

Query all orders:

make query-orders

Query a single order:

DSEQ=4 GSEQ=1 OSEQ=1 make query-order

Bids

Query all bids:

make query-bids

Query a single bid:

DSEQ=4 GSEQ=1 OSEQ=1 make query-bid

Leases

Query all leases:

make query-leases

Query a single lease:

DSEQ=4 GSEQ=1 OSEQ=1 make query-lease

Providers

Query all providers:

make query-providers

Query a single provider:

PROVIDER_KEY_NAME=validator make query-provider

Transactions

Transaction commands modify blockchain state.

Deployments

Create a deployment with DSEQ set to the current block height

DSEQ=0 make deployment-create

Fully-customized deployment creation:

SDL_PATH=yolo.yaml DSEQ=20 KEY_NAME=other make deployment-create

Close a deployment with a custom DSEQ

DSEQ=10 make deployment-close

Orders

Close an order with the default parameters

make order-close

Fully-customized order close

KEY_NAME=other DSEQ=20 GSEQ=99 OSEQ=500 make order-close

Bids

Fully-customized bid creation

KEY_NAME=other PROVIDER_KEY_NAME=validator DSEQ=20 GSEQ=99 OSEQ=500 PRICE=100uakt make bid-create

Fully-customized bid close

KEY_NAME=other PROVIDER_KEY_NAME=validator DSEQ=20 GSEQ=99 OSEQ=500 make lease-close

Providers

Fully-customized provider creation

PROVIDER_KEY_NAME=validator PROVIDER_CONFIG_PATH=rogue.yaml make provider-create

Fully-customized provider update

PROVIDER_KEY_NAME=validator PROVIDER_CONFIG_PATH=rogue.yaml make provider-update