This howto is valid for Betanet on Ubuntu or Debian
You have to install some dependencies. In debian / ubuntu run:
let UserContext = React.createContext(); | |
class App extends React.Component { | |
state = { | |
user: null, | |
setUser: user => { | |
this.setState({ user }); | |
} | |
}; |
const Transport = require('@ledgerhq/hw-transport-node-hid').default | |
const AppEth = require('@ledgerhq/hw-app-eth').default | |
const Tx = require('ethereumjs-tx') | |
const Web3 = require('web3') | |
const web3 = new Web3('https://mainnet.infura.io:443') | |
async function main() { | |
const index = 1 | |
const devices = await Transport.list() | |
if (devices.length === 0) throw 'no device' |
'use strict'; | |
process.title = 'bcoin'; | |
const assert = require('assert'); | |
const FullNode = require('bcoin/lib/node/fullnode'); | |
const plugin = require('bcoin/lib/wallet/plugin'); | |
const node = new FullNode({ | |
network: 'regtest', |
/*** | |
* Shoutouts: | |
* | |
* Bytecode origin https://www.reddit.com/r/ethereum/comments/6ic49q/any_assembly_programmers_willing_to_write_a/dj5ceuw/ | |
* Modified version of Vitalik's https://www.reddit.com/r/ethereum/comments/6c1jui/delegatecall_forwarders_how_to_save_5098_on/ | |
* Credits to Jorge Izquierdo (@izqui) for coming up with this design here: https://gist.github.com/izqui/7f904443e6d19c1ab52ec7f5ad46b3a8 | |
* Credits to Stefan George (@Georgi87) for inspiration for many of the improvements from Gnosis Safe: https://github.com/gnosis/gnosis-safe-contracts | |
* | |
* This version has many improvements over the original @izqui's library like using REVERT instead of THROWing on failed calls. | |
* It also implements the awesome design pattern for initializing code as seen in Gnosis Safe Factory: https://github.com/gnosis/gnosis-safe-contracts/blob/master/contracts/ProxyFactory.sol |
Today, when a dapp calls eth_sendTransaction
, the parameters are sent up to the signer, and the app is called back once, with the resulting transaction hash.
This is a great way to allow a dapp to track the progress of a signed transaction, assuming that transaction is static and not mutable.
Recent transaction backlogs have forced us at MetaMask to add a button on long-pending transanctions to "Retry with higher gas price", but if a dapp or service was tracking the signed transaction by hash, it has no way of discovering that this transaction was ever resubmitted successfully.
This is only a problem for apps that submit a transaction, and continue tracking that specific transaction hash until it is mined, but for dapps with that problem, one solution could be to add a new method, maybe called eth_sendMutableTransaction
, which calls back not wit
export function sleepFor (timeInMilliSeconds = 1000) { | |
return new Promise((resolve, reject)=>{ | |
setTimeout(resolve, timeInMilliSeconds); | |
}); | |
} | |
export function waitFor (...names) { | |
return (target, prop, descriptor) => { | |
const fn = descriptor.value; | |
let newFn = function (...args) { |
/* globals localStorage */ | |
import { onSnapshot, applySnapshot } from 'mobx-state-tree'; | |
import Storage from './storage'; | |
export const persist = (name, store, options, schema = {}) => { | |
let hydrated = false; | |
let storage = options.storage; | |
if (typeof localStorage !== 'undefined' && localStorage === storage) { |
/** | |
* Consume update args object for document and can handle one level nesting. | |
* Returns object for leverage by $set in Mongoose update function. | |
* | |
* @param args | |
* @returns {{}} | |
*/ | |
const objectToDotNotation = (args) => { | |
const setObject = {}; | |
Object.keys(args).forEach((key) => { |