A Slack bot for Element DID, the Ethereum implementation of the Sidetree protocol
This bot parses Slack messages in order to extract transaction hashes from Element transactions, and then posts links to the Element Block Explorer to provide richer context about the transaction.
- AWS Lambda for the webhooks
- AWS DynamoDB to store Oauth 2.0 tokens
- Serverless framework to build and deploy
- Setup Serverless with AWS: https://github.com/serverless/serverless#quick-start
- Create a new Slack app https://api.slack.com/apps and get your CLIENT_ID and CLIENT_SECRET
- Create a
secret.dev.yml
file to store the values:
CLIENT_ID: 'YOUR_CLIENT_ID'
CLIENT_SECRET: 'YOUR_CLIENT_SECRET'
We use https://github.com/serverless/serverless-secrets-plugin to encrypt the secrets for our Bot
- Deploy the hooks
serverless deploy
- In the Slack dashboard, setup
- The Incoming Webhook service to allow the bot to post messages
- The Event Subscription service with the
message.channels
bot permissions using yourwebhook
Lambda as theRequest URL
- The Oauth 2.0 service using your
redirectUrl
Lambda as the Redirect URL
# Logs the activity of the webhook Lambda
serverless logs -t -f webhook
# Deploy only the webhook Lambda or all
serverless deploy function -f webhook
serverless deploy
# Encrypt / Decrypt secrets.dev.yml
serverless encrypt --stage dev --password 'your-password'
serverless decrypt --stage dev --password 'your-password'
# Remove all serverless services
serverless remove