Developers Forum for XinFin XDC Network

Cover image for [WIP] How Do I Get an RPC URL for My Subnet?

[WIP] How Do I Get an RPC URL for My Subnet?

I want to enable gasless transactions for my users of platform. I have set up my Subnet, but I don't know how to connect it to ethers. I have found my subnet local device's RPC URL from localhost:3000, but I do not know if it is safe, nor feasible to use it as an endpoint. Can someone please advise me on how I can use ethers to let users on my platform transact with my subchain without paying gas? thanks.
Image description

Discussion (5)

Collapse
mitali_blocksscan profile image
Mitali_BlocksScan

Hello @gaslimit
We hope that the above issue is resolved, if the issue still persists then please let us know about it so that the team can resolve it on priority. It will be grateful to get an update within 72 hours or else it will be considered resolved.
Thank You.

Collapse
wanwiset25 profile image
Wanwiset Peerapatanapokin

Hi @gaslimit

Apologies for the delay. To allow users to push TXs on your subnet they would require a wallet with Subnet coins. As a Subnet owner you have the Grandmaster key (check keys.json) which owns all the subnet funds. Once you transfer some coins to your users they will be able to interact with your Subnet.

We have a script which uses web3.js instead of ethers for the coin transfer. Please note the script location is not finalized.
github.com/XinFinOrg/XinFin-Node/t...

Collapse
wanwiset25 profile image
Wanwiset Peerapatanapokin

Also, docs are updated on details of Subnet ports.
xinfinorg.github.io/xdc-subnet-doc...

Collapse
wanwiset25 profile image
Wanwiset Peerapatanapokin

Hi @gaslimit

For your query on Subnet RPC URL, it is by default port '8545' for subnet1 then '8546' for subnet2 and so on. You can change the config in subnetX.env files (then restart the docker image to apply). The 'localhost:3000' is the endpoint for the web UI backend server.

For your query on 'Can someone please advise me on how I can use ethers to let users on my platform transact with my subchain without paying gas?' let me revert back with the recommendation.

Collapse
vinn_9686 profile image
Vinn

Hello @gaslimit

Noted your query! I am forwarding this query to respective team and share the revert ASAP.