All Projects → loomnetwork → Loom Js

loomnetwork / Loom Js

Licence: bsd-3-clause
JS library for building browser apps & NodeJS services that interact with Loom DAppChains

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Loom Js

Angular Truffle Starter Dapp
Angular CLI + Truffle Starter Dapp; write, compile & deploy smart contracts on Ethereum blockchains
Stars: ✭ 174 (-7.94%)
Mutual labels:  blockchain, ethereum
Ethereum Graph Debugger
Ethereum solidity graph plain debugger. To have the whole picture when debugging.
Stars: ✭ 177 (-6.35%)
Mutual labels:  blockchain, ethereum
Eevm
Enclave ready EVM (eEVM) is an open-source, standalone, embeddable, C++ implementation of the Ethereum Virtual Machine.
Stars: ✭ 175 (-7.41%)
Mutual labels:  blockchain, ethereum
Trust Ray
☁️ API for the Trust Wallet. Project no longer supported and current version used as source of transactions and address tokens in Blockatlas https://github.com/trustwallet/blockatlas/blob/master/config.yml#L64
Stars: ✭ 172 (-8.99%)
Mutual labels:  blockchain, ethereum
Learning Blockchain
Tidy up Blockchain ecosystem and tutorial
Stars: ✭ 188 (-0.53%)
Mutual labels:  blockchain, ethereum
Eth Vue
Featured in Awesome Vue [https://github.com/vuejs/awesome-vue], a curated list maintained by vuejs of awesome things related to the Vue.js framework, and Awesome List [https://awesomelists.net/150-Vue.js/3863-Open+Source/18749-DOkwufulueze-eth-vue], this Truffle Box provides everything you need to quickly build Ethereum dApps that have authentication features with vue, including configuration for easy deployment to the Ropsten Network. It's also Gravatar-enabled. Connecting to a running Ganache blockchain network from Truffle is also possible -- for fast development and testing purposes. Built on Truffle 5 and Vue 3, eth-vue uses vuex for state management, vuex-persist for local storage of app state, and vue-router for routing. Authentication functionalities are handled by Smart Contracts running on the Ethereum blockchain.
Stars: ✭ 171 (-9.52%)
Mutual labels:  blockchain, ethereum
Blockchainwallet Crypto
比特币、以太坊公私钥生成以及签名,长时间不维护可移步 https://github.com/QuincySx/ChainWallet
Stars: ✭ 183 (-3.17%)
Mutual labels:  blockchain, ethereum
Cicero
Accord Project Smart Templates Implementation
Stars: ✭ 166 (-12.17%)
Mutual labels:  blockchain, ethereum
Unstoppable Wallet Ios
A secure and decentralized Bitcoin and other cryptocurrency wallet for iPhone. Supports Bitcoin, Ethereum, EOS, Binance Chain, Bitcoin Cash, DASH, ...
Stars: ✭ 180 (-4.76%)
Mutual labels:  blockchain, ethereum
Go Ethereum Hdwallet
Ethereum HD Wallet derivations in Go (golang)
Stars: ✭ 178 (-5.82%)
Mutual labels:  blockchain, ethereum
Armors Solidity
Armors-solidity is a framework to build secure smart contracts on Ethereum.
Stars: ✭ 184 (-2.65%)
Mutual labels:  blockchain, ethereum
Chainbook
📚 区块链上的纸质书交易平台,为未来而构建!
Stars: ✭ 189 (+0%)
Mutual labels:  blockchain, ethereum
Study Blockchain Referrence
区块链学习路上的一些资料作为参考
Stars: ✭ 172 (-8.99%)
Mutual labels:  blockchain, ethereum
Ultimateicocalendar
The ICO calendar to end all ICO calendars
Stars: ✭ 183 (-3.17%)
Mutual labels:  blockchain, ethereum
Smart Contract Watch
A tool to monitor a number of smart contracts and transactions
Stars: ✭ 168 (-11.11%)
Mutual labels:  blockchain, ethereum
Pando
A distributed remote protocol for git based on IPFS, ethereum and aragonOS
Stars: ✭ 177 (-6.35%)
Mutual labels:  blockchain, ethereum
Toshi Android Client
Android client for Toshi
Stars: ✭ 167 (-11.64%)
Mutual labels:  blockchain, ethereum
Mastering Ethereum
分散アプリケーションプラットフォーム「ethereum」の入門書
Stars: ✭ 165 (-12.7%)
Mutual labels:  blockchain, ethereum
Cointop
A fast and lightweight interactive terminal based UI application for tracking cryptocurrencies 🚀
Stars: ✭ 2,912 (+1440.74%)
Mutual labels:  blockchain, ethereum
Ethwallet
A ethereum wallet like imToken
Stars: ✭ 190 (+0.53%)
Mutual labels:  blockchain, ethereum

Loom.js Build Status

JS library for building browser apps & NodeJS services that interact with Loom DAppChains.

Install

NodeJS

# NPM
npm install loom-js
# Yarn
yarn add loom-js

Browser

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/loom.umd.js"></script>

Debugging

loom-js uses the debug package for logging.

  • To inspect the logs when running in the browser set localStorage.debug = '*'
  • To inspect the logs when running in NodeJS set the DEBUG env var to *

See docs for debug package if you wish to filter the log messages.

Development

# build for Node
yarn build
# build for Browser
yarn build:browser
# build for Node while targeting ES2017 (more readable than ES5)
yarn build:dev
# run unit tests on Node & Browser
yarn test
# auto-format source files
yarn format
# run unit tests in Node
yarn test:node
# run unit tests in Electon
yarn test:browser
# run e2e test in Node (local DAppChain node must be running first)
yarn e2e:node
# run e2e test in Electron (local DAppChain node must be running first)
yarn e2e:browser

The e2e test environment can be configured by changing .env.test (see .env.test.example for default values).

Debugging

To debug loom-js while using it another project:

  1. Clone the Git repo from https://github.com/loomnetwork/loom-js
  2. Inside the loom-js repo run:
    yarn link
    yarn build:dev
    
  3. In your project repo run yarn link loom-js.
  4. Debug your project normally.

yarn build:dev will compile the TypeScript source to target ES2017, which requires a lot less transformation of async/await constructs than the ES5 code released on NPM.

Regenerating Protobufs

Whenever you change src/proto/loom.proto, or src/tests/tests.proto you will need to regenerate the corresponding *_pb.js by running:

yarn proto

The shell must be able to locate the protoc binary, which can be obtained from https://github.com/google/protobuf/releases

Custom Middlewares

Install the loom-js beta version: yarn add [email protected]

LoomProvider takes a custom function that lets you customize what middlewares it runs. For example, we have an experimental nonce caching middleware that has more advanced nonce tracking. You can add it as such:

const setupMiddlewareFn = function(client, privateKey) {
  const publicKey = CryptoUtils.publicKeyFromPrivateKey(privateKey)
  return [new CachedNonceTxMiddleware(publicKey, client), new SignedTxMiddleware(privateKey)]
}

const loomProviderObj = new LoomProvider(client, privateKey, setupMiddlewareFn)

More examples here: https://github.com/loomnetwork/loom-js/blob/master/src/tests/e2e/loom-provider-web3-middlewares-tests.ts

JSON RPC supported calls

LoomProvider combined with Web3 supports the following JSON RPC calls

Current implemented

  • [x] eth_accounts
  • [x] eth_blockNumber
  • [x] eth_call
  • [x] eth_gasPrice
  • [x] eth_getBlockByHash
  • [x] eth_getBlockByNumber
  • [x] eth_getCode
  • [x] eth_getFilterChanges
  • [x] eth_getLogs
  • [x] eth_getTransactionByHash
  • [x] eth_getTransactionReceipt
  • [x] eth_newBlockFilter
  • [x] eth_newFilter
  • [x] eth_newPendingTransactionFilter
  • [x] eth_sendTransaction
  • [x] eth_subscribe
  • [x] eth_uninstallFilter
  • [x] eth_unsubscribe
  • [x] net_version

Should

  • [ ] eth_getFilterLogs (Returns an array of all logs matching filter with given id)
  • [ ] eth_estimateGas (Currently, it always returns zero)

Maybe

  • [ ] net_peerCount (Returns the current ethereum protocol version)
  • [ ] eth_syncing (Returns an object with data about the sync status or false)
  • [ ] eth_coinbase (Returns the client coinbase address)
  • [ ] web3_clientVersion (Returns the current client version)
  • [ ] eth_getTransactionCount (Returns the number of transactions sent from an address)
  • [ ] eth_getBlockTransactionCountByHash (Returns the number of transactions in a block from a block matching the given block hash)
  • [ ] eth_getBlockTransactionCountByNumber (Returns the number of transactions in a block matching the given block number)

Custom Loom provider methods

Install the loom-js beta version: yarn add [email protected]

Sometimes the project requires few functions that aren't provided directly from LoomProvider in this case is possible to add a custom Eth RPC method. You can add it as such:

const loomProviderObj = new LoomProvider(client, privateKey)
loomProviderObj.addCustomMethod('eth_balance', payload => {
  return '0x1'
})

The first param should be the Ethereum RPC call method to add on LoomProvider and the second parameter a callback function with the result

Overwrite Loom provider methods

Install the loom-js beta version: yarn add [email protected]

If the project requires to overwrite a RPC function that already exists on LoomProvider. You can add it as such:

loomProvider.overwriteMethod('eth_estimateGas', payload => {
  return '0x123'
})

The first param should be the Ethereum RPC call method to overwrite on LoomProvider and the second parameter a callback function with the result

License

BSD 3-Clause, see LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].