Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

Commit

Permalink
fix: upgrade service runner to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejonas committed Aug 5, 2019
1 parent fb7d2e6 commit 99d6ffc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@etclabscore/ethereum-json-rpc": "^1.0.13",
"@etclabscore/jade-service-runner-client": "^1.2.2",
"@etclabscore/jade-service-runner-client": "^1.2.3",
"@material-ui/core": "^4.1.3",
"@material-ui/icons": "^4.2.1",
"@material-ui/styles": "^4.1.2",
Expand All @@ -47,7 +47,7 @@
"victory": "^31.3.0"
},
"devDependencies": {
"@etclabscore/jade-service-runner": "^1.2.2",
"@etclabscore/jade-service-runner": "^1.2.3",
"@types/bignumber.js": "^4.0.3",
"@types/jest": "^21.1.6",
"@types/node": "^8.0.51",
Expand Down
5 changes: 2 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const useStyles = makeStyles((theme: Theme) => ({

function App(props: any) {
const darkMode = useDarkMode();
const [serviceRunner, serviceRunnerUrl, setServiceRunnerUrl] = useServiceRunner();
const [serviceRunner, serviceRunnerUrl, setServiceRunnerUrl] = useServiceRunner("http://localhost:8002");
const [erpc] = useMultiGeth(serviceRunner, serviceRunnerUrl, "1.9.0", "mainnet");
const theme = darkMode.value ? darkTheme : lightTheme;
const classes = useStyles(theme);
Expand All @@ -48,8 +48,7 @@ function App(props: any) {
erpc.stopBatch();
erpc.startBatch();
}
//
}, 3000, true);
}, 100, true);

return (
<ERPCContext.Provider value={erpc}>
Expand Down
8 changes: 3 additions & 5 deletions src/hooks/useMultiGeth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ function useMultiGeth(
return;
}
const runAsync = async () => {
console.log(serviceRunnerUrl); //tslint:disable-line
const installed = await serviceRunner.installService(serviceName, version);
console.log("installed", installed); //tslint:disable-line
if (!installed) {
return;
}
await serviceRunner.startService(serviceName, version, env);
let parsedUrl;
try {
parsedUrl = new URL(`${serviceRunnerUrl}/${serviceName}/${env}/${version}`);
} catch (e) {
console.error("error parsing url", e);
return;
}
let rpc;
Expand All @@ -40,9 +40,7 @@ function useMultiGeth(
path: parsedUrl.pathname,
},
});
console.log("rpc", rpc);
} catch (e) {
console.error("erroro making rpc client", e);
return;
}
if (rpc) {
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useServiceRunner.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import JadeServiceRunner from "@etclabscore/jade-service-runner-client";
import * as React from "react";

function useServiceRunner(): [JadeServiceRunner | undefined, string, any] {
const [url, setUrl] = React.useState("http://localhost:8002");
function useServiceRunner(defaultUrl: string): [JadeServiceRunner | undefined, string, any] {
const [url, setUrl] = React.useState(defaultUrl);
const [serviceRunner, setServiceRunner] = React.useState<JadeServiceRunner | undefined>();
React.useEffect(() => {
if (!url) {
Expand Down

0 comments on commit 99d6ffc

Please sign in to comment.