https://github.com/eigr/spawn-node-sdk
https://github.com/eigr/spawn-node-sdk
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/eigr/spawn-node-sdk
- Owner: eigr
- License: apache-2.0
- Created: 2022-07-05T13:59:13.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-30T17:47:59.000Z (over 1 year ago)
- Last Synced: 2025-04-07T18:02:17.081Z (about 1 year ago)
- Language: TypeScript
- Size: 431 KB
- Stars: 5
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# [Spawn](https://github.com/eigr/spawn)
**Spawn Actor Mesh Runtime for Node/Bun**
## **Installation**
### Install Spawn CLI
```SH
curl -sSL https://github.com/eigr/spawn/releases/download/v1.4.3/install.sh | sh
```
# **Getting Started**
_We recommend you to use Typescript for better usage overall._
This lib supports both Bun and NodeJS runtimes, Bun performs invocations ~2x faster, we recommend using Bun.
### Create a new project with
```SH
spawn new node hello_world
```
### Run the new project with your preferred package manager
```SH
# with yarn
yarn start
# or with pnpm
pnpm start
# or if you want to use bun instead of NodeJS use:
yarn start-bun
```
### Run the Spawn Proxy using the CLI for dev purposes
```SH
spawn dev run -p ./protos -s spawn-system -W
```
### Invoking the actor
Thats it! You can test invoking the hello world actor with our pre configured HTTP activator.
```SH
curl -vvv -H 'Accept: application/json' http://localhost:9980/v1/hello_world?message=World
```
## **Documentation**
- [Actor options](./documentation/actor-options.md)
- [Unnamed](./documentation/actor-options.md#unnamed-actor)
- [Named](./documentation/actor-options.md#named-actor)
- [Default Actions](./documentation/actor-options.md#default-actions)
- [Actor workflows](./documentation/actor-workflows.md)
- [Invocations](./documentation/invocations.md)
- [More info on Spawn](https://github.com/eigr/spawn/blob/main/docs/index.md)
## **Examples**
You can check [test folder](./test) to see some examples
## **Environment variables:** (you don't need to worry if you are using spawn proxy)
- `PROXY_HTTP_PORT` This is the port of spawn proxy service
- `PROXY_HTTP_HOST` This is the host of spawn proxy service
- `USER_FUNCTION_PORT` This is the port that your service will expose to communicate with Spawn