Learn more by reading the blog post: Serverless Smart Contract Automation.
Description | Stack | |
---|---|---|
contracts |
🖼 Smart contract ABIs | json , ethereum |
functions |
🚀 Lambda functions | node , js |
Install the Serverless Framework CLI.
git clone [email protected]:CryptoUnico/serverless.git
cd serverless
nvm use
npm install
You can find and update the function's configuration in serverless.yml
:
service: serverless
provider:
name: aws
runtime: nodejs12.x
region: ap-southeast-1
timeout: 30
environment:
DEFAULT_GAS_PRICE: 60000000000
MNEMONIC: ...
This example uses the following environment variables:
DEFAULT_GAS_PRICE
: Default gas price used when making write transactions.MNEMONIC
: 12-word mnemonic used to derive an Ethereum address, make sure it's funded with Ether if you intend to write data to Ethereum!SLACK_HOOK_URL
: The example sends messages to Slack using Incoming Webhooks. You can get this URL from your Slack dashboard. (Optional)
You can change your deployed function's environment variables on the fly from the AWS Lambda console.
serverless invoke local --function exec
This will execute the smart contract function from your local machine. Great for debugging and testing.
npm i -D serverless-dotenv-plugin
serverless deploy
serverless 2021+, Uni. Released under the MIT License.
GitHub @CryptoUnico