bitcore icon indicating copy to clipboard operation
bitcore copied to clipboard

RSK Integration

Open ahsan-javaiid opened this issue 3 years ago • 0 comments

Description

  • This PR adds RSK integration into bitcore infrastructure
  • I did not make a copy of the ethereum implementation
  • Used a better approach to extend and override the ethereum classes
  • That means there will be almost zero maintenance cost for RSK and code will be easy to maintain.

Features

  • Integrated RSK into bitcore-node
  • Integrated RSK into bitcore-wallet-client
  • Integrated RSK into bitcore-wallet-service
  • Integrated RSK into crypto-wallet-core
  • Integrated RSK into crypto-rpc

Type of Change

  • [X] New feature (Work in progress)

Bitpay-app Pull Requests

Test Plan

  • PR needs to be deployed on bitpay staging server along with rskj node
  • bitcore-node will start syncing (configurations below)
  • Change https://bws.bitpay.com/bws/api to deployed address in mobile app
  • Now test the RSK integration
  • Note: It can be tested only once bitcore-node sync process is complete

Update dependencies inside bitcore-node

  • For local testing or on staging server, bitcore-node dependences needs to include rsk integration as well
  • Use below commands as a reference
cp -r bitcore/packages/bitcore-wallet-client/ts_build bitcore/packages/bitcore-node/node_modules/bicore-wallet-client
cp -r bitcore/packages/crypto-wallet-core/ts_build bitcore/packages/bitcore-node/node_modules/crypto-wallet-core
cp -r crypto-rpc .bitcore/packages/bitcore-node/node_modules 

bitcore.config.json for RSK

{
  "bitcoreNode": {
    "chains": {
      "RSK": {
          "testnet": {
            "trustedPeers": [
              {
                  "host": "127.0.0.1",
                  "port": 4444
              }
            ],
            "chainSource": "p2p",
            "rpc": {
              "host": "127.0.0.1",
              "port": 4444,
              "username": "",
              "password": ""
            },
            "provider": {
              "protocol": "http",
              "host": "127.0.0.1",
              "port": 4444,
              "chain": "RSK"
            }
          }
        }
    }
  }
}

ahsan-javaiid avatar Sep 12 '22 18:09 ahsan-javaiid