hypha-dao / treasury-service

Web service(s) used to query information from Hypha treasuries
2 stars 0 forks source link

Query BTC treasuries from Bitcore servers #1

Closed mgravitt closed 3 years ago

mgravitt commented 4 years ago

We use the Copay mobile application to manage our Bitcoin multisig treasuries. The Copay application uses a hosted instance of the bitcore-wallet-service (https://github.com/bitpay/bitcore/tree/master/packages/bitcore-wallet-service) to host important information about the transaction history.

We need to create a public endpoint (microservice) that will enable Hypha accounting members to download the transaction history from all of the BTC treasuries.

I was able to get a POC working (code link below), but it is not well structured code obviously. This task is to create the web service that combines history and returns it in JSON or CSV format (exact format TBD).

The POC requires secrets in order to gain access to the API. It requires the wallet information from one of the multisig treasurers' wallets.

mgravitt commented 4 years ago

See here for the POC: https://github.com/dappdever/bitcore-cli

mgravitt commented 4 years ago

POC: https://github.com/dappdever/bitcore-cli

You'll need to access a file and secret from keybase.

The POC is for one wallet/treasury, but there will be several (at least 4) and likely will add new ones over time.

For deployment, this should be containerized and deployed to our Hypha utility server. On that server, we run watchtower, which polls container registries for updates and automatically updates them, so it will make CI/CD aligned to all of our other processes.

We also add a similar service that will query our ethereum treasury.

mgravitt commented 3 years ago

The bitcore-cli requires the wallet file and a corresponding password. This info is stored in these files on keybase:

keybase://team/hypha_dev/hypha-btc-treasury-1.json

Here is the file with the password for that file: keybase://team/hypha_dev/aes.key

sebastianmontero commented 3 years ago

Hi @dappdever, I've deployed the service: http://ec2-3-236-210-156.compute-1.amazonaws.com:3000/documentation/static/index.html#/btc-trx/get_api_btc_trx_list Could you please try it out and let me know what you think. Use btc-treasury-1 as wallet name.

mgravitt commented 3 years ago

@sebastianmontero this looks great to me. How are the secrets stored? There are 3 other BTC wallets that need to be added

sebastianmontero commented 3 years ago

@dappdever At the moment they are stored as files on the server, independent from the service. Do you have the credentials for the other wallets?