diff --git a/lib/ckb/indexer/api.rb b/lib/ckb/indexer/api.rb index b393e97e..4432751f 100644 --- a/lib/ckb/indexer/api.rb +++ b/lib/ckb/indexer/api.rb @@ -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 diff --git a/lib/ckb/rpc.rb b/lib/ckb/rpc.rb index 946ce80b..67f06cf7 100644 --- a/lib/ckb/rpc.rb +++ b/lib/ckb/rpc.rb @@ -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)