Open jke661s opened 3 years ago
This is a configuration issue between your client and the greymass server. 404 means that the URL endpoint https://eos.greymass.com/v1/chain/get_block_info
is not found, so that means its not available (server might not be at the version that has get_block_info?), configured or exposed to your client. get_block_info is used in calculating TAPOS for the transaction (refBlockNum and refBlockPrefix). The only other alternative would be to get this information using get_block (much more expensive than get_block_info) and set the TAPOS in the transaction before signing so that it wouldn't make the get_block_info call.
Do you mean using get_block to get refBlockNum and refBlockPrefix first, and then set those two values to the transaction before signing?
Yes, the code will determine that they are already set and will not call getBlockInfo (which calls get_block_info on the chain). The SDK exposes get_block as public func getBlock(requestParameters: EosioRpcBlockRequest, completion: @escaping (EosioResult<EosioRpcBlockResponse, EosioError>) -> Void)
so you can use that or the PromiseKit wrapped version to get the information you need. Alternatively you can use an earlier version of the libraries because they did use getBlock() in the past, but then you will not have SPM support or some of the other updates made in 1.0.0
I noticed that I need to pass a blockNumOrId in when calling this getBlock. May I know how to get this id please?
You'll have to get the last irreversible block from a getInfoBase() call. The code here can give you an idea: https://github.com/EOSIO/eosio-swift/blob/43bd15ce5abcdf2f8028f6484f677e98caf4c88d/Sources/EosioSwift/EosioTransaction/EosioTransaction.swift#L390
Thanks. I'll give it a try.
@jke661s did you get this working? Can you share any details on what worked for you?
Having the same problem. Why do you guys add a feature that's not even supported by the majority (none) of nodes?
Version 1.0.0 of the SDKs is meant to align with release 2.1 (was previously going to be tagged as 3.0) of EOS. Earlier releases of the SDK can always be used for earlier node versions. When I get a chance I will try to post a code snippet that shows how to work around get_block_info not being present and post it here.
I have the same issue, luckily, the old version is still there and that one does not use the unsupported get_block_info. So this setup still works fine.
pod "EosioSwift", "~> 0.4"
pod "EosioSwiftAbieosSerializationProvider", "~> 0.4"
pod "EosioSwiftVaultSignatureProvider", "~> 0.4"
Nevertheless, I would expect that the API of this library reflects the stable version of the EOS API documentation. As of now there, there is no get_block_info method stated there.
I will wait until the chains are updated or the newer version supports the stable chain API's.
Thanks!
Hi @opi-smccoole, I had a look at it and here is a PR that would give the option to fall back to an older version that does not support the new functionality.
Hello,
I got 404 error when transferring token to others.
The error is "Invalid HTTP response (404) for https://eos.greymass.com/v1/chain/get_block_info."
The same code works under Jungle 3 Test Net (https://jungle3.cryptolions.io:443).
May I know how to fix it?
Cheers,