-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: main
Are you sure you want to change the base?
Effector quickstart #116
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
|
||
## 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*: | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why python? :)
```python | |
```aqua |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much nicer hghlights
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. sounds good.
No description provided.