Skip to content

Latest commit

 

History

History
147 lines (106 loc) · 5.39 KB

File metadata and controls

147 lines (106 loc) · 5.39 KB

ghostcloud is an innovative web hosting blockchain powered by Cosmos SDK and the CometBFT consensus engine.

build coverage

Requirements

Before setting up ghostcloud, ensure your system meets the following prerequisites:

  • Go programming language, version 1.25 or higher

Get started

To jumpstart your ghostcloud blockchain development, run the following command:

CHAIN_ID="local-1" HOME_DIR="~/.gc" TIMEOUT_COMMIT="500ms" CLEAN=true sh scripts/test_node.sh

Configure

See the configuration options available in the scripts/test_node.sh script to customize your local blockchain setup.

How to use

This section describes how to interact with your ghostcloud blockchain using the command-line interface (CLI).

Deploying a new instance

To create a new deployment on your blockchain, use the command format below:

ghostcloudd tx ghostcloud create [NAME] [PAYLOAD] --from [KEY] --gas auto --yes

where

  • [NAME] is your chosen name for the deployment.
  • [PAYLOAD] is the path to either a directory or a zip file containing your deployment's content.
  • [KEY] is the name of the key used for signing the transaction.

Optional flags:

  • --description "[DESCRIPTION]" - A brief description of the deployment (optional).
  • --domain [DOMAIN] - The domain that will be associated with this deployment (optional).

Important considerations:

  • The [PAYLOAD] must have an index.html file located at the root.
  • The size of the [PAYLOAD] is limited to a maximum of 5MB.

Example usage:

ghostcloudd tx ghostcloud create foobar ~/foobar.zip --from alice --gas auto --yes

In the example above, a new deployment named foobar is created using the contents of ~/foobar.zip, signed with the key alice. The transaction is set to calculate the gas automatically and is confirmed without further prompts.

Update an existing deployment

ghostcloudd tx ghostcloud update [NAME] [DESCRIPTION] [DOMAIN] [flags] --from [KEY] --gas auto --yes

where

  • [NAME] is the name of the deployment to update.
  • [DESCRIPTION] is the new description for the deployment.
  • [DOMAIN] is the new domain associated with the deployment.
  • [KEY] is the name of the key to use for signing the transaction.

Available flags:

  • --website-payload [PATH] - (Optional) Provide the path to the new website payload, which can be a directory or a zip file.

Important considerations:

  • If using --website-payload, ensure that the payload contains an index.html file at its root and that the total size does not exceed 5MB.
  • [NAME], [DESCRIPTION], and [DOMAIN] must be provided together. If you do not wish to update a particular field, use the existing value.

Example usage:

ghostcloudd tx ghostcloud update myapp "Updated version" "newexample.com" --website-payload ~/newapp.zip \
  --from alice --gas auto --yes 

In this example, the myapp deployment is updated with new contents from ~/newapp.zip, a new description, and a new domain, all signed with the key alice. The --gas auto flag allows the transaction to automatically calculate the gas needed, and --yes confirms the transaction without additional prompts.

Remove an existing deployment

ghostcloudd tx ghostcloud remove [NAME] --from [KEY] --gas auto --yes

where

  • [NAME] is the name of the deployment to remove.
  • [KEY] is the name of the key to use for signing the transaction.

Example usage:

ghostcloudd tx ghostcloud remove myapp --from alice --gas auto --yes

In this example, the myapp deployment is removed from the blockchain, signed with the key alice. The --gas auto flag allows the transaction to automatically calculate the gas needed, and --yes confirms the transaction without additional prompts.

List all deployments

ghostcloudd q ghostcloud list

Available flags:

  • --filter-by string - Apply a filter to the list of deployments. The filter can be creator.
  • --filter-value string - The value to use for the filter.
  • --filter-operator string - The operator to use for the filter. The operator can be equal.

Example usage:

ghostcloudd q ghostcloud list --filter-by creator \
  --filter-value gc13q9lpjm0zwse4msn5l6anwzznphxgnzxssf86x \
  --filter-operator equal

In this example, the command will return the list of deployments created by the address gc13q9lpjm0zwse4msn5l6anwzznphxgnzxssf86x.

Developers

Use the provided Makefile to execute common operations:

$ make help
help                           Display this help screen
lint                           Run linter (golangci-lint)
format                         Run formatter (goimports)
coverage                       Run coverage report
test                           Run tests