Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Effector quickstart #116

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Effector quickstart #116

wants to merge 14 commits into from

Conversation

boneyard93501
Copy link
Collaborator

No description provided.

Copy link

vercel bot commented May 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fluence-dev-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2024 5:39am



## Using The Permissionable cURL Effector
## Working With The cURL Effector Module

Create a project with Fluence CLI. This time we choose the *minimal* template but stick with the default environment selection, *dar* and name our project *http-enabled*:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be quickstart or which of these?

? Select template (Use arrow keys)
❯ quickstart
  minimal
  ts
  js

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i used minimal but we can change it to quickstart if that improves dx

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with minimal, it just needs to be stated

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This time we choose the minimal template ...
isn't that what that does?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I'm blind.


```toml
-- Cargo.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not Cargo.toml in root, right? That's a Cargo.toml in src/services/http_requester/http_requester, right?


```bash
# Making sure service and modules are downloaded and built...
Welcome to the Marine REPL (version 0.24.0)
$ fluence service repl http_handler
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ fluence service repl http_handler
$ fluence service repl http_requester

```

Without worrying about our facade module, i.e., the module we want to use the curl-adapter from, go ahead and build the project with `fluence build` and fire up the REPL with `fluence service repl http_requester` and use the `i` or `interface` command to display the public interfaces of all loaded modules:
Compile the code and let's have a look at it in the Marine REPL with `fluence service repl http-enabled`. Bur before you do, make sure you have the following directory in `.fluence/tmp/volumes/id-token`; if it's not there, create it. Back to the repl:
Copy link
Member

@folex folex May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Compile the code and let's have a look at it in the Marine REPL with `fluence service repl http-enabled`. Bur before you do, make sure you have the following directory in `.fluence/tmp/volumes/id-token`; if it's not there, create it. Back to the repl:
Compile the code and let's have a look at it in the Marine REPL with `fluence service repl http-enabled`. But before you do, make sure you have the following directory in `http-enabled/.fluence/tmp/volumes/particles/id-token/curl_effector_dir`; if it's not there, create it:
# from the 'http-enabled' project root:
mkdir -p .fluence/tmp/volumes/particles/id-token/curl_effector_dir
Back to the repl:

}
}
}
As a last step, deploy your service to either `dar` or `local` and let's update our `aqua.main` so we can run the deployed code:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to deploy on DAR? Maybe leave a link or something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't have a link. since all you have to do is set the env to dar and fluence deploy. it's introduced here https://fluence.dev/docs/build/quickstarts/your_first_function by example.

boneyard93501 and others added 3 commits May 23, 2024 11:42
Co-authored-by: folex <0xdxdy@gmail.com>
Co-authored-by: folex <0xdxdy@gmail.com>
Co-authored-by: folex <0xdxdy@gmail.com>
// mostly for demo purposes, note how this fucntion is not wrapped in marine
// and therefore not available to be called. check the REPL output.
fn get_timezone(timezone: &String) -> SimpleResult {
```python
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why python? :)

Suggested change
```python
```aqua

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much nicer hghlights

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicer then our official highlights that are used in vscode and everywhere else in the docs?

Copy link
Collaborator

@shamsartem shamsartem Jun 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah you probably mean the syntax highlighting in your editor - this will be without syntax highlighting, yeah. But I made it so in docusaurus our vscode syntax highlighting for aqua and air is used, which looks great in my opinion, if you agree - let's do dedicated aqua and air code blocks in docusaurus

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants