Closed anchalshivank closed 3 weeks ago
Ensure you have two mandatory folders, read-only
and read-write
, in your directory. The golem-cli
will scan these to create the configuration file.
Command:
golem-cli init
Output:
Config file created
Explanation:
The init
command sets up the initial Golem configuration, generating a golem.yaml
file. This file is essential for linking components and configuring further operations like adding or updating components.
Use the re-init
command to refresh the YAML file if there are changes in the folder structure.
Command:
golem-cli component re-init
Output:
Config file created
To add a component, compress the read-write
, read-only
, and golem.yaml
files into a single zip (e.g., ifs.zip
), which will be stored on the backend.
Command:
golem-cli component add --component-name golem_cloud out/comp_a.wasm
Output:
{
"componentUrn": "urn:component:59039a00-30db-4b73-85e6-4c9f2a293e92",
"componentVersion": 0,
"componentName": "golem_cloud",
"componentSize": 2946151,
"createdAt": "2024-10-29T20:59:23.287340467Z",
"exports": [
"golem:component/api.{initialize-cart}(user-id: string)",
"golem:component/api.{add-item}(item: record { product-id: string, name: string, price: float32, quantity: u32 })",
"golem:component/api.{remove-item}(product-id: string)",
"golem:component/api.{update-item-quantity}(product-id: string, quantity: u32)",
"golem:component/api.{checkout}() -> variant { error(string), success(record { order-id: string }) }",
"golem:component/api.{get-cart-contents}() -> list<record { product-id: string, name: string, price: float32, quantity: u32 }>"
]
}
Use the update
command to update the component configuration in the backend. This does not affect the worker’s IFS, which is not implemented yet.
Command:
golem-cli component update --component-name golem_cloud out/comp_a.wasm
Output:
{
"componentUrn": "urn:component:59039a00-30db-4b73-85e6-4c9f2a293e92",
"componentVersion": 1,
"componentName": "golem_cloud",
"componentSize": 2946151,
"createdAt": "2024-10-29T21:01:51.565224247Z",
"exports": [
"golem:component/api.{initialize-cart}(user-id: string)",
"golem:component/api.{add-item}(item: record { product-id: string, name: string, price: float32, quantity: u32 })",
"golem:component/api.{remove-item}(product-id: string)",
"golem:component/api.{update-item-quantity}(product-id: string, quantity: u32)",
"golem:component/api.{checkout}() -> variant { error(string), success(record { order-id: string }) }",
"golem:component/api.{get-cart-contents}() -> list<record { product-id: string, name: string, price: float32, quantity: u32 }>"
]
}
The Worker API allows you to explore the IFS directory for any worker and download specific files by clicking on them.
@anchalshivank Congratulations on submitting your solution for our Bounty-to-Hire challenge (#1004)!
We have reviewed your pull request. While you have made some progress toward #1004, there is still so much work left to do, and existing work that needs to be restructured, that we have decided you will not be progressing to the next phase.
At this point, we wish to thank you for your work on this open source project, and your participation in the challenge, and encourage you to keep an eye on future bounties, which your work in this one has prepared you for.
Congratulations again on being one of our contestants and putting so much effort into your work!
/resolve #1004 /claim #1004
Features
[x] Initialize golem.yaml file
golem.yaml
file within the component folder.[x] Cloud-Based Initial File System (IFS)
[x] URL-Based Content Download
[x] Worker File Access
[ ] Testing
[ ] File System Update Support
[ ] API Definition Finalization
Note: The remaining tasks are currently in progress.