[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Jul 3, 2018. It is now read-only.

Swarm City Labs' // The nodejs and solidity files needed to run the gas station as a service (GaaS) . ;)

Notifications You must be signed in to change notification settings

swarmcity/SCLabs-gasstation-service

Repository files navigation

sc-gasstation

An experimental service providing a way to exchange ERC20 tokens in ETH to pay for future transactions.

Introduction

We presented the gasstation on DEVCON3 (Nov 4th 2017). You can view the video here :

SwarmCity GasStation on DEVCON3

Installing

$ npm install -g ethereumjs-testrpc
$ npm install -g generate-contract-interface
$ npm install -g browserify
$ npm install

Now create contract interfaces and browserify utility library

. ./build.sh

Running Truffle tests

Gasstation using the push-fill ( where gasstation service triggers the tokens->ETH exchange )

$ truffle test test/gasStation-pushfill.js

Running the gasstation API service

In one terminal - start testRPC

$ testrpc -p 18546

in another terminal - create a file .env containing these parameters :

privatekey="(a private key holding the ETH to supply the upfront gas)"
gastankaddress="(the address of the gastank contract)"
erc20token="(the address of the ERC20 token your gastank accepts)"
PORT=3000

Now start up your gastank

nodemon

or

node index.js

Frontend

A sample frontend that uses the gastank API can be found here : https://github.com/swarmcity/sc-gasstationclient

Fill me up

About

Swarm City Labs' // The nodejs and solidity files needed to run the gas station as a service (GaaS) . ;)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published