Skip to content

Commit

Permalink
refactor: add default indexer url
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed Nov 25, 2020
1 parent 46bcd12 commit 05eb232
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ckb/indexer/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class API
attr_reader :rpc
DEFAULT_LIMIT = 1000

def initialize(indexer_host, timeout_config = {})
def initialize(indexer_host = CKB::RPC::DEFAULT_INDEXER_URL, timeout_config = {})
@rpc = CKB::RPC.new(host: indexer_host, timeout_config: timeout_config)
end

Expand Down
1 change: 1 addition & 0 deletions lib/ckb/rpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class RPC
attr_reader :uri, :http

DEFAULT_URL = "http://localhost:8114"
DEFAULT_INDEXER_URL = "http://localhost:8116"

def initialize(host: DEFAULT_URL, timeout_config: {})
@uri = URI(host)
Expand Down

0 comments on commit 05eb232

Please sign in to comment.