More tests
@ -21,3 +21,5 @@
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
|
||||||
|
public/js-client.min.js
|
@ -1,27 +1,29 @@
|
|||||||
{
|
{
|
||||||
"name": "@test/react",
|
"name": "cra-ts",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/js-client.web": "workspace:*",
|
"@fluencelabs/js-client.api": "workspace:*",
|
||||||
"@fluencelabs/fluence-network-environment": "^1.0.13",
|
"@testing-library/jest-dom": "5.16.5",
|
||||||
"@testing-library/jest-dom": "^5.16.5",
|
"@testing-library/react": "13.4.0",
|
||||||
"@testing-library/react": "^13.4.0",
|
"@testing-library/user-event": "13.5.0",
|
||||||
"@testing-library/user-event": "^13.5.0",
|
"@types/jest": "27.5.2",
|
||||||
"@types/jest": "^27.5.2",
|
"@types/node": "16.18.12",
|
||||||
"@types/node": "16.11.59",
|
"@types/react": "18.0.27",
|
||||||
"@types/react": "^18.0.18",
|
"@types/react-dom": "18.0.10",
|
||||||
"@types/react-dom": "^18.0.6",
|
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"typescript": "^4.8.2",
|
"typescript": "4.9.5",
|
||||||
"web-vitals": "^2.1.4"
|
"web-vitals": "2.1.4"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@fluencelabs/js-client.web.standalone": "workspace:*"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"start": "react-scripts start",
|
||||||
"build": "react-scripts build",
|
"build": "react-scripts build",
|
||||||
"_test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@ -1,14 +1,13 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#000000" />
|
||||||
<meta
|
<meta name="description" content="Web site created using create-react-app" />
|
||||||
name="description"
|
<script src='./js-client.min.js' async></script>
|
||||||
content="Web site created using create-react-app"
|
|
||||||
/>
|
|
||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||||
<!--
|
<!--
|
||||||
manifest.json provides metadata used when your web app is installed on a
|
manifest.json provides metadata used when your web app is installed on a
|
||||||
@ -26,6 +25,7 @@
|
|||||||
-->
|
-->
|
||||||
<title>React App</title>
|
<title>React App</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
@ -40,4 +40,5 @@
|
|||||||
To create a production bundle, use `npm run build` or `yarn build`.
|
To create a production bundle, use `npm run build` or `yarn build`.
|
||||||
-->
|
-->
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
9
packages/@tests/frameworks/cra-ts/src/App.test.tsx_
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { render, screen } from '@testing-library/react';
|
||||||
|
import App from './App';
|
||||||
|
|
||||||
|
test('renders learn react link', () => {
|
||||||
|
render(<App />);
|
||||||
|
const linkElement = screen.getByText(/learn react/i);
|
||||||
|
expect(linkElement).toBeInTheDocument();
|
||||||
|
});
|
26
packages/@tests/frameworks/cra-ts/src/App.tsx
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import logo from './logo.svg';
|
||||||
|
import './App.css';
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return (
|
||||||
|
<div className="App">
|
||||||
|
<header className="App-header">
|
||||||
|
<img src={logo} className="App-logo" alt="logo" />
|
||||||
|
<p>
|
||||||
|
Edit <code>src/App.tsx</code> and save to reload.
|
||||||
|
</p>
|
||||||
|
<a
|
||||||
|
className="App-link"
|
||||||
|
href="https://reactjs.org"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
Learn React
|
||||||
|
</a>
|
||||||
|
</header>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default App;
|
@ -6,8 +6,8 @@
|
|||||||
* Aqua version: 0.7.2-314
|
* Aqua version: 0.7.2-314
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import type { IFluencePeer, CallParams } from '@fluencelabs/interface';
|
import type { IFluencePeer, CallParams } from '@fluencelabs/js-client.api';
|
||||||
import { callFunction$$, registerService$$ } from '@fluencelabs/js-client.api/dist/compilerSupport/v4';
|
import { callFunction$$, registerService$$ } from '@fluencelabs/js-client.api';
|
||||||
|
|
||||||
// Services
|
// Services
|
||||||
|
|
23
packages/@tests/frameworks/cra-ts/src/fluence/index.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { Fluence } from '@fluencelabs/js-client.api';
|
||||||
|
import { getRelayTime } from './_aqua/smoke_test';
|
||||||
|
|
||||||
|
const relay = {
|
||||||
|
multiaddr: '/ip4/127.0.0.1/tcp/4310/ws/p2p/12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
||||||
|
peerId: '12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const main = async () => {
|
||||||
|
console.log('starting fluence...');
|
||||||
|
await Fluence.start({
|
||||||
|
connectTo: relay,
|
||||||
|
});
|
||||||
|
console.log('started fluence');
|
||||||
|
|
||||||
|
console.log('getting relay time...');
|
||||||
|
const res = await getRelayTime(relay.peerId);
|
||||||
|
console.log('got relay time, ', res);
|
||||||
|
|
||||||
|
console.log('stopping fluence...');
|
||||||
|
await Fluence.stop();
|
||||||
|
console.log('stopped fluence...');
|
||||||
|
};
|
@ -3,17 +3,20 @@ import ReactDOM from 'react-dom/client';
|
|||||||
import './index.css';
|
import './index.css';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
import reportWebVitals from './reportWebVitals';
|
import reportWebVitals from './reportWebVitals';
|
||||||
|
import { main } from './fluence/';
|
||||||
|
|
||||||
const root = ReactDOM.createRoot(
|
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
||||||
document.getElementById('root') as HTMLElement
|
|
||||||
);
|
|
||||||
root.render(
|
root.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<App />
|
<App />
|
||||||
</React.StrictMode>
|
</React.StrictMode>,
|
||||||
);
|
);
|
||||||
|
|
||||||
// If you want to start measuring performance in your app, pass a function
|
// If you want to start measuring performance in your app, pass a function
|
||||||
// to log results (for example: reportWebVitals(console.log))
|
// to log results (for example: reportWebVitals(console.log))
|
||||||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
||||||
reportWebVitals();
|
reportWebVitals();
|
||||||
|
|
||||||
|
main()
|
||||||
|
.then(() => console.log('done!'))
|
||||||
|
.catch((err) => console.error('error: ', err));
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
26
packages/@tests/frameworks/cra-ts/tsconfig.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"lib": [
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"esnext"
|
||||||
|
],
|
||||||
|
"allowJs": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"strict": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"jsx": "react-jsx"
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src"
|
||||||
|
]
|
||||||
|
}
|
@ -1,47 +0,0 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
|
||||||
import logo from "./logo.svg";
|
|
||||||
import "./App.css";
|
|
||||||
|
|
||||||
import { makeDefaultPeer } from "@fluencelabs/js-client.web";
|
|
||||||
import { krasnodar } from "@fluencelabs/fluence-network-environment";
|
|
||||||
|
|
||||||
const relayNode = krasnodar[4];
|
|
||||||
|
|
||||||
const peer = makeDefaultPeer();
|
|
||||||
|
|
||||||
function App() {
|
|
||||||
const [connected, setConnected] = useState<boolean>(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
peer.start({ connectTo: relayNode })
|
|
||||||
.then(() => {
|
|
||||||
setConnected(true);
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.log("Client initialization failed", err);
|
|
||||||
setConnected(false);
|
|
||||||
});
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="App">
|
|
||||||
<header className="App-header">
|
|
||||||
<img src={logo} className="App-logo" alt="logo" />
|
|
||||||
<p>Connected: ${connected}</p>
|
|
||||||
<p>
|
|
||||||
Edit <code>src/App.tsx</code> and save to reload.
|
|
||||||
</p>
|
|
||||||
<a
|
|
||||||
className="App-link"
|
|
||||||
href="https://reactjs.org"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
Learn React
|
|
||||||
</a>
|
|
||||||
</header>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App;
|
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "./dist"
|
|
||||||
},
|
|
||||||
"exclude": ["node_modules", "dist"]
|
|
||||||
}
|
|
@ -9,22 +9,16 @@
|
|||||||
"pnpm": ">=3"
|
"pnpm": ">=3"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "pnpm copy-script",
|
||||||
"compile-aqua": "aqua -i ../aqua/ -o ./src/_aqua",
|
|
||||||
"serve": "http-server public",
|
"serve": "http-server public",
|
||||||
"copy-script": "cp ../../client/js-client.web.standalone/dist/js-client.min.js ./public"
|
"copy-script": "cp ../../client/js-client.web.standalone/dist/js-client.min.js ./public"
|
||||||
},
|
},
|
||||||
"repository": "https://github.com/fluencelabs/fluence-js",
|
"repository": "https://github.com/fluencelabs/fluence-js",
|
||||||
"author": "Fluence Labs",
|
"author": "Fluence Labs",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {},
|
||||||
"@fluencelabs/js-client.api": "workspace:*",
|
|
||||||
"@fluencelabs/interface": "workspace:*",
|
|
||||||
"@fluencelabs/fluence-network-environment": "1.0.13"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fluencelabs/js-peer": "workspace:*",
|
"@fluencelabs/js-peer": "workspace:*",
|
||||||
"@fluencelabs/aqua": "0.9.1-374",
|
|
||||||
"http-server": "14.1.1"
|
"http-server": "14.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
<title>Smoke test for web</title>
|
<title>Smoke test for web</title>
|
||||||
<script src="./js-client.min.js" async></script>
|
<script src="./js-client.min.js"></script>
|
||||||
|
<script src="./index.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -14,7 +15,6 @@
|
|||||||
<main>
|
<main>
|
||||||
<h1>Open console f12</h1>
|
<h1>Open console f12</h1>
|
||||||
</main>
|
</main>
|
||||||
<script src="../src/index.ts" type="module"></script>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
103
packages/@tests/smoke_web/public/index.js
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
const peer = globalThis.defaultPeer;
|
||||||
|
|
||||||
|
const relay = {
|
||||||
|
multiaddr: '/ip4/127.0.0.1/tcp/4310/ws/p2p/12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
||||||
|
peerId: '12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
||||||
|
};
|
||||||
|
|
||||||
|
const getRelayTime = (relayPeerId) => {
|
||||||
|
const script = `
|
||||||
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "relayPeerId") [] relayPeerId)
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(xor
|
||||||
|
(seq
|
||||||
|
(call relayPeerId ("peer" "timestamp_ms") [] ts)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(xor
|
||||||
|
(call %init_peer_id% ("callbackSrv" "response") [ts])
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||||
|
)
|
||||||
|
`;
|
||||||
|
|
||||||
|
const def = {
|
||||||
|
functionName: 'getRelayTime',
|
||||||
|
arrow: {
|
||||||
|
tag: 'arrow',
|
||||||
|
domain: {
|
||||||
|
tag: 'labeledProduct',
|
||||||
|
fields: {
|
||||||
|
relayPeerId: {
|
||||||
|
tag: 'scalar',
|
||||||
|
name: 'string',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
codomain: {
|
||||||
|
tag: 'unlabeledProduct',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
tag: 'scalar',
|
||||||
|
name: 'u64',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
names: {
|
||||||
|
relay: '-relay-',
|
||||||
|
getDataSrv: 'getDataSrv',
|
||||||
|
callbackSrv: 'callbackSrv',
|
||||||
|
responseSrv: 'callbackSrv',
|
||||||
|
responseFnName: 'response',
|
||||||
|
errorHandlingSrv: 'errorHandlingSrv',
|
||||||
|
errorFnName: 'error',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const config = {};
|
||||||
|
|
||||||
|
const args = {};
|
||||||
|
return peer.compilerSupport.callFunction({
|
||||||
|
args,
|
||||||
|
def,
|
||||||
|
config,
|
||||||
|
script,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const main = async () => {
|
||||||
|
console.log('starting fluence...');
|
||||||
|
await peer.start({
|
||||||
|
connectTo: relay,
|
||||||
|
});
|
||||||
|
console.log('started fluence');
|
||||||
|
|
||||||
|
console.log('getting relay time...');
|
||||||
|
const res = await getRelayTime(relay.peerId);
|
||||||
|
console.log('got relay time, ', res);
|
||||||
|
|
||||||
|
console.log('stopping fluence...');
|
||||||
|
await peer.stop();
|
||||||
|
console.log('stopped fluence...');
|
||||||
|
};
|
||||||
|
|
||||||
|
main()
|
||||||
|
.then(() => console.log('done!'))
|
||||||
|
.catch((err) => console.error('error: ', err));
|
@ -1,16 +0,0 @@
|
|||||||
import { Fluence } from '@fluencelabs/js-client.api';
|
|
||||||
|
|
||||||
const relay = {
|
|
||||||
multiaddr: '/ip4/127.0.0.1/tcp/4310/ws/p2p/12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
|
||||||
peerId: '12D3KooWKEprYXUXqoV5xSBeyqrWLpQLLH4PXfvVkDJtmcqmh5V3',
|
|
||||||
};
|
|
||||||
|
|
||||||
const main = async () => {
|
|
||||||
await Fluence.start({
|
|
||||||
connectTo: relay,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
main()
|
|
||||||
.then(() => console.log('done!'))
|
|
||||||
.catch((err) => console.error('error: ', err));
|
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"module": "CommonJS",
|
|
||||||
"target": "ES5",
|
|
||||||
"outDir": "./dist",
|
|
||||||
"moduleResolution": "node"
|
|
||||||
},
|
|
||||||
"exclude": ["node_modules", "dist"]
|
|
||||||
}
|
|
@ -21,6 +21,14 @@
|
|||||||
"./compilerSupport/v4": {
|
"./compilerSupport/v4": {
|
||||||
"import": "./dist/compilerSupport/v4.js",
|
"import": "./dist/compilerSupport/v4.js",
|
||||||
"types": "./dist/compilerSupport/v4.d.ts"
|
"types": "./dist/compilerSupport/v4.d.ts"
|
||||||
|
},
|
||||||
|
"./dist/compilerSupport/v3": {
|
||||||
|
"import": "./dist/compilerSupport/v3.js",
|
||||||
|
"types": "./dist/compilerSupport/v3.d.ts"
|
||||||
|
},
|
||||||
|
"./dist/compilerSupport/v4": {
|
||||||
|
"import": "./dist/compilerSupport/v4.js",
|
||||||
|
"types": "./dist/compilerSupport/v4.d.ts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { IFluencePeer } from './v3';
|
export { IFluencePeer } from './v3.js';
|
||||||
export { CallParams as CallParams$$ } from './v3';
|
export { CallParams as CallParams$$ } from './v3.js';
|
||||||
export {
|
export {
|
||||||
ArrayType as ArrayType$$,
|
ArrayType as ArrayType$$,
|
||||||
ArrowType as ArrowType$$,
|
ArrowType as ArrowType$$,
|
||||||
@ -38,4 +38,4 @@ export {
|
|||||||
UnlabeledProductType as UnlabeledProductType$$,
|
UnlabeledProductType as UnlabeledProductType$$,
|
||||||
callFunction as callFunction$$,
|
callFunction as callFunction$$,
|
||||||
registerService as registerService$$,
|
registerService as registerService$$,
|
||||||
} from './v3';
|
} from './v3.js';
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import type { IFluencePeer, PeerConfig } from '@fluencelabs/interface';
|
import type { IFluencePeer, PeerConfig } from '@fluencelabs/interface';
|
||||||
|
|
||||||
|
export { IFluencePeer, PeerConfig, CallParams } from '@fluencelabs/interface';
|
||||||
|
export { registerService$$, callFunction$$ } from './compilerSupport/v4.js';
|
||||||
|
|
||||||
const getPeerFromGlobalThis = (): IFluencePeer | undefined => {
|
const getPeerFromGlobalThis = (): IFluencePeer | undefined => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return globalThis.defaultPeer;
|
return globalThis.defaultPeer;
|
||||||
|
@ -372,18 +372,19 @@ export class FluencePeer implements IFluencePeer {
|
|||||||
|
|
||||||
registerDefaultServices(this);
|
registerDefaultServices(this);
|
||||||
|
|
||||||
this._classServices = {
|
// TODO: doesn't work in web, fix!
|
||||||
sig: new Sig(this._keyPair),
|
// this._classServices = {
|
||||||
srv: new Srv(this),
|
// sig: new Sig(this._keyPair),
|
||||||
};
|
// srv: new Srv(this),
|
||||||
this._classServices.sig.securityGuard = defaultSigGuard(peerId);
|
// };
|
||||||
registerSig(this, 'sig', this._classServices.sig);
|
// this._classServices.sig.securityGuard = defaultSigGuard(peerId);
|
||||||
registerSig(this, peerId, this._classServices.sig);
|
// registerSig(this, 'sig', this._classServices.sig);
|
||||||
|
// registerSig(this, peerId, this._classServices.sig);
|
||||||
|
|
||||||
registerSrv(this, 'single_module_srv', this._classServices.srv);
|
// registerSrv(this, 'single_module_srv', this._classServices.srv);
|
||||||
registerNodeUtils(this, 'node_utils', new NodeUtils(this));
|
// registerNodeUtils(this, 'node_utils', new NodeUtils(this));
|
||||||
|
|
||||||
this._startParticleProcessing();
|
// this._startParticleProcessing();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|