Skip to content

Commit 89e06eb

Browse files
Readme.md update and sdk version bump (#29)
1 parent f0f4bfc commit 89e06eb

File tree

3 files changed

+82
-22
lines changed

3 files changed

+82
-22
lines changed

README.md

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,104 @@ This GitHub repository provides a template with example code to implement an Air
88

99
2\. Install [jq](https://jqlang.github.io/jq/download/).
1010

11-
## Build, Deploy and Run
11+
3\. Install [Node.js](https://nodejs.org/en/download/).
12+
13+
4\. Install [ngrok](https://ngrok.com/download).
14+
15+
## Getting Started
1216

1317
1\. Create a new repository:
1418

1519
- Create a new repository from this template by clicking the "Use this template" button in the upper right corner and then "Create a new repository".
1620
- The repository name must start with `airdrop-` (e.g., `airdrop-<external system>-snap-in`).
1721

18-
2\. Open the project in your IDE and set up project environment variables, by following these steps:
22+
2\. Open the project in your IDE and authenticate to your DevRev organization using the DevRev CLI:
23+
24+
```bash
25+
devrev profiles authenticate --org <your DevRev Organization slug>
26+
```
27+
28+
3\. Install the Snap-in dependencies from the `code` directory:
29+
30+
```bash
31+
npm ci
32+
```
33+
34+
4\. Start the Snap-in development server from the `code` directory:
35+
36+
```bash
37+
npm run test:server -- local
38+
```
39+
40+
This will start the Snap-in server on `http://localhost:8000`.
41+
42+
5\. Start the ngrok tunnel in a separate terminal window:
43+
44+
```bash
45+
ngrok http 8000
46+
```
47+
48+
This will create a tunnel to your local server. The ngrok forwarding URL will be displayed in the terminal window.
49+
50+
6\. Copy the ngrok forwarding URL and create a new Snap-in version and Snap-in package using the DevRev CLI:
51+
52+
```bash
53+
devrev snap_in_version create-one --manifest ./manifest.yaml --create-package --testing-url <ngrok forwarding URL>
54+
```
55+
56+
7\. Create a Snap-in draft using the DevRev CLI:
57+
58+
```bash
59+
devrev snap_in draft
60+
```
61+
62+
8\. After the Snap-in draft is created, install the Snap-in in the DevRev UI (`Settings` -> `Snap-ins` -> `Installed` -> `<your Snap-in>` -> `Install snap-in`) or using the DevRev CLI:
63+
64+
```bash
65+
devrev snap_in activate
66+
```
67+
68+
9\. Start the import (`Airdrops` -> `Start Airdrop` -> `<your Snap-in>`).
69+
70+
## Build, Deploy and Run
71+
72+
1\. Open the project in your IDE and set up project environment variables, by following these steps:
1973

2074
- Rename `.env.example` to `.env`.
2175
- In `.env` set the slug of your organization, and your email.
2276

23-
4\. Build the Snap-in using the following command:
77+
2\. Build the Snap-in using the following command:
2478

2579
```bash
2680
make build
2781
```
2882

29-
5\. Deploy the Snap-in to the organization:
83+
3\. Deploy the Snap-in to the organization:
3084

3185
```bash
3286
make deploy
3387
```
3488

3589
NOTE: This process may take some time. Command authenticates you to the org using the DevRev CLI, creates a Snap-in package, its Snap-in version, and finally the Snap-in draft.
3690

37-
6\. After the Snap-in draft is created, install the Snap-in in the DevRev UI (`Settings` -> `Snap-ins` -> `Install snap-in`).
91+
4\. After the Snap-in draft is created, install the Snap-in in the DevRev UI (`Settings` -> `Snap-ins` -> `Installed` -> `<your Snap-in>` -> `Install snap-in`) or using the DevRev CLI:
92+
93+
```bash
94+
devrev snap_in activate
95+
```
3896

39-
7\. Start the import (`Imports` -> `Start import` -> `<your Snap-in>`).
97+
5\. Start the import (`Airdrops` -> `Start Airdrop` -> `<your Snap-in>`).
4098

4199
## Common Pitfalls
42100

43-
#### Q: `Conflict` error after the `Creating snap-in package...` output during `make deploy`.
101+
- `Conflict` error after the `Creating snap-in package...` output during `make deploy`.
44102

45-
A: Snap-in package with the same slug already exists. Override the `SNAP_IN_SLUG` variable by explicitly updating the variable in `scripts/vars.sh`.
103+
- Snap-in package with the same slug already exists. Override the `SNAP_IN_SLUG` variable by explicitly updating the variable in `scripts/vars.sh`.
46104

47-
#### Q: Snap-in version `build/deployment failed` after the `Waiting for snap-in version to be ready...` message
105+
- Snap-in version `build/deployment failed` after the `Waiting for snap-in version to be ready...` message
48106

49-
A: The snap-in version could not be built. Check the logs by running the DevRev CLI command `devrev snap_in_package logs`. For prettier UI, pipe the output to `jq`
107+
- The snap-in version could not be built. Check the logs by running the DevRev CLI command `devrev snap_in_package logs`. For prettier UI, pipe the output to `jq`
50108

51-
### Q: `Token is expired` when deploying or cleaning up.
109+
- `Token is expired` when deploying or cleaning up.
52110

53-
A: Authentication token to the `DEV_ORG` has expired. Run `make auth` to reconnect to the organization.
111+
- Authentication token to the `DEV_ORG` has expired. Run `make auth` to reconnect to the organization.

code/package-lock.json

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"yargs": "^17.6.2"
5656
},
5757
"dependencies": {
58-
"@devrev/ts-adaas": "1.2.2",
58+
"@devrev/ts-adaas": "1.2.3",
5959
"axios": "^1.7.7",
6060
"dotenv": "^16.0.3",
6161
"js-jsonl": "^1.1.1",

0 commit comments

Comments
 (0)