Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid testnet endpoint https://btc-testnet.horizontalsystems.xyz/api #17

Closed
ieow opened this issue Jan 22, 2024 · 7 comments
Closed

Comments

@ieow
Copy link

ieow commented Jan 22, 2024

getting error when testing in testnet (https://btc-testnet.horizontalsystems.xyz/api )

error: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found."
@hanxianlong
Copy link

horizontal systems closed all the test node, this kit will try the the other nodes automatically.

"testnet-seed.bitcoin.petertodd.org", // Peter Todd
"testnet-seed.bitcoin.jonasschnelli.ch", // Jonas Schnelli
"testnet-seed.bluematt.me", // Matt Corallo
"testnet-seed.bitcoin.schildbach.de", // Andreas Schildbach
"bitcoin-testnet.bloqseeds.net", // Bloq

@ieow
Copy link
Author

ieow commented Jan 23, 2024

Thanks for the reply!
The kit do not try other nodes automatically for me though...
Anyway I tried the 5 host you listed

"testnet-seed.bitcoin.petertodd.org", // Peter Todd. -> no valid endpoint (404)
"testnet-seed.bitcoin.jonasschnelli.ch", // Jonas Schnelli -> Time out
"testnet-seed.bluematt.me", // Matt Corallo. -> Time out
"testnet-seed.bitcoin.schildbach.de", // Andreas Schildbach -> not reachable ( ping )
"bitcoin-testnet.bloqseeds.net", // Bloq -> not reachable -> ping

I am wondering if the kit support other api like mempool.space
https://mempool.space/testnet/docs/api/rest#get-address-transactions

@hanxianlong
Copy link

@ieow just try the following command, the first two nodes worked well, you can check whether your local network can reached them well.
and mempoll is just an explorer, I'm not sure whether it provides a full node.

telnet testnet-seed.bitcoin.jonasschnelli.ch 18333

Trying 71.13.92.62... Connected to seed.tbtc.petertodd.net. Escape character is '^]'. ^] telnet> quit Connection closed.

telnet testnet-seed.bitcoin.jonasschnelli.ch 18333 Trying 52.193.79.181... Connected to testnet-seed.bitcoin.jonasschnelli.ch. Escape character is '^]'.

@hanxianlong
Copy link

image

@ieow
Copy link
Author

ieow commented Jan 23, 2024

Sorry, I under provide the informations.
The issue I have is with the apiTransactionProvider which use
https://btc-testnet.horizontalsystems.xyz/api during testnet

        let apiTransactionProvider: IApiTransactionProvider?
        switch networkType {
        case .mainNet:
            let hsBlockHashFetcher = HsBlockHashFetcher(hsUrl: "https://api.blocksdecoded.com/v1/blockchains/bitcoin", logger: logger)

            if case let .blockchair(key) = syncMode {
                let blockchairApi = BlockchairApi(secretKey: key, chainId: network.blockchairChainId, logger: logger)
                let blockchairBlockHashFetcher = BlockchairBlockHashFetcher(blockchairApi: blockchairApi)
                let blockHashFetcher = BlockHashFetcher(hsFetcher: hsBlockHashFetcher, blockchairFetcher: blockchairBlockHashFetcher, checkpointHeight: checkpoint.block.height)

                apiTransactionProvider = BlockchairTransactionProvider(blockchairApi: blockchairApi, blockHashFetcher: blockHashFetcher)
//                    let blockchainComProvider = BlockchainComApi(url: "https://blockchain.info", blockHashFetcher: blockHashFetcher, logger: logger)
//                    apiTransactionProvider = BiApiBlockProvider(restoreProvider: blockchainComProvider, syncProvider: blockchairProvider, apiSyncStateManager: apiSyncStateManager)
            } else {
                apiTransactionProvider = BlockchainComApi(url: "https://blockchain.info", blockHashFetcher: hsBlockHashFetcher, logger: logger)
            }
        case .testNet:
            apiTransactionProvider = BCoinApi(url: "", logger: logger)
        case .regTest:
            apiTransactionProvider = nil
        }

apiTransactionProvider = BCoinApi(url: "https://btc-testnet.horizontalsystems.xyz/api", logger: logger)

I think the full node do not provide the api needed for the apiTransactionProvider...

may be I could assign the apiTransactionProvider as nil?

@hanxianlong
Copy link

Yeah, you're correct. the full node does not provide the http or https api, we should use the explorer api here.
You can't assign the txProvider as nil. If you'd like to use the mempool as your explorer, you should implement the logic by yourself.
I just implementted the regtest logic with an open source explorer days before.

@ieow
Copy link
Author

ieow commented Jan 24, 2024

created a pr here for using mempoolSpace for apiTransactionProvider
horizontalsystems/BitcoinCore.Swift#33

@ieow ieow closed this as completed Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants