Skip to content

Commit

Permalink
polkadot parachain default endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
vol4tim committed Oct 29, 2024
1 parent a74d8ff commit e368b62
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
default_rpc_endpoint: "wss://polkadot.rpc.robonomics.network/"
};
4 changes: 2 additions & 2 deletions src/hooks/useDevices.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import configApp from "@/config";
import { validateAddress } from "@polkadot/util-crypto";
import { onUnmounted, ref, watch } from "vue";
import { useRobonomics } from "./useRobonomics";
Expand All @@ -9,8 +10,7 @@ export const useDevices = (initialOwner = null) => {

const getDevices = async (owner) => {
const endpoint =
localStorage.getItem("rpc-parachain") ||
"wss://kusama.rpc.robonomics.network/";
localStorage.getItem("rpc-parachain") || configApp.default_rpc_endpoint;
const lsKey = `hadevices:${endpoint}:${owner}`;

if (!isReady.value) {
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useSubscription.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import configApp from "@/config";
import { createType, TypeRegistry } from "@polkadot/types";
import { validateAddress } from "@polkadot/util-crypto";
import { computed, ref, shallowRef, watch } from "vue";
Expand Down Expand Up @@ -50,8 +51,7 @@ export const useSubscription = (initialOwner = null) => {

const getLedger = async (owner) => {
const endpoint =
localStorage.getItem("rpc-parachain") ||
"wss://kusama.rpc.robonomics.network/";
localStorage.getItem("rpc-parachain") || configApp.default_rpc_endpoint;
const lsKey = `hasubscription:${endpoint}:${owner}`;

if (!isReady.value) {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/robonomics.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import configApp from "@/config";
import keyring from "@polkadot/ui-keyring";
import { Robonomics } from "robonomics-interface";
import { ref, shallowRef } from "vue";
Expand All @@ -19,8 +20,7 @@ export default {

if (!endpoint) {
endpoint =
localStorage.getItem("rpc-parachain") ||
"wss://kusama.rpc.robonomics.network/";
localStorage.getItem("rpc-parachain") || configApp.default_rpc_endpoint;
}
localStorage.setItem("rpc-parachain", endpoint);
const config = {
Expand Down
4 changes: 2 additions & 2 deletions src/views/telemetry/common.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import configApp from "@/config";
import { useIpfs } from "@/hooks/useIpfs";
import { useRobonomics } from "@/hooks/useRobonomics";
import { createPair, encryptor } from "@/utils/encryptor";
Expand Down Expand Up @@ -165,8 +166,7 @@ export const useConfig = () => {

const getConfig = async (controller) => {
const endpoint =
localStorage.getItem("rpc-parachain") ||
"wss://kusama.rpc.robonomics.network/";
localStorage.getItem("rpc-parachain") || configApp.default_rpc_endpoint;
const lsKey = `haconfig:${endpoint}:${controller}`;

if (!isReady.value) {
Expand Down

0 comments on commit e368b62

Please sign in to comment.