123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- // import { getMainnet } from './getMainnet.js'
- // EOS配置
- export function getNetwork () {
- var newwork = {}
- // 并发请求,获取最快主网
- // EOS_HOST = await getMainnet()
- if (window.location.port === '8080' || /^test|\.webdev2\./.test(window.location.host)) {
- newwork = {
- protocol: 'https',
- blockchain: 'eos',
- port: '443',
- host: 'localnet.eosget.io',
- chainId: 'cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f'
- }
- } else {
- newwork = {
- protocol: EOS_PROTOCOL,
- blockchain: 'eos',
- // host: 'nodes.get-scatter.com',
- port: EOS_PORT,
- host: EOS_HOST,
- chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906'
- }
- }
- return newwork
- }
- // 修改eos配置
- export function changeNewWork (host) {
- return {
- protocol: 'https',
- blockchain: 'eos',
- host,
- port: '',
- chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906'
- }
- }
- // WebSocket
- export function getWsUrl () {
- var wsUrl
- if (window.location.port === '8080' || /^test|\.webdev2\./.test(window.location.host)) {
- if (document.location.protocol === 'https:') {
- wsUrl = 'wss://test-ws.mee.chat'
- } else {
- wsUrl = 'ws://test-ws.mee.chat'
- }
- } else {
- if (document.location.protocol === 'https:') {
- wsUrl = 'wss://ws.mee.chat'
- } else {
- wsUrl = 'ws://ws.mee.chat'
- }
- }
- return wsUrl
- }
- export function getMiniWsUrl () {
- var wsUrl
- if (window.location.port === '8080' || /^test|\.webdev2\./.test(window.location.host)) {
- if (document.location.protocol === 'https:') {
- wsUrl = 'wss://test-ws-group.mee.chat'
- } else {
- wsUrl = 'ws://test-ws-group.mee.chat'
- }
- } else {
- if (document.location.protocol === 'https:') {
- wsUrl = 'wss://ws-group.mee.chat'
- } else {
- wsUrl = 'ws://ws-group.mee.chat'
- }
- }
- return wsUrl
- }
- // 主网
- export var mainNetMap = {
- 'eosplay': 'eosjs.eosplay.com',
- // 'hkeos': 'api.hkeos.com',
- 'cypherglass': 'api.cypherglass.com',
- 'eoscannon': 'mainnet.eoscannon.io',
- 'eosbeijing': 'api.eosbeijing.one',
- 'eosn': 'api.eosn.io',
- 'eosys': 'rpc.eosys.io',
- // 'eosnewyork': 'api.eosnewyork.io',
- 'get-scatter': 'nodes.get-scatter.com'
- // 'proxy': 'proxy.eosnode.tools'
- }
|