Skip to content

yosriady/serverless-ethers

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

serverless-ethers

Learn more by reading the blog post: Serverless Smart Contract Automation.

Table of Contents

Description Stack
contracts 🖼 Smart contract ABIs json, ethereum
functions 🚀 Lambda functions node, js

Prerequisites

Install the Serverless Framework CLI.

Getting Started

git clone git@github.com:yosriady/serverless-ethers.git
cd serverless-ethers
nvm use
npm install

Set your environment variables

You can find and update the function's configuration in serverless.yml:

service: serverless-ethers
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.

Triggering the function locally

serverless invoke local --function exec

This will execute the smart contract function from your local machine. Great for debugging and testing.

Deploying to AWS

serverless deploy

Thanks

serverless-ethers 2020+, Yos Riady. Released under the MIT License.
Authored and maintained by Yos Riady with help from contributors (list).

yos.io  ·  GitHub @yosriady

About

Serverless smart contract automation service, built on the Serverless framework.

Topics

Resources

Stars

Watchers

Forks