Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed Sep 30, 2024
1 parent 97986f6 commit 97aaeff
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ subnet/logs
subnet/relayer
subnet/stats-service
subnet/deployment-generator/script/gen.env*
.DS_Store
XDC-Subnet
keys.json
node_modules
package-lock.json
generated
*.env*
**temp
**temp
4 changes: 2 additions & 2 deletions subnet/deployment-generator/scripts/faucet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ cd ..

read -p "Input Grandmaster PK (or any source wallet with funds): " SOURCE_PK
read -p "Input destination wallet address: " DEST_ADDR
read -p "Input transfer amount " AMOUNT
read -p "Input transfer amount: " AMOUNT

extra=""
if [[ "$OSTYPE" == "darwin"* ]]; then
extra="--network generated_docker_net"
fi

docker pull xinfinorg/subnet-generator:$VERSION_GENERATOR
docker run --env-file common.env --entrypoint node $extra xinfinorg/subnet-generator:$VERSION_GENERATOR /app/src/faucet.js $SOURCE_PK $DEST_ADDR $AMOUNT
docker run --env-file common.env --entrypoint node $extra xinfinorg/subnet-generator:$VERSION_GENERATOR /app/src/faucet.js $SOURCE_PK $DEST_ADDR $AMOUNT
2 changes: 1 addition & 1 deletion subnet/deployment-generator/scripts/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ echo 'go to http://localhost:5210 to access Subnet Configuration Generator UI'
echo 'or use ssh tunnel if this is running on your server'
echo 'ssh -N -L localhost:5210:localhost:5210 <username>@<ip_address> -i <private_key_file>'
mkdir -p generated/scripts
docker run -p 5210:5210 -v $current_dir/generated:/app/generated xinfinorg/subnet-generator:$VERSION_GENERATOR || gen_success=false
docker run -p 5210:5210 -v $current_dir/generated:/app/generated xinfinorg/subnet-generator:$VERSION_GENERATOR


echo 'generating genesis.json'
Expand Down
Binary file removed subnet/deployment-generator/src/.DS_Store
Binary file not shown.
3 changes: 1 addition & 2 deletions subnet/deployment-generator/src/config_gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ function configSanityCheck(config) {
if (
!(
config.relayer_mode === "full" ||
config.relayer_mode === "lite" ||
config.relayer_mode === "temp"
config.relayer_mode === "lite"
)
) {
console.log("RELAYER_MODE only accepts 'full' or 'lite' (default full)");
Expand Down
11 changes: 4 additions & 7 deletions subnet/deployment-generator/src/faucet.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ async function processTransfer(inputs) {
let toBalance = await provider.getBalance(toAddress);
toBalance = ethers.formatEther(toBalance);
console.log("Current balance");
console.log(fromWallet.address + ":", fromBalance);
console.log(toAddress + ":", toBalance);
console.log(`${fromWallet.address}: ${fromBalance}`);
console.log(`${toAddress}: ${toBalance}`);
return {
fromBalance: fromBalance,
toBalance: toBalance,
Expand All @@ -100,12 +100,13 @@ async function faucetServer(inputs) {
fromPK = inputs[3];
fromWallet = new ethers.Wallet(fromPK);

if (command != "server") throw Error("Invalid command");
if (command != "server") {throw Error("Invalid command")};
} catch (error) {
console.log(error);
console.log(
"Usage: SUBNET_URL=<subnet_url> node faucet.js server <from wallet pk>"
);
process.exit()
}
app.set("view engine", "pug");
app.set("views", path.join(__dirname, "views_faucet"));
Expand Down Expand Up @@ -160,10 +161,6 @@ async function faucetServer(inputs) {
message: error.message
})
}
// res.json({
// "publicKey": randomWallet.address,
// "privateKey": randomWallet.privateKey
// });
});

app.use("/", router);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions subnet/deployment-generator/src/views/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,15 @@ body
.helper-block
h4 XDC Faucet
p
a(href="https://faucet.apothem.network/") Testnet(Apothem) Faucet
a(href="https://faucet.apothem.network/" target="_blank") Testnet(Apothem) Faucet
p
a(href="https://faucet.blocksscan.io/ ") Testnet and Devnet Faucet by BlocksScan
a(href="https://faucet.blocksscan.io/ " target="_blank") Testnet and Devnet Faucet by BlocksScan
.helper-block
h4 Documentation
p
a(href="https://xinfinorg.github.io/xdc-subnet-docs/deployment/launch_subnet") Official Subnet Documentation
a(href="https://xinfinorg.github.io/xdc-subnet-docs/deployment/launch_subnet" target="_blank") Official Subnet Documentation
p
a(href="https://github.com/XinFinOrg/XDC-Subnet") XDC-Subnet Github
a(href="https://github.com/XinFinOrg/XDC-Subnet" target="_blank") XDC-Subnet Github


script.
Expand Down

0 comments on commit 97aaeff

Please sign in to comment.