fostr v1.0.0
Fostr
Deploy serverless Nostr services
Install
Install the Fostr CLI tool globally
npm i fostr -gSetup
Insert your AWS credentials
fostr loginSetup the basic infrastructure needed to run the services
fostr setupIt will initialize a long-running EC2 instance that subscribes to relays and invokes the appropriate services by sending messages to a SQS queue according to their configuration stored in DynamoDB.
Create a new project
Generate template files for a new project
fostr init
Edit the config.json configuration file with the desired filters for events that should invoke the service and src/index.js with your service logic. The service function signature is:
export const handler = async (newEvents, eventStore, state) => {
let currentState = state;
return currentState;
}Where newEvents is an array of Nostr events that triggered the function, eventStore is an ordered list of events that triggered the function in the past and state is a cached current state of the service returned by the last time it was invoked.
Deploy
Deploy your service
fostr deploy1 year ago