💻

Contract Manages Akash-hosted Front End

Join the community of open-source builders at Agoric!
The goal of this effort is to write an Agoric smart contract that fully manages an Akash compute deployment of an arbitrary front end. This will allow decentralized management of application front ends and could solve a significant industry challenge.
As a result, the smart contract's implementation has the potential to revolutionize how front ends are hosted and operated within decentralized ecosystems, facilitating greater autonomy and self-governance for users and communities and instilling greater trust and confidence in decentralized systems for the general public.
The learnings and insights gained from implementing this Agoric smart contract could pave the way for a fully featured standalone product in the future.
An initial version of the contract must:
  1. 1.
    On deployment, create an account on the Akash blockchain to manage through Cosmos’s Interchain Accounts (ICA)
  2. 2.
    Be able to receive and hold required payment tokens for the Akash blockchain - $AKT (and if feasible by the time of development - $USDC or even $IST)
  3. 3.
    Transfer those tokens over IBC to the Akash chain to maintain a minimum balance necessary for keeping the deployment running. The contract must use [agoric-sdk/pegasus package](https://github.com/Agoric/agoric-sdk/tree/release-mainnet1B/packages/pegasus) to transfer tokens.
  4. 4.
    Create a new Akash deployment of front end code (stored in a public github repository) that showcases a basic blockchain interaction, i.e. connect wallet, read data from a public smart contract, sign a transaction etc.
  5. 5.
    Maintain the deployment including renewing the lease if it expires or is terminated (use Interchain Queries to watch lease status)

Context

Decentralized groups often govern applications but rely on centralized infrastructure for the front end hosting. This contract would offer a more flexible method for hosting infrastructure that would not be reliant on a single person or entity.
This reliance on a single person or entity for hosting introduces vulnerabilities and potential points of failure, contradicting the very essence of decentralization.
To address this critical issue, the proposed contract seeks to provide a groundbreaking solution by offering a more flexible approach to hosting infrastructure.
By leveraging distributed networks and decentralized technologies, the contract would ensure that hosting responsibilities and deployment decisions are spread across both network nodes and governance groups, eliminating the risk of centralization and enhancing the resilience of the applications.
In doing so, it empowers decentralized groups to maintain full control over their applications without compromising on security and reliability, thus embodying the true spirit of decentralization in both governance and infrastructure management.

Acceptance Criteria

  • Be deployed on the Agoric testnet
  • Include a basic front end for user testing in Beta
  • Be able to successfully deploy the front-end application to the target hosting environment
  • Be compatible with different front-end frameworks and technologies commonly used in Web3 (React, Angular, Vue)
  • Allow for easy configuration and customization of deployment parameters such as target environment, deployment paths, and any environment-specific settings
  • Integrate smoothly with version control systems (e.g., Git) and be able to deploy the correct version of the front-end code
  • Be capable of pushing updates to a deployed version
  • Be capable of rolling back the deployment to the previous stable version in case of critical failures
  • Log deployment activities comprehensively, allowing for easy monitoring and debugging of the process. It should also provide a deployment report with relevant details after each successful deployment
  • Be thoroughly documented, including clear instructions on how to use it, its dependencies, and any configuration options
  • Include a short video demonstrating basic usage scenarios

Time Estimation

3 weeks(120 hours)

Reward

$9600
Payment will be made in USD (fiat currency) via wire transfer. The developer is responsible for providing their completed tax documents (W9 for US based developers and/or W8 or W8-BEN-E for non-US based developers) and providing their banking details in order to receive payment.

Applicant Assessment Criteria

Important: Please provide a clear work plan for how you will approach this bounty. Use the work plan as an initial demonstration that you would be a good candidate. Bounties will require coordination with the Agoric team, so unfortunately only plans submitted in English will be considered.
Applicants will be assessed based on the following criteria:
* Issue-specific domain experience
* Issue-specific technical capability
* Familiarity with Agoric's platform
* JavaScript experience
* Availability and communication

Experience Write-up (1000-1500 words)

As part of completing the bounty, we ask that you write up a short (or long!) summary of your experience building on Agoric. Write-up should:
  • Begin with a compelling, relevant introductory hook statement (<50 words).
  • Clearly explain the specific bounty project (~100 words).
  • Describe how the developer approached the problem (~300 words).
  • Give a step-by-step description of the solution (>500 words && <1000 words).
  • At least three code snippets per write-up. They do not count toward overall word count.
  • Conclude with clear calls to action on developing with Agoric - specifically how any ambition developer reading this piece could do more themselves (~100 words).
This is important feedback for us as we evolve the platform.

Review Process

  1. 1.
    Agoric team reviews your submitted work plan on Gitcoin
  2. 2.
    It is best to join our Discord and post your gitcoin name in the bounties channel, so that we can follow up with you. Otherwise, we will write on your gitcoin profile wall and say hello!
  3. 3.
    Agoric contacts you to provide reference projects / sample code for engineering review
  4. 4.
    Introductory call to discuss your plans and expected timeline
  5. 5.
    You join the Agoric Discord bounties channel (if you haven’t done so already)
  6. 6.
    Agoric accepts you on Gitcoin and you get started!

References

Non-Interchain Version

An initial version of this Agoric smart-contract must:
  1. 1.
    On startup, create an account on the Akash blockchain
  2. 2.
    Be able to receive and hold required payment tokens for the Akash blockchain - $AKT. Have a flexible design so that the contract can keep functioning when Akash governance decides to accept new tokens as payment.
  3. 3.
    Transfer the tokens escrowed in the Agoric smart-contract to the Akash account that has been created on the contract startup over IBC. Use [agoric-sdk/pegasus package] for transferring tokens over IBC.
  4. 4.
    4. Manage the Akash compute deployment's lifecycle.

Technical Infrastructure

Ideally we would like to implement all the functionalities above using Interchain tech stack like ICA (Interchain Accounts) and ICQ (Interchain Queries). However, given the Akash network not supporting these Interchain technologies yet, we are not able to use them for the purposes of this bounty.
So as an alternative, we encourage the bounty developer to use [Official akash-network/akashjs library] to build a Hardened JS module and export a remotable object containing the methods required for this bounty so that the Agoric smart-contract can use it. Please contact the Agoric team for technical support on how to implement this module.

Acceptance Criteria

  1. 1.
    Manage the Akash compute deployment's lifecycle performing below operations;
  2. 2.
    Create new Akash compute deployment
    1. 1.
      View bids from providers
    2. 2.
      Chose a bid
    3. 3.
      Create a lease using the chosen bid. Sending a manifest to the provider as an additional step might be required for the contract to take care of depending on the capability of the sdk used for interacting with the Akash network.
    4. 4.
      Query and display the lease information
    5. 5.
      Upgrade/redeploy the running code by updating the deployment configuration
    6. 6.
      Close lease
    7. 7.
      Close Akash compute deployment
  3. 3.
    Use `pegasus` for IBC transfers
  4. 4.
    Include a basic front end for user testing in Beta.
  5. 5.
    Be able to successfully deploy the front-end application to the target hosting environment.
  6. 6.
    Be compatible with different front-end frameworks and technologies commonly used in Web3 (React, Angular, Vue).
  7. 7.
    Be thoroughly documented, including clear instructions on how to use it, its dependencies, and any configuration options.
  8. 8.
    Showcase a demo scenario where all the operations mentioned in clause 1 are clearly shown. The setup of this demo should also be clearly documented with a walkthrough and another dev should be able to successfully run the demo in their environment by following the instructions from the walkthrough.
  9. 9.
    Record the demo.