Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
344 changes: 252 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,126 +1,286 @@
<a href="https://squeezer.io" target="_blank"><img width="700" height="auto" src="./readme-introduction.gif"></a>
---
title: Introduction - Get started
---

#### Framework : [squeezer.io](https://squeezer.io)
#### Docs : [squeezer.io/docs](https://squeezer.io/docs/)
#### Chat : [chat.squeezer.io](http://chat.squeezer.io)
### Platform

[![Squeezer.IO](https://cdn.rawgit.com/SqueezerIO/squeezer/9a010c35/docs/gitbook/images/badge.svg)](https://Squeezer.IO)
[![Build Status](https://travis-ci.org/SqueezerIO/squeezer.svg?branch=master)](https://travis-ci.org/SqueezerIO/squeezer)
[![npm version](https://badge.fury.io/js/squeezer-cli.svg)](https://badge.fury.io/js/squeezer-cli)
[![Join the chat at https://gitter.im/SqueezerIO/squeezer](https://badges.gitter.im/SqueezerIO/squeezer.svg)](https://gitter.im/SqueezerIO/squeezer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![DUB](https://img.shields.io/dub/l/vibe-d.svg)]()
#### Login and SSO

### Contents
The Squeezer platform will support multiple code repositories integration and SSO third-party vendors.

* [Getting Started](#getting-started)
* [Example Projects](#example-projects)
* [Features](#features)
* [Templates](#templates)
* [Plugins](#plugins)
* [Example Projects](#example-projects)
* [Contributing](#contributing)
* [Community](#community)
* [Meetups](#meetups)
<img src="https://squeezer.io/images/platform/login.png" />

### What is Squeezer ?
#### Overview

Squeezer is a framework designed to help developers to get a better architecture on serverless
zero-administration compute platforms where code runs on the top of
`functions` clouds like
[AWS Lambda](https://aws.amazon.com/documentation/lambda/) , [Azure Functions](https://azure.microsoft.com/en-us/services/functions/) , [IBM OpenWhisk](https://developer.ibm.com/openwhisk/) & [Google Functions](https://cloud.google.com/functions/)
The “overview” dashboard will display information about current deployments split into multiple stages; this way, a project’s team is in-sync for the entire development cycle.

### <a name="features"></a>Features in short
<img src="https://squeezer.io/images/platform/overview.png" />

- [Swagger UI](http://swagger.io/) API REST documentation support
- **SEO-friendly** web apps
- share components between functions
- auto-deployable, auto-scalable , no DevOps requirements
- silent deployments ,no interruption for the current functionality ( really useful on production )
- access deployed resources credentials (DB user, pass ...) directly from `process.env` variables
- one single command to simultaneously deploy all available functions on your project
- quick intuitive code deployments by using a special mechanism which will deploy only assets, functions and file packages
where code changed from the last deployment
- automatic rollback to the previous working deployment if something goes wrong
- sequential deployments, wait for the current deployments in progress to finish
- self-healing functions
- test your code locally on a simulated functions platform for a faster development cycle
- separate your environments in multiple stages
- extend framework functionality with your own "home-made" plugins
- pay only for the usage ( no monthly subscriptions )
- competitive pricing ( >= 2$ / 1 million HTTP requests )
- smart external dependencies inclusion into the compiled function ( **node_modules** and other project files ) ... just
like on any other trivial NodeJS project
- Webpack integration
#### Deploys

#### Requirements
This section will allow developers to get more detailed information about the deployment in progress. They can trigger retries on a specific deployment or clear the deployment cache in order to fix crashed builds.

- [Install node.js](http://nodejs.org/) version `>=6`
<img src="https://squeezer.io/images/platform/deploys.png" />

### Squeezer CLI
#### Settings

> Squeezer command-line interface
The settings section will provide most of the required input fields to make the developer’s experience of the platform as straightforward and intuitive as possible.

#### <a name="templates"></a>Templates
<img src="https://squeezer.io/images/platform/settings.png" />

Create a quick project stub by using templates :
### Install Squeezer's command line tool

| template | description |
|-----|--------------|
|api-nodejs | AWS generic API app template. |
`npm install squeezer-cli -g`

#### <a name="plugins"></a>Plugins
### Using the CLI

Extend or merge the Squeezer framework functionality with plugins
1. Create a new project . `sqz create --project my-first-project --template api-nodejs`
2. `cd my-first-project`
3. `sqz install` - Install all project's packages ( npm ... )
4. `sqz compile` - Compile functions , sources , ...
5. `sqz serve` - Will start a live-reloading development environment accessible at `localhost:4001` ( **Live compiling** )

| Plugin | Author |
|-----|--------------|
|**[Serve Plugin](https://github.com/SqueezerIO/squeezer-serve)** <br/> This plugin enables serving support for local development within the Squeezer Framework. | [Nick Chisiu](https://github.com/nickchisiu) |
|**[Swagger Plugin](https://github.com/SqueezerIO/squeezer-swagger)** <br/> This plugin enables Swagger API Documentation support within the Squeezer Framework. | [Nick Chisiu](https://github.com/nickchisiu) |
### Deploy a project

#### <a name="example-projects"></a>Example Projects
Configure provider & setup credentials

| Project Name | Author | Demo |
|-------------|------|---------|
| **[Generic API](https://github.com/SqueezerIO/example-projects/tree/master/api-nodejs)** <br/> Generic API Hello World + Swagger API Docs | [Nick Chisiu](https://github.com/nickchisiu) | [demo]() |
| **[REST API](https://github.com/SqueezerIO/example-projects/tree/master/api-rest-nodejs)** <br/> REST API using MongoDB + Swagger API Docs | [Nick Chisiu](https://github.com/nickchisiu) | [demo]() |
1. `sqz install` - Install packages
2. `sqz compile --cloud --stage dev` - Compile functions , sources , ... ( cloud ready )
3. `sqz deploy` - Deploys project into the cloud


#### <a name="getting-started"></a>Getting started

NOTE: **Windows** users should [enable symlinks](http://answers.perforce.com/articles/KB/3472/?q=enabling&l=en_US&fs=Search&pn=1) in order to avoid unwanted symbolic links errors .
## Blockchain Connector

##### Serve
**https://github.com/SqueezerIO/squeezer-blockchain-connector**

| | cmd | description |
|----|-----|--------------|
| 1. | **npm i squeezer-cli -g** | Install Squeezer CLI |
| 2. | **sqz create --project my-first-project --template api-nodejs** | Create a project |
| 3. | **cd my-first-project** | Switch to the project's directory |
| 4. | **sqz install** | Install dependencies |
| 4. | **sqz compile** | Compile functions |
| 5. | **sqz serve** | Development mode<br>**Live compiling** |

##### Deploy
### Initialize

| | cmd | description |
|----|-----|--------------|
| 1. | Configure provider & setup credentials | |
| 2. | **sqz compile --cloud --stage dev** | Compile functions for cloud deployments |
| 3. | **sqz deploy** | Deploy your app into the cloud provider |
```
const blockchainConnector = require('squeezer-blockchain-connector').init({
key : 'squeezer-key',
type: 'ETH',
environment: 'test'
});
```
Created api-key is used when generate new wallet

## Using connector

#### <a name="contributing"></a>Contributing
### Create new Wallet

See [contributing.md](CONTRIBUTING.md) for contribution guidelines
```
POST /v1/wallets/CreateWallet
```

### <a name="community"></a>Community
#### Description
Create new wallet address using api-key

* [Squeezer issues](https://github.com/SqueezerIO/squeezer/issues)
* [Gitter Chatroom](http://chat.squeezer.io/)
* [Facebook](https://www.facebook.com/Squeezer.IO/)
* [Twitter](https://twitter.com/SqueezerIO)
* [Contact Us](mailto:nick@squeezer.io)

### <a name="meetups"></a>Meetups
#### Parameter

* [Workshop: Serverless javascript with Squeezer](https://www.meetup.com/Cluj-Javascripters/events/243915438/?)
* <b>accessKey</b> - api-key generated at connector initialization
* <b>currencyType</b> - what type of wallet want

#### Return format

A JSON object with keystore and address of wallet

#### Example

<b>Request</b>

```
POST /v1/wallets/CreateWallet
```

<b>Body</b>

```
{
"accessKey": "3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4"
}
```

<b>Response</b>
```
{
"version": 3,
"id": "f0efc549-88c0-45cf-9991-6ec53ba7ba13",
"address": "7c110b7761b695d4343f6dfe786a49cd5c03e31e",
"crypto": {
"ciphertext": "6ec3946b5ed85d1acd5c2b67289ea05bee0b3095cdf3661469a6d8acc6cf85f5",
"cipherparams": {
"iv": "ea54225d082c7a010467d73b3a309eda"
},
"cipher": "aes-128-ctr",
"kdf": "scrypt",
"kdfparams": {
"dklen": 32,
"salt": "dfc9c26cda4253852b93c60f7d7099a5b3f127031faf19e2dbf0593a0d3190f8",
"n": 262144,
"r": 8,
"p": 1
},
"mac": "ce5c87d1b0d0b2df0fbe4f389806594203fa091be4beaa6bfa6e1a10856d369e"
}
}
```

### Get balance

```
POST /v1/wallets/GetBalance
```

#### Description

Get balance of specified address

#### Parameters

* <b>walletAddress</b> - wallet's address
* <b>network</b> - if use test environment should be passed network (rinkeby, ropsten, kovan - ETH, bitcoin-testnet -BTC)

#### Return format
A string with amount of wallet

#### Example
<b>Request</b>
```
POST /v1/wallets/GetBalance
```
<b>Body</b>
```
{
"walletAddress": "0xc1f9e93081e7797ec3ef2134e0e656b2c8d542f1"
}
```
<b>Response</b>
```
"1.895178899999999998"
```
### Send transaction

```
POST /v1/blockchainlink/SendTransaction
```

#### Description

Send coins from one wallet to another

#### Parameters

* <b>toWallet</b> - wallet's address
* <b>currencyType</b> - what type of wallet want
* <b>amount</b> - amount of coins
* <b>keyStore</b> - fromWallet's keystore
* <b>accessKey</b> - api-key used to generate wallet
* <b>network</b> - if use test environment should be passed network (rinkeby, ropsten, kovan - ETH and bitcoin-testnet -BTC)

#### Return format

A JSON object that contain informations about that transaction

#### Example

<b>Request</b>
```
POST /v1/wallets/SendTransaction
```
<b>Body</b>
```
{
"toWallet": "0x8a5cf6d5e86ebfe3e1ab573d1eafc299c04c8cf9",
"amount": 0.001,
"keyStore": {
"version": 3,
"id": "0af46c1e-4d02-4f9b-af62-ec358612a3c2",
"address": "c1f9e93081e7797ec3ef2134e0e656b2c8d542f1",
"crypto": {
"ciphertext": "cc3bb088bd53ea45172b0ab5f01c9e28e6b7b3743a589a4437844b9fce922888",
"cipherparams": {
"iv": "55b1aeeffa8ce3ffe24a488e58174c0f"
},
"cipher": "aes-128-ctr",
"kdf": "scrypt",
"kdfparams": {
"dklen": 32,
"salt": "0c990d41edcf0d8f5541713ef0e2f0629366ffadb8190b0d3a32755488de6877",
"n": 262144,
"r": 8,
"p": 1
},
"mac": "4ea78c87318dbe87ac4e109845301d248d4caf25f82882dff1fbaa1fe4b3d70c"
}
},
"accessKey": "3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4",
"network" : "rinkeby"
}
```
<b>Response</b>
```
{
"transaction": {
"transaction": "0xad63f8fc7db990058ef3ec6433190cbc5b0e0af670be79c49a70d8e1daacfb29",
"transactionStatus": 0,
"_id": "5ab2b1fd6e578b3ae275e351",
"__v": 0
}
}
```
### Get transaction

```
POST /v1/blockchainlink/GetTransaction
```

#### Description

Get info about one transaction

#### Parameters

* <b>transactionHash</b> - transaction hash returned by SendTransaction
* <b>network</b> - if use test environment should be passed network (rinkeby, ropsten, kovan - ETH and bitcoin-testnet -BTC)

#### Return format

A JSON object that contain informations about transaction

#### Example

<b>Request</b>
```
POST /v1/wallets/GetTransaction
```
<b>Body</b>
```
{
"transactionHash": "0xad63f8fc7db990058ef3ec6433190cbc5b0e0af670be79c49a70d8e1daacfb29",
"currencyType" : "ETH",
"network" : "rinkeby"
new
}
```
<b>Response</b>
```
{
"blockHash": "0xb589d75b759436e43381dc30f89a792f6f7bace421bf04f5eb1f2cca7c8e0628",
"blockNumber": 1972693,
"from": "0xc1f9e93081e7797ec3ef2134e0e656b2c8d542f1",
"gas": 21000,
"gasPrice": "1000000000",
"hash": "0xad63f8fc7db990058ef3ec6433190cbc5b0e0af670be79c49a70d8e1daacfb29",
"input": "0x",
"nonce": 11,
"to": "0x8a5cf6d5e86ebfe3e1ab573d1eafc299c04c8cf9",
"transactionIndex": 9,
"value": "1000000000000000",
"v": "0x1b",
"r": "0xf62198309971d6c3725f2f0cddc7eb60da5715fed89b597d4a273322313aebe4",
"s": "0x5b86ac969b259c73d7fccc3dec9f28fdbdc024a8f72c842939baeb198eb9b6b1"
}
```
2 changes: 1 addition & 1 deletion bin/Squeezer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Squeezer {
},
functions: {},
hooks: [],
apiBaseUrl: 'https://api.squeezer.io',
apiBaseUrl: 'https://api.squeezer.io/prod',
outputs: {},
assets: {
functions: [],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "squeezer-cli",
"version": "1.1.27",
"version": "1.1.28",
"preferGlobal": true,
"description": "Event-driven APIs & Web apps on functions, serverless ! Squeezer is a framework designed to help developers to get a better architecture on serverless zero-administration compute platforms with code that runs into cloud functions like [AWS Lambda](https://aws.amazon.com/documentation/lambda/) , [Azure Functions](https://azure.microsoft.com/en-us/services/functions/) , [Google Cloud Functions](https://cloud.google.com/functions/docs/) and [IBM OpenWhisk](https://developer.ibm.com/openwhisk/) .",
"homepage": "https://squeezer.io/",
Expand Down