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

Set up RPC access for PontusX #1318

Closed
wants to merge 1 commit into from

Conversation

csillag
Copy link
Contributor

@csillag csillag commented Mar 6, 2024

(To verify balances.)

(To verify balances.)
Copy link

github-actions bot commented Mar 6, 2024

Deployed to Cloudflare Pages

Latest commit: 7c6e5e4c8a522975ed230ed78f0a53b27a68c6ad
Status:✅ Deploy successful!
Preview URL: https://ea5c0b0f.oasis-explorer.pages.dev

@@ -13,6 +13,7 @@ const RPC_ENDPOINTS: Record<Network, Partial<Record<Layer, string>>> = {
[Network.testnet]: {
[Layer.emerald]: 'https://testnet.emerald.oasis.dev',
[Layer.sapphire]: 'https://testnet.sapphire.oasis.dev',
[Layer.pontusx]: 'https://grpc.sapphire.testnet.oasiscloud.io:443',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notes from discussions:

// node node-get-runtime-balance.mjs
import oasis from '@oasisprotocol/client'
import oasisRT from '@oasisprotocol/client-rt'
import xhr2 from 'xhr2'
global.XMLHttpRequest = xhr2 // fixes oasis sdk in nodejs

  const testnetNic = new oasis.client.NodeInternal('https://testnet.grpc.oasis.dev')
  const accountsWrapper = new oasisRT.accounts.Wrapper(oasis.misc.fromHex('0000000000000000000000000000000000000000000000004febe52eb412b421'));

  const daveEthAddr = '0x9c26685b6E8e2997d9aAf3f1a642f1b1b3dB9580';
  const daveEthAddrU8 = oasis.misc.fromHex(daveEthAddr.slice(2));
  const daveAddr = await oasis.address.fromData(
    oasisRT.address.V0_SECP256K1ETH_CONTEXT_IDENTIFIER,
    oasisRT.address.V0_SECP256K1ETH_CONTEXT_VERSION,
    daveEthAddrU8,
  );

  (await accountsWrapper.queryBalances().setArgs({address: daveAddr,}).query(testnetNic)).balances
    .forEach((balance, name) => console.log(oasis.misc.toStringUTF8(name) || 'native', oasis.quantity.toBigInt(balance)));
  // native 908027345930000000000n
  // TEST 10000000000000000000n

  // https://explorer.dev.oasis.io/testnet/pontusx/address/0x9c26685b6E8e2997d9aAf3f1a642f1b1b3dB9580
  // 908.02734593 EUROe
  // 10 TEST

@csillag
Copy link
Contributor Author

csillag commented Mar 26, 2024

Superseded by #1338. Closing.

@csillag csillag closed this Mar 26, 2024
@lukaw3d lukaw3d deleted the csillag/enable-pontusx-rpc-access branch April 5, 2024 05:21
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

Successfully merging this pull request may close these issues.

2 participants