Quickstart
This guide takes you through your first steps with Restate.
- TypeScript
- Java
- Kotlin
- Go
- Python
- Rust
- TypeScript: Latest stable version of NodeJS >= v18.17.1 and npm CLI >= 9.6.7
- Install the Restate Server & CLI
Get the Greeter service template
Download the Node template with a skeleton of a Restate service. And install its dependencies:
npx -y @restatedev/create-app@latest && cd restate-node-template && \npm install
Run the Greeter service
Now, start developing your service in src/app.ts
. Run it with ts-node-dev
, and let it listen on port 9080
for requests:
npm run app-dev
Launch Restate
Restate is a single self-contained binary. No external dependencies needed. Once you have installed the Restate Server, run it locally via:
restate-server
Register the service
Tell Restate where the service is running, so Restate can discover and register the services and handlers behind this endpoint:
If you run Restate with Docker, use http://host.docker.internal:9080
instead of http://localhost:9080
.
Output
โฏ SERVICES THAT WILL BE ADDED:- GreeterType: ServiceHANDLER INPUT OUTPUTgreet value of content-type 'application/json' value of content-type 'application/json'โ Are you sure you want to apply those changes? ยท yesโ
DEPLOYMENT:SERVICE REVGreeter 1
Send a request to the Greeter service
curl localhost:8080/Greeter/greet -H 'content-type: application/json' -d '"Hi"'
You should now see printed as response: Hi!
Congratulations, you managed to run your first Restate service!
Next: Build and run the app
Once you have implemented your service, build the app and run it with:
npm run buildnpm run app
- Java: JDK >= 11
- Install the Restate Server & CLI
Get the Greeter service template
Run the Greeter service
You are all set to start developing your service.
Open the project in an IDE and configure it to build with Gradle.
Run your service and let it listen on port 9080
for requests:
./gradlew run
Launch Restate
Restate is a single self-contained binary. No external dependencies needed. Once you have installed the Restate Server, run it locally via:
restate-server
Register the service
Tell Restate where the service is running, so Restate can discover and register the services and handlers behind this endpoint:
If you run Restate with Docker, use http://host.docker.internal:9080
instead of http://localhost:9080
.
Output
โฏ SERVICES THAT WILL BE ADDED:- GreeterType: ServiceHANDLER INPUT OUTPUTgreet value of content-type 'application/json' value of content-type 'application/json'โ Are you sure you want to apply those changes? ยท yesโ
DEPLOYMENT:SERVICE REVGreeter 1
Send a request to the Greeter service
curl localhost:8080/Greeter/greet -H 'content-type: application/json' -d '"Hi!"'
You should now see printed as response: Hi!
Congratulations, you managed to run your first Restate service!
Next: Build the app
Once you have implemented your service, build the app with:
./gradlew build
- Java/Kotlin: JDK >= 11
- Install the Restate Server & CLI
Get the Greeter service template
Run the Greeter service
You are all set to start developing your service.
Open the project in an IDE and configure it to build with Gradle.
Run your service and let it listen on port 9080
for requests:
./gradlew run
Launch Restate
Restate is a single self-contained binary. No external dependencies needed. Once you have installed the Restate Server, run it locally via:
restate-server
Register the service
Tell Restate where the service is running, so Restate can discover and register the services and handlers behind this endpoint:
If you run Restate with Docker, use http://host.docker.internal:9080
instead of http://localhost:9080
.
Output
โฏ SERVICES THAT WILL BE ADDED:- GreeterType: ServiceHANDLER INPUT OUTPUTgreet value of content-type 'application/json' value of content-type 'application/json'โ Are you sure you want to apply those changes? ยท yesโ
DEPLOYMENT:SERVICE REVGreeter 1
Send a request to the Greeter service
curl localhost:8080/Greeter/greet -H 'content-type: application/json' -d '"Hi"'
You should now see printed as response: Hi!
Congratulations, you managed to run your first Restate service!
Next: Build the app
Once you have implemented your service, build the app with:
./gradlew build
- Go: >= 1.21.0
- Install the Restate Server & CLI
Get the Greeter service template
Run the Greeter service
Now, start developing your service in greeter.go
. Run it with:
go run .
it will listen on port 9080 for requests.
Launch Restate
Restate is a single self-contained binary. No external dependencies needed. Once you have installed the Restate Server, run it locally via:
restate-server
Register the service
Tell Restate where the service is running, so Restate can discover and register the services and handlers behind this endpoint:
If you run Restate with Docker, use http://host.docker.internal:9080
instead of http://localhost:9080
.
Output
โฏ SERVICES THAT WILL BE ADDED:- GreeterType: ServiceHANDLER INPUT OUTPUTGreet value of content-type 'application/json' value of content-type 'application/json'โ Are you sure you want to apply those changes? ยท yesโ
DEPLOYMENT:SERVICE REVGreeter 1
Send a request to the Greeter service
curl localhost:8080/Greeter/Greet -H 'content-type: application/json' -d '"Hi"'
You should now see printed as response: Hi!
Congratulations, you managed to run your first Restate service!
Next: Build and run the app
Once you have implemented your service, build the app with:
go build .
- Python >= v3.11
- Install the Restate Server & CLI
Get the Greeter service template
Run the Greeter service
Create a venv
and install the requirements:
python3 -m venv .venvsource .venv/bin/activatepip install -r requirements.txt
Now, start developing your service in example.py
. Run it with a Hypercorn server, and let it listen on port 9080
for requests:
python -m hypercorn --config hypercorn-config.toml example:app
Launch Restate
Restate is a single self-contained binary. No external dependencies needed. Once you have installed the Restate Server, run it locally via:
restate-server
Register the service
Tell Restate where the service is running, so Restate can discover and register the services and handlers behind this endpoint:
If you run Restate with Docker, use http://host.docker.internal:9080
instead of http://localhost:9080
.
Output
โฏ SERVICES THAT WILL BE ADDED:- GreeterType: ServiceHANDLER INPUT OUTPUTgreet value of content-type 'application/json' value of content-type 'application/json'โ Are you sure you want to apply those changes? ยท yesโ
DEPLOYMENT:SERVICE REVGreeter 1
Send a request to the Greeter service
curl localhost:8080/Greeter/greet -H 'content-type: application/json' -d '"Hi"'
You should now see printed as response: Hi!
Congratulations, you managed to run your first Restate service!
Get the Greeter service template
Run the Greeter service
Use cargo run
to build and run the example:
cargo run
Launch Restate
Restate is a single self-contained binary. No external dependencies needed. Once you have installed the Restate Server, run it locally via:
restate-server
Register the service
Tell Restate where the service is running, so Restate can discover and register the services and handlers behind this endpoint:
If you run Restate with Docker, use http://host.docker.internal:9080
instead of http://localhost:9080
.
Output
โฏ SERVICES THAT WILL BE ADDED:- GreeterType: ServiceHANDLER INPUT OUTPUTgreet value of content-type 'application/json' value of content-type 'application/json'โ Are you sure you want to apply those changes? ยท yesโ
DEPLOYMENT:SERVICE REVGreeter 1
Send a request to the Greeter service
curl localhost:8080/Greeter/greet -H 'content-type: application/json' -d '"Francesco"'
You should now see printed as response: "Greetings Francesco"
Congratulations, you managed to run your first Restate service!
Next stepsโ
- Read the Concepts
- Discover the key features of Restate in the Tour of Restate
- Run the examples