Skip to content

Commit

Permalink
Skip sync step on one click install; fixed network name for services
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeevDmitry committed Jun 24, 2024
1 parent 074a1be commit fbc0433
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 54 deletions.
54 changes: 29 additions & 25 deletions launcher/src/backend/ethereum-services/GethService.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,41 @@ export class GethService extends NodeService {
new ServiceVolume(workingDir + "/engine.jwt", JWTDir),
];

const command = [
`--datadir=${dataDir}`,
"--http",
"--http.port=8545",
"--http.addr=0.0.0.0",
"--http.vhosts=*",
"--http.api=eth,web3,net",
"--http.corsdomain=*",
"--ws",
"--ws.port=8546",
"--ws.addr=0.0.0.0",
"--ws.api=eth,net,web3",
"--ws.origins=*",
"--authrpc.port=8551",
"--authrpc.addr=0.0.0.0",
"--authrpc.vhosts=*",
"--authrpc.jwtsecret=/engine.jwt",
"--metrics",
"--metrics.expensive",
"--metrics.port=6060",
"--metrics.addr=0.0.0.0",
"--syncmode=full",
]

if (network !== 'stratis') {
command.unshift(`--${network}`)
}

service.init(
"GethService", // service
service.id, // id
1, // configVersion
"stratisevm/go-stratis", // image
"latest", // imageVersion
[
`--${network}`,
`--datadir=${dataDir}`,
"--state.scheme=path",
"--http",
"--http.port=8545",
"--http.addr=0.0.0.0",
"--http.vhosts=*",
"--http.api=eth,web3,net",
"--http.corsdomain=*",
"--ws",
"--ws.port=8546",
"--ws.addr=0.0.0.0",
"--ws.api=eth,net,web3",
"--ws.origins=*",
"--authrpc.port=8551",
"--authrpc.addr=0.0.0.0",
"--authrpc.vhosts=*",
"--authrpc.jwtsecret=/engine.jwt",
"--metrics",
"--metrics.expensive",
"--metrics.port=6060",
"--metrics.addr=0.0.0.0",
"--syncmode=full",
], // command
command, // command
["geth"], // entrypoint
null, // env
ports, // ports
Expand Down
8 changes: 2 additions & 6 deletions launcher/src/backend/ethereum-services/PrysmBeaconService.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ export class PrysmBeaconService extends NodeService {
let builderCommand = mevboostEndpoint ? " --http-mev-relay=" + mevboostEndpoint : "";
let checkpointCommand = checkpointURL ? " --checkpoint-sync-url=" + checkpointURL : "";

if (network === 'stratis') {
network = 'mainnet'
}

service.init(
"PrysmBeaconService", //service
service.id, //id
Expand All @@ -53,8 +49,8 @@ export class PrysmBeaconService extends NodeService {
"latest", //imageVersion
"/app/cmd/beacon-chain/beacon-chain --accept-terms-of-use=true --datadir=" +
dataDir +
' --p2p-host-dns="" --' +
network +
' --p2p-host-dns="" ' +
(network === 'stratis' ? '' : `--${network}`) +
" --block-batch-limit=512" +
" --rpc-host=0.0.0.0 --grpc-gateway-host=0.0.0.0 --p2p-max-peers=100 --execution-endpoint=" +
executionEndpoint +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ export class PrysmValidatorService extends NodeService {
})
.join();

if (network === 'stratis') {
network = 'mainnet'
}

service.init(
"PrysmValidatorService", //service
service.id, //id
Expand All @@ -47,8 +43,8 @@ export class PrysmValidatorService extends NodeService {
provider +
'" --beacon-rpc-gateway-provider="' +
providerGateway +
'" --web --' +
network +
'" --web ' +
(network === 'stratis' ? '' : `--${network}`) +
" --datadir=" +
dataDir +
" --wallet-dir=" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,18 @@ const openDropdown = ref(false);
//watchers
watch(displayItem, () => {
if (displayItem.value === "Click to select a network") {
clickStore.selectedPreset = null;
}
});
// watch(displayItem, () => {
// if (displayItem.value === "Click to select a network") {
// clickStore.selectedPreset = null;
// }
// });
//Lifecycle
onMounted(() => {
clickStore.installMonitoring = false;
displayItem.value = "Click to select a network";
// clickStore.presets.forEach((p) => (p.selected = false));
// Select `staking` preset by default
emit("installPreset", clickStore.presets.find((p) => p.name === 'staking'))
});
//Methods
Expand All @@ -138,6 +136,9 @@ const getNetwork = (network) => {
clickStore.presets.forEach((p) => (p.selected = false));
manageStore.currentNetwork = network;
displayItem.value = network;
// Select `staking` preset by default
const preset = clickStore.presets.find((p) => p.name === 'staking')
getPreset(preset)
};
const getPreset = (preset) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,23 @@ import { ref, onMounted } from 'vue';
</template>
<script setup>
import { useClickInstall } from "@/store/clickInstallation";
import { useNodeManage } from "@/store/nodeManage";
import { onMounted } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();
const clickStore = useClickInstall();
const manageStore = useNodeManage();
onMounted(() => {
if (Object.keys(clickStore.selectedPreset).length === 0) {
router.push("/oneClick/config");
}
});
onMounted(() => {
manageStore.currentNetwork = manageStore.currentNetwork.hasOwnProperty("id")
? manageStore.currentNetwork
: manageStore.configNetwork;
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@mousedown.prevent
>
<router-link
to="/oneClick/sync"
to="/oneClick/config"
class="col-start-1 col-span-2 row-start-1 row-span-2 justify-self-end w-[120px] h-12 bg-[#264744] hover:bg-[#447a75] rounded-full py-2 px-4 flex justify-center items-center hover:scale-110 hover:shadow-lg hover:shadow-[#1e2a29] transition-all duration-300 ease-in-out active:scale-100 active:shadow-none"
>
<span class="text-gray-200 text-xl font-semibold text-center uppercase">{{ $t("customFooter.back") }}</span>
Expand Down
18 changes: 9 additions & 9 deletions launcher/src/composables/nextRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export function goToNext() {
case "/oneClick/preset":
return "/oneClick/config";
case "/oneClick/config":
if (installStore.selectedPreset.includedPlugins.some((plugin) => plugin.service === "FlashbotsMevBoostService")) {
return "/oneClick/mevboost";
} else {
return "/oneClick/sync";
}
case "/oneClick/mevboost":
return "/oneClick/sync";
case "/oneClick/sync":
return "/oneClick/verify";
// if (installStore.selectedPreset.includedPlugins.some((plugin) => plugin.service === "FlashbotsMevBoostService")) {
// return "/oneClick/mevboost";
// } else {
return "/oneClick/verify";
// }
// case "/oneClick/mevboost":
// return "/oneClick/verify";
// case "/oneClick/sync":
// return "/oneClick/verify";
case "/oneClick/verify":
return "/oneClick/launch";
default:
Expand Down

0 comments on commit fbc0433

Please sign in to comment.