ethweb

0.0.4 • Public • Published

Ethereum Web Services

Install


npm i ethweb --save

Usage Example

when you have a running server

const ethweb = require('ethweb')

 
const config = {

   addr:  3000, //port of your local server (can be anything, but usually expressjs)

   privateKey:  "0x1234...1234", // generate private key with Metamask or other wallet

   tgappsAddress:  "ws://SERVER_ADDRESS"  // ethweb server

}


ethweb.connect(config, 
   (err, info)=> { 
      console.log(err, info) 
})

  
// open 0xYOUR_ADDRESS.manipark.com

// once you refresh your server you will receive instant public updates 

when you just have static files


npm i ethweb -g 
npm i express -g

const ethweb = require('ethweb')
const express = require('express')

const app = express();
 
const config = {

   addr:  3000,

   privateKey:  "0x1234...1234", // generate private key with Metamask or other wallet

   tgappsAddress:  "ws://SERVER_ADDRESS"  // ethweb server

   staticFilesFolder: './your_static_folder'

}


app
   .use(express.static(config.staticFilesFolder))
   .listen(config.addr, ()=> {

      ethweb.connect(config, 
         (err, info)=> { 
            console.log(err, info) 
      })

})




// open 0xYOUR_ADDRESS.ethweb.org

// once you refresh your server you will receive instant public updates 

Readme

Keywords

none

Package Sidebar

Install

npm i ethweb

Weekly Downloads

1

Version

0.0.4

License

none

Unpacked Size

25.9 kB

Total Files

19

Last publish

Collaborators

  • askucher