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

How to correctly specify URL to self-hosted node in AnchorRequest? #12

Open
sugarjig opened this issue Jul 28, 2021 · 3 comments
Open

Comments

@sugarjig
Copy link

I'm experimenting with an ION node and using ion-tools to interact with it. I'm having trouble figuring out how to send an anchor request to it, though.

I can successfully resolve a DID using

let response = await ION.resolve('did:ion:test:EiClWZ1MnE8PHjH6y4e4nCKgtKnI1DK1foZiP61I86b6pw', {
    nodeEndpoint: 'http://localhost:3000/identifiers/',
});

But when I try to submit an anchor request I get an error. Here's what I'm trying to do:

const requestBody = did.generateRequest();
const request = new ION.AnchorRequest(requestBody, {
    challengeEndpoint: 'http://localhost:3000/api/v1.0/proof-of-work-challenge',
    solutionEndpoint: 'http://localhost:3000/api/v1.0/operations',
});
let response = await request.submit();

Basically I'm changing https://beta.ion.msidentity.com to http://localhost:3000.

The error I get is Error: Get challenge service not available. I can only assume the paths to the endpoints are incorrect. I have also tried http://localhost:3000/proof-of-work-challenge and http://localhost:3000/operations.

What is the correct path to the challenge and solution endpoints when running your own node?

@sugarjig
Copy link
Author

sugarjig commented Jul 29, 2021

Was trying to solve my own problem by looking through the ION code. I see where the operations path is configured in the router, but I don't see anything related to the challenge.

@csuwildcat
Copy link
Member

@sugarjig the PoW thing was something Microsoft did to gate their own node's open endpoint against DDoS. We could add that as a general capability to ION nodes in general, but that would be new work/capabilities that need to be added to that code base.

@flarocca
Copy link

Hello folks!
I am trying to get started with this by running some examples with a local (dockerized) node.
If ion-tools is no longer supported, what should I use?
How do I sent did operations created by ion-tools to my local node?

Where can I find technical documentation to get started as a developer?

Thanks!

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

3 participants