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

ilp-cli testnet setup command error #725

Open
omertoast opened this issue May 26, 2021 · 4 comments
Open

ilp-cli testnet setup command error #725

omertoast opened this issue May 26, 2021 · 4 comments

Comments

@omertoast
Copy link
Member

omertoast commented May 26, 2021

Deprecated Xpring API had an endpoint https://xpring.io/api/accounts/<assetCode> to create accounts on Xpring's side. ilp-cli testnet setup command was using this endpoint to create an account and peer with it to connect the testnet easily.

But since Xpring rebranded as RippleX, API endpoints and responses changed with it. For now, I find out three things that need to change, in order to ilp-cli testnet setup command work.

  1. API endpoint, which changed from https://xpring.io/api/accounts/<assetCode> to https://ripplex.io/portal/ilp/hermes/accounts/. Also, you should send a POST request instead of a GET request.

  2. The method to change the account asset. You should send a POST request to https://ripplex.io/portal/ilp/hermes/accounts/ with a JSON payload, an object named assetCode in it to use an asset other than XRP. You can see the old method here: https://github.com/omrtozd/interledger-rs/blob/master/docs/manual-config.md#get-your-own-credentials

  3. The XpringResponse struct, due to the change in the response format.

"accountId": "user_w0vzjgqc",
"accountRelationship": "CHILD",
"assetCode": "XRP",
"assetScale": 9,
"maximumPacketAmount": null,
"linkType": {},
"connectionInitiator": true,
"isInternal": false,
"sendRoutes": true,
"receiveRoutes": false,
"balanceSettings": {
    "minBalance": null,
    "settleThreshold": null,
    "settleTo": 0
},
"rateLimitSettings": {
    "maxPacketsPerSecond": null
},
"settlementEngineDetails": null,
"customSettings": {
    "ilpOverHttp.outgoing.url": "https://rxprod.wc.wallet.ripplex.io./ilp",
    "ilpOverHttp.incoming.auth_type": "SIMPLE",
    "ilpOverHttp.incoming.simple.auth_token": "ygV47wq8mvI0b",
    "ilpOverHttp.outgoing.simple.auth_token": "enc:gcpkms:connector:secret0:1:gs:CiQAxw4QhykCtBPYDxd7n91yo3FGmiIGbDQE8bN1c6Ft_4tYvRUSWACjdIaO5ZBq-W9sN7OiSr3o9Hb8uQBv68QTmd61EMCXMHuEa6uxrJZNM2ZHwkvhMEPgBfTH13EGUGkeSQfLMVlp9ZXyluiP-m0t1OJbDfUAE4qv0LBIhRY=",
    "ilpOverHttp.outgoing.auth_type": "SIMPLE"
},
"parentAccount": false,
"childAccount": true,
"peerAccount": false,
"peerOrParentAccount": false,
"paymentPointer": "$rxprod.wc.wallet.ripplex.io./user_w0vzjgqc"
@sappenin
Copy link
Contributor

sappenin commented Jun 1, 2021

Hi @omrtozd,

I maintain the Xpring/RippleX testnet nodes, and can help answer any questions you might have. Some notes/comments from me about what you wrote above are below.

1. API endpoint

RippleX is going to be moving our ILP Testnet over to the https://ilpv4.dev domain in the not too distant future, so I would use that URL if you're writing new code for your CLI. The endpoint should work as you indicated, but here's an updated URL:

curl --location --request POST 'https://hermes-rest.ilpv4.dev/accounts' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw ''

2. Create New Account (different currency)

The system will auto-generate a new account username if you execute the call above, so (as you discovered) if you instead want to change these details, you can do something like this instead (assuming the username isn't taken):

curl --location --request POST 'https://hermes-rest.ilpv4.dev/accounts' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
 "accountId": "test-david2",
 "assetCode": "XRP",
 "assetScale": 9
}'

3. The XpringResponse struct

Yes, the old response was coming from maybe the JS Connector. However, the Ripple Testnet is now powered by the Java Connector, with a peering relationship to rafiki, which is JS.

I think that Java, JS, and Rust each have a slightly different admin API, however, so you'll maybe instead want to make clients based upon the language implementation as opposed to any particular testnet.

Happy to answer any other questions you might have here.

@omertoast
Copy link
Member Author

omertoast commented Jun 1, 2021

Thanks for the notes. I noticed that API doesn't return a BTP endpoint, is this intentional, or RippleX nodes don't support BTP?

@sappenin
Copy link
Contributor

sappenin commented Jul 2, 2021

I noticed that API doesn't return a BTP endpoint, is this intentional, or RippleX nodes don't support BTP?

Yes, this is intentional. At first it was because I didn't have time to implement BTP, but in practice, ILP-over-HTTP works very well, so we haven't had a need or request to implement BTP in the Java Connector (I suspect we never will).

@onaks3
Copy link

onaks3 commented Mar 5, 2023

is there a way to send a curl post request to fund the wallet account

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

No branches or pull requests

4 participants