Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Update aepp-sdk to v0.25.0-0.1.0-next #84

Closed
kryztoval opened this issue Nov 11, 2018 · 16 comments
Closed

Update aepp-sdk to v0.25.0-0.1.0-next #84

kryztoval opened this issue Nov 11, 2018 · 16 comments

Comments

@kryztoval
Copy link
Contributor

aepp-blockchain-explorer works with 0.24.0-0.1.0 if you edit epoch to return version 0.25.0 instead of 0.24.0

but using version 0.24.0-0.2.0 returns this:
Uncaught (in promise) Error: Method PostKeyBlock is unsupported. No interface for ["internal", "chain"]

Maybe that thrown error needs to be trapped by the aepp-blockchain-explorer?
I am creating this here because I don't know if it should be here or on aepp-sdk-sj

aeternity/aepp-sdk-js#134

@shekhar-shubhendu
Copy link
Contributor

PostKeyBlock is part of internal API(both 0.24.0 and 0.25.0) and does not seems to be used by aepp-blockchain-explorer.

Using the epoch version 0.24.0 with aepp-sdk-js 0.24.0-0.20 works just fine for me.

Using the epoch version 0.25.0 with aepp-sdk-js 0.24.0-0.20 doesn't seems to work for me but I suppose that's intended as i get the following error message Error: Unsupported epoch version 0.25.0.

@kryztoval can you please provide the steps to replicate the issue.
Also, at some point are you trying to post a mined block to the network?

@kryztoval
Copy link
Contributor Author

I was not able to make aepp-blockchain-explorer work with epoc version 0.25.0 using 0.24.0-0.2.0 or any of the versions after the "Epoch 0.25.0" compatibility commits after.

which means aepp-blockchain-explorer is broken by the new updates to aepp-sdk-js.

@kryztoval
Copy link
Contributor Author

https://goo.gl/Dnv3g6 I have it running, but it required a lot of changes to the sdk (reverting changes), and picking an specific version without all the latest changes, as you can see EVERYTHING works, before the latest version of the js sdk. I posted in both places to let you know it is breaking.

@ricricucit
Copy link
Contributor

ricricucit commented Nov 13, 2018

0.24.0-x.x.x versions of the SDK are versioned with those numbers because they work with Epoch version 0.24.x

We're soon going to release a new version of the SDK (@next on npmjs or 0.25.0-0.1.0-next), which is going to be compatible with Epoch 0.25.0.

@ricricucit
Copy link
Contributor

@kryztoval
Copy link
Contributor Author

master / package.json still points to 0.24.0

git clone https://github.com/aeternity/aepp-blockchain-explorer.git
cd aepp-blockchain-explorer
npm i
npm i --save @aeternity/aepp-sdk@0.25.0-0.1.0-next
npm audit fix
 HOST=mydomain.com VUE_APP_EPOCH_URL='http://testnet.mydomain.com:3013/' npm run build

Open the webpage in Chrome with F12 and it shows:

Uncaught (in promise) Error: Method PostKeyBlock is unsupported. No interface for ["internal", "chain"]
    at Object.Fn [as urlFor] (epoch.js:58)
    at Fe (swagger.js:452)
    at t.f (mapObjIndexed.js:28)
    at t.@@transducer/step (_xwrap.js:12)
    at O (_reduce.js:9)
    at j (_reduce.js:43)
    at mapObjIndexed.js:27
    at e (_curry2.js:26)
    at Fe (swagger.js:450)
    at t.f (mapObjIndexed.js:28)

This is not fixed.

@kryztoval kryztoval changed the title aepp-sdk-js 0.24.0-0.2.0 breaks aepp-blockchain-explorer v0.25.0-0.1.0-next breaks aepp-blockchain-explorer Nov 14, 2018
@kryztoval
Copy link
Contributor Author

I tracked the error to this specific edit
aeternity/aepp-sdk-js@449c954#diff-1f7e311cb4469c283da74e6d10ccab04

if you remove this change, the aepp-sdk.js is not broken anymore.

@kryztoval
Copy link
Contributor Author

So is this a problem with aepp-sdk-js or with aepp-blockchain-explorer ?

@ricricucit ricricucit reopened this Nov 14, 2018
@ricricucit
Copy link
Contributor

ricricucit commented Nov 14, 2018

Thank you for exploring the problem a bit deeper, and yes: it's a problem with the blockchain-explorer :)

First:
To install the SDK compatible with Epoch 0.25.0 you have to type: npm install @aeternity/aepp-sdk@next --save at the root of your project (or the explorer project). This will download the next version which is not an official release, so it's kind of a pre-release. See all releases here.

Important: this version of the SDK is compatible with Epoch 0.25.0.

As @shekhar-shubhendu already said: PostKeyBlock is part of internal API(both 0.24.0 and 0.25.0) and does not seems to be used by aepp-blockchain-explorer...can you please try to understand when and why the PostKeyBlock is getting called?

Also: reverting that change seems a bit of an odd change, because the problem you are describing, seems unrelated to that change that @davidyuk made.

One thing that might be needed is setting the internalUrl when initialising the instance, eg.:
const client = await EpochChain({ url: this.state.epochUrl, internalUrl: YOUR_INTERNAL_URL });.

You can also just try to set the same url there, to see if the problem is related to not having the internalUrl set, eg.:
const client = await EpochChain({ url: this.state.epochUrl, internalUrl: this.state.epochUrl });

...but I'm wondering why the internalUrl is not already set there, especially because I'm assuming that the blockchain-explorer, in fact, uses internal (or "debug") endpoints of the API.

@ror-shubham can you help @kryztoval and me, better understand the nature of this problem? Thanks!

@shekhar-shubhendu
Copy link
Contributor

@ricricucit setting internalUrl does seem to resolve this issue.
we'll have to check though why(if it is) PostKeyBlock is getting called by the explorer.

@kryztoval
Copy link
Contributor Author

kryztoval commented Nov 14, 2018

The change I pinpointed went from returning a function that would throw an error if called to actually performing the throw immediately. since the explorer is not expecting an error to be thrown at that time it fails. This is why reverting that commit works.

Now why is there an error being thrown if the explorer is not using the internal endpoints is beyond me.

@ror-shubham
Copy link
Contributor

From my understanding, all of the swagger endpoints were mapped, but internalUrl was missing, and it was not throwing error earlier. After the above-mentioned commit, it started throwing the error.
I will make a commit making use of internalUrl.

@ricricucit
Copy link
Contributor

Happy to know you're on this, let me know if you need support, and let's close this issue, if you think is resolved 😉

@davidyuk davidyuk changed the title v0.25.0-0.1.0-next breaks aepp-blockchain-explorer Update aepp-sdk to v0.25.0-0.1.0-next Nov 19, 2018
@kryztoval
Copy link
Contributor Author

kryztoval commented Nov 23, 2018

I see commit f1a5d84 great job!

I think the package.json needs to be updated to use the latest version to support epoch 0.25.0
"@aeternity/aepp-sdk": "^0.25.0-0.1.0-next",

Otherwise it will only connect to nodes 0.24.0.

Would it be a good idea to create tags or branches for the explorer that specifically support an epoch version ?

@ror-shubham
Copy link
Contributor

sdk-testnet.aepps.com is currently pointed to version 24 of epoch, which is not compatible with sdk-js v0. 25.
Today(23/11), there will sequential releases after which sdk-test.aepps.com will point to v25, sdk-js v0. 25 will be released, blockchain-explorer will use above releases.

@kryztoval
Copy link
Contributor Author

kryztoval commented Nov 23, 2018

Oh, ok, Since i am using testnet, and test net is on 0.25.0 that is the only one i am testing

I think this can be closed now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants