Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ernitingarg/blockchain-functions-golang


https://github.com/ernitingarg/blockchain-functions-golang

Last synced: about 4 hours ago
JSON representation

Awesome Lists containing this project

README

        

# Soteria Blokchain Functions

## Dependencies

- Google cloud SDK
- Go (1.11 or higher)

## Prerequisites

Make sure to be logged in to GCP in your cli
```
gcloud auth login
```
In order to run the function locally, you need to have the default credentials set.
The easiest way to go is via gcloud cli:
```
gcloud auth application-default login
```
Now you should be able to boot a local server that can run your functions like this:
```
make serve
```
## Usage

Use make file for easier commands

### Functions management

#### 1. Deploy a function:

------------
Deploy a function into GCP `Cloud Functions`
```
# for dev/staging environment
make deploy-fn fn=

# for prod
make deploy-fn-prod fn=
```
#### 2. Call a function
----------------
Calls a function hosted in GCP `Cloud Functions` from your local
```
# for dev/staging environment
make call-fn fn=

# for prod
make call-fn-prod fn=
```

### 3. Run a function from local server
-----------------
After booting up a local server, you can use curl or postman to run any function defined locally even if it is not deployed yet.
Make sure to have default credentials and the server running first.
```
curl http://localhost:8080/
```