adding mapping urls

pull/1429/head
Minh Doan 5 years ago
parent d2b3e8c340
commit 14281095c4
  1. 27
      internal/hmyapi/blockchain.go

@ -63,6 +63,33 @@ func (s *PublicBlockChainAPI) GetBlockByHash(ctx context.Context, blockHash comm
return nil, err
}
// GetShardingStructure returns an array of sharding structures.
func (s *PublicBlockChainAPI) GetShardingStructure(ctx context.Context) ([]map[string]interface{}, error) {
res := []map[string]interface{}{
map[string]interface{}{
"shardID": "0",
"http": "http://127.0.0.1:800",
"wss": "wss://127.0.0.1:800",
},
map[string]interface{}{
"shardID": "1",
"http": "http://127.0.0.1:800",
"wss": "wss://127.0.0.1:800",
},
map[string]interface{}{
"shardID": "2",
"http": "http://127.0.0.1:800",
"wss": "wss://127.0.0.1:800",
},
map[string]interface{}{
"shardID": "3",
"http": "http://127.0.0.1:800",
"wss": "wss://127.0.0.1:800",
},
}
return res, nil
}
// GetCode returns the code stored at the given address in the state for the given block number.
func (s *PublicBlockChainAPI) GetCode(ctx context.Context, addr string, blockNr rpc.BlockNumber) (hexutil.Bytes, error) {
address := internal_common.ParseAddr(addr)

Loading…
Cancel
Save