Skip to content

Instantly share code, notes, and snippets.

@leongaban
Last active March 5, 2018 23:18
Show Gist options
  • Save leongaban/6aa9779194f87445eff1f62e4cec6342 to your computer and use it in GitHub Desktop.
Save leongaban/6aa9779194f87445eff1f62e4cec6342 to your computer and use it in GitHub Desktop.
Guide to setup Decred edge-currency-plugin

Plugin Forked from Airbitz https://github.com/leongaban/edge-currency-decred

EdgeDecred

Challenges / Sprint items

  • Setup and run a Decred full node locally

  • Setup and run ElectrumX server (requires leveldb)

  • ISSUE: Can't run ElectrumX locally

  • Connect ElectrumX to the Decred full node

  • Obtain electrumServers for Decred to be used in edge-currency plugin

  • Update the JavaScript plugin to use the ElectrumX Decred servers

  • Build ReactNative app to test

  • Move from local to hosted dev test

  • Deploy servers to production, submit plugin PR 🚀

stakey

Running the ElectrumX Docker image:

docker run \
  -v /Users/leongaban/electrumx_docker:/data \
  -e DAEMON_URL=http://USER:PASSWORD@127.0.0.1:19119 \
  -e RPC_HOST=127.0.0.1 \
  -e COIN=Decred \
  -p 19119:19119 \
  cipherz/docker-electrumx
@leongaban
Copy link
Author

leongaban commented Feb 25, 2018

2 current issues

1) can't run Electrumx locally

decred cd electrumx
➜  electrumx git:(master) python3 ./electrumx_server.py
INFO:root:ElectrumX server starting
Traceback (most recent call last):
  File "./electrumx_server.py", line 24, in main
    controller = Controller(Env())
  File "/Users/leongaban/projects/decred/electrumx/server/env.py", line 38, in __init__
    self.coin = Coin.lookup_coin_class(coin_name, network)
  File "/Users/leongaban/projects/decred/electrumx/lib/coins.py", line 94, in lookup_coin_class
    .format(name, net))
lib.coins.CoinError: unknown coin Decred and network testnet combination
CRITICAL:root:ElectrumX server terminated abnormally
➜  electrumx git:(master)

2) Need electrumx servers for Decred

src/info/decred.js

feeUpdateInterval: 10000,
// @TODO need to replace these
feeInfoServer: 'https://decredfees.21.co/api/v1/fees/list',
infoServer: 'https://info1.edgesecure.co:8444/v1/electrumServers/DCR',
simpleFeeSettings: {
  highFee: '1000000',
  lowFee: '10000',
  standardFeeLow: '10000',
  standardFeeHigh: '1000000',
  standardFeeLowAmount: '',
  standardFeeHighAmount: ''
},
electrumServers: []

@leongaban
Copy link
Author

leongaban commented Mar 2, 2018

EdgeApp/edge-react-gui#271

Current issue: Errors when using the Decred edge-plugin with the Edge-React-Gui

Error: node_modules/edge-currency-bitcoin/lib/engine/currencyEngine.js.flow:28
 28: import bcoin from 'bcoin'
                       ^^^^^^^ bcoin. Required module not found

Error: node_modules/edge-currency-bitcoin/lib/engine/keyManager.js.flow:6
  6: import bcoin from 'bcoin'
                       ^^^^^^^ bcoin. Required module not found

Error: node_modules/edge-currency-bitcoin/lib/engine/parseTransaction.js.flow:2
  2: import bcoin from 'bcoin'
                       ^^^^^^^ bcoin. Required module not found

Error: node_modules/edge-currency-bitcoin/lib/index.js.flow:8
  8: import bcoin from 'bcoin'
                       ^^^^^^^ bcoin. Required module not found

Error: node_modules/edge-currency-bitcoin/lib/info/decred.js.flow:4
  4: export const decredInfo: AbcCurrencyInfo = {
                              ^^^^^^^^^^^^^^^ property `metaTokens`. Property not found in
                                                v
  4: export const decredInfo: AbcCurrencyInfo = {
  5:   // Basic currency information:
  6:   currencyCode: 'DCR',
...:
 59: }
     ^ object literal

Error: node_modules/edge-currency-bitcoin/lib/plugin/currencyPlugin.js.flow:20
 20: import bcoin from 'bcoin'
                       ^^^^^^^ bcoin. Required module not found

Error: node_modules/edge-currency-bitcoin/lib/utils/addressFormat/addressFormatIndex.js.flow:3
  3: import bcoin from 'bcoin'
                       ^^^^^^^ bcoin. Required module not found

Error: node_modules/edge-currency-bitcoin/lib/utils/addressFormat/cashAddress.js.flow:5
  5: import bcoin from 'bcoin'
                       ^^^^^^^ bcoin. Required module not found

@leongaban
Copy link
Author

Steps to install and setup edge-react-gui && use the edge-cryptocurrency-bitcoin plugin:
https://gist.github.com/cipherzzz/65a46f3b1fd6194ef6a20c35de2986a8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment