OSDN Git Service

add query API
authorroot <zhouarrogant@outlook.com>
Thu, 7 Sep 2017 07:34:26 +0000 (07:34 +0000)
committerroot <zhouarrogant@outlook.com>
Thu, 7 Sep 2017 07:34:26 +0000 (07:34 +0000)
1  2 
blockchain/reactor.go
cmd/bytomcli/main.go

@@@ -63,12 -55,8 +56,9 @@@ type BlockchainReactor struct 
        chain        *protocol.Chain
        store        *txdb.Store
        accounts         *account.Manager
-       assets           *asset.Registry
+       assets       *asset.Registry
        txFeeds          *txfeed.TxFeed
 +      indexer         *query.Indexer
        pool         *BlockPool
        mux          *http.ServeMux
        handler      http.Handler
@@@ -74,12 -65,8 +68,14 @@@ var commands = map[string]*command
        "create-transaction-feed": {createTxFeed},
        "get-transaction-feed":    {getTxFeed},
        "update-transaction-feed": {updateTxFeed},
 +        "list-accounts":           {listAccounts},
 +        "list-assets":             {listAssets},
 +        "list-transaction-feeds":  {listTxFeeds},
 +        "list-transactions":       {listTransactions},
 +        "list-balances":           {listBalances},
 +        "list-unspent-outputs":    {listUnspentOutputs},
+       "delete-transaction-feed": {deleteTxFeed},
+       "issue-test": {example.IssueTest},
  }
  
  func main() {
@@@ -548,9 -342,9 +351,9 @@@ func createAsset(client *rpc.Client, ar
        var ins Ins
        ins.RootXPubs = []chainkd.XPub{xpub}
        ins.Quorum = 1
-       ins.Alias = "aa"
+       ins.Alias = "bob"
        ins.Tags = map[string]interface{}{"test_tag": "v0",}
 -      ins.Definition = map[string]interface{}{"test_definition": "v0"}
 +      ins.Definition = map[string]interface{}{}
        ins.ClientToken = args[0]
        responses := make([]interface{}, 50)
        client.Call(context.Background(), "/create-asset", &[]Ins{ins,}, &responses)