Skip to content

AdChain/loopback-connector-web3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ethereum Web3 LoopBack connector 👍

The web3 connector is still early alpha - DO NOT USE IN PRODUCTION. :shipit:

Configuration

datasources.json :

...
"ethereum": {
    "name": "ethereum",
    "connector": "web3",
    "url":<optional>
  },
...  

If you do NOT specify a RPC URL, the connector will assume "http://localhost:8545". Don't want to run your own node? Check out Infura!

Now just create a model that represents your Solidity based smart contract, for example

{
  "name": "Contract",
  "plural": "contracts",
  "base": "Model",
  "idInjection": true,
  "options": {
    "validateUpsert": true
  },
  "properties": {},
  "validations": [],
  "relations": {},
  "acls": [],
  "methods": {},
  "ethereum":{
    "contract":{
      "sol": "server/SimpleStorage.sol",
      "name":"SimpleStorage"
    },
    "gas": 3000000
  }
}

where "SimpleStorage" (above) is the name of the constructor for the smart contract. The connector will compile the contract and doing a POST at the model base route will deploy the contract and return the contract address.

Example 👈

For an example to get you up and running, checkout the web3 demo.

Dapps 🙌

The future 🚀

Keep in touch 👋👋👋

If you are building a decentralized application using the web3 connector, tweet me : @jamesyoung and I'll add you to the list of dapps.

About

ethereum web3 based loopback connector

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published