Orders management - Specifications
Starting the development
Requirements
To generate a workflow, you’ll need to have the following tools installed: Install yarn if you don’t have it already:@stratumn packages of the exercise, so npm needs a token first. Create a personal access token with the api scope on git.sia.partners, under User settings → Access tokens, and add it to your ~/.npmrc:
stratumn --version.
Once you’re logged in, ask your onboarding buddy (or anyone who is a superuser on staging) to give you the developer role. It’s the “developer role” switch next to your name in your organization’s members, on account.staging.stratumn.com. You can’t generate without it, so ask on day one.
Stratumn CLI - Getting started
Setup the project
Clone the repository and open it inOrders management - Repository
Generating the workflow
While developing, you’ll be generating in the staging environment. You generate with your own account, thanks to the developer role you asked for above. No admin password needed. In the.env.local-to-staging file, replace REPLACE_ME_AFTER_FIRST_GENERATION in the WORKFLOWS variable with an empty string: WORKFLOWS='{"ordersManagement":""}'.
Your workflow will be named ⚒️ Orders Management - <your git user.name>, so you can find yours in staging. If git has no user.name yet, run git config --global user.name "Your Name". To use another name, set YOUR_NAME in the same file.
To generate the workflow, run the following command at the root of the project:
generate:local-to-staging script as you. Add --dry-run first to see the script and the .env file it will use, without generating.
If it refuses, its message says what to fix. The CLI guide lists the usual cases.
When generating for the first time a workflow, you will create a new ID. This
ID will be displayed in the console, after
# in the “Built workflows”
summary. Copy this ID and use it to update the WORKFLOWS variable in the
.env.local-to-staging file, for example
WORKFLOWS='{"ordersManagement":"1838"}'. You’ll need to run the generation
command again for it to be fully functional. The summary prints no link for
this environment: use the URL below.That’s it! You’ve generated your first workflow 🚀 Check it in the staging
environment at
https://trace.staging.stratumn.com/workflow/your_workflow_id