This is a Serverless app (for AWS Lambda) that runs periodically every day and buys ETH and BTC from bitstamp. The credentials are encrypted using AWS Key Management Service (KMS).
We will use the encryption/decryption API of AWS KMS to generate a file containing the encrypted version of our Bitstamp credentials.
After you installed Serverless framework, and cloned the project, proceed with the following steps.
- You need to create a KMS key in AWS console (look under IAM)
- Copy the KMS key ARN identifier (something like:
arn:aws:kms:eu-west-1:123456789012:key/xxxxxxxxxxx-xxxx-xxxxxxxxxxxx
) - Copy the ARN in
serverless.yml
- Create a string with your Bitstamp API credentials, in this form:
client_id,key,secret
- Encrypt the string using aws command line, or this simple npm based tool called kms-cli
- Dump the encrypted string to a file called
encrypted-secret
in the main dir - Configure the amounts to buy daily and your base FIAT currency in the serverless.yml
- Everything is ready,
serverless deploy -v
You can now test the lambda function from AWS Console, if it all works, tonight at midnight you'll have some crypto in your Bitstamp balance :)