BirthdayResearch / jellyfishsdk

DeFiChain Jellyfish SDK & Ecosystem for building modern lite DeFi Applications at scale.
https://jellyfishsdk.com
MIT License
104 stars 36 forks source link

DeFi Blockchain RPC Implementations #48

Open fuxingloh opened 3 years ago

fuxingloh commented 3 years ago

This tracks all the RPC methods and categories being implemented in jellyfish-api-core. Will list all the methods here, and strike out those that are not applicable.

Feel free to update this and tag yourself if you want to work on a feature. You will need to reference DeFiCh/ain code base, https://github.com/DeFiCh/ain/tree/master/src/rpc to be exact.

This is purely for documenting all features of DeFi Blockchain. 
Everything that is required has already been completed.

src/rpc

blockchain.cpp

mining.ccp

misc.cpp

net.cpp

rawtransaction.cpp

### `server.cpp` - COMPLETED - [x] getrpcinfo #330 - [x] ~~help~~ - [x] ~~stop~~ - [x] uptime #340

src/spv

spv_rpc.cpp

src/wallet

rpcwallet.cpp

## `src/masternode` ### `mn_rpc.cpp` - COMPLETED - [x] setgov #456 - [x] getgov #456
### `rpc_accounts.cpp` - COMPLETED - [x] listaccounts #162 - [x] getaccount #162 - [x] gettokenbalances #162 - [x] utxostoaccount #215 - [x] accounttoaccount #284 - [x] accounttoutxos #289 - [x] listaccounthistory #162 - [x] accounthistorycount #265 - [x] listcommunitybalances #368 - [x] sendtokenstoaddress #323 - [x] listburnhistory #444 - [x] getburninfo #540
### `rpc_masternodes.cpp` - COMPLETED - [x] createmasternode #372 - [x] resignmasternode #419 - [x] updatemasternode #1847 - [x] listmasternodes #372 - [x] getmasternode #372 - [x] getmasternodeblocks #861 - [x] ~~listcriminalproofs~~ deprecated - [x] getanchorteams #923 - [x] getactivemasternodecount #648 - [x] listanchors #921 - [x] isappliedcustomtx #957
### `rpc_poolpair.cpp` - COMPLETED - [x] listpoolpairs #121 - [x] getpoolpair #121 - [x] addpoolliquidity #121 - [x] removepoolliquidity #420 - [x] createpoolpair #121 - [x] updatepoolpair #1958 - [x] poolswap #413 - [x] listpoolshares #121 - [x] testpoolswap #411
### `rpc_tokens.cpp` - COMPLETED - [x] createtoken #120 - [x] updatetoken #120 - [x] listtokens #120 - [x] gettoken #120 - [x] getcustomtx #1878 - [x] minttokens #290 - [x] decodecustomtx #1878
fuxingloh commented 3 years ago

Working on blockchain.cpp

  1. getblockchaininfo
canonbrother commented 3 years ago

Working on blockchain.cpp

  1. getblock
  2. getblockhash
  3. getblockcount
canonbrother commented 3 years ago

Working on blockhain.cpp

  1. gettxxout
fuxingloh commented 3 years ago

Will be working on various rawtransaction.cpp rpc for wallet integration.

  1. getrawtransaction
  2. createrawtransaction
  3. decoderawtransaction
  4. decodescript
  5. sendrawtransaction
  6. combinerawtransaction
  7. signrawtransactionwithkey
fuxingloh commented 3 years ago

Updated RPC typing prioritization, removed prioritization for RPC that are going to be created with jellyfish-transaction.

All RPC without side effect/mutating properties (get, list) should be prioritized over those with side effect (create, update)

fuxingloh commented 3 years ago

To prioritize:

rpc_tokens.cpp

rpc_poolpair.cpp

rpc_accounts.cpp

mining.ccp

canonbrother commented 3 years ago

Working on (late update, DONE) blockhain.cpp

  1. getrawmempool

wallet.cpp

  1. wallet.getNewAddress
  2. wallet.getAddressInfo
  3. wallet.validateAddress
  4. wallet.listAddressGroupings
  5. wallet.getWalletInfo
  6. wallet.setWalletFlag
  7. wallet.sendToAddress
  8. wallet.createWallet
canonbrother commented 3 years ago

Working on rpc_tokens.cpp (improving tests)

  1. listokens
  2. gettoken
  3. createtoken
  4. updatetoken
canonbrother commented 3 years ago

Working on rpc_poolpair.cpp (improving tests)

  1. listPoolPairs
  2. getPoolPair
  3. listPoolShares
  4. createPoolPair
  5. addPoolLiquidity
canonbrother commented 3 years ago

Working rpc_accounts.cpp

  1. listaccounts
  2. getaccount
  3. gettokenbalances
  4. listaccounthistory
jingyi2811 commented 3 years ago

Working on net.cpp

getconnectioncount getpeerinfo getnetworkinfo

fuxingloh commented 3 years ago

@jingyi2811 mentioned that it's hard to test multi node setup (e.g. getpeerinfo) without https://github.com/DeFiCh/jellyfish/issues/40 implemented. Hence some RPC implementations are blocked by that.

jingyi2811 commented 3 years ago

Working on blockchain.cpp

getchaintips

fuxingloh commented 3 years ago

Please priotize in this order:

  1. rpc_accounts.cpp
  2. rpc_tokens.cpp
  3. rpc_accounts.cpp
jingyi2811 commented 3 years ago

Working on rpc_accounts.cpp

utxostoaccount (Done) accounttoaccount (Done) accounttoutxos (Done)

jingyi2811 commented 3 years ago

Working on rpc_tokens.cpp

getcustomtx (Put this aside as this rpc requires docker networking to be enabled) minttokens (Done)