Skip to content

Commit

Permalink
Register CN before healthy (#3969)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheran-senthil committed Sep 30, 2022
1 parent 612a833 commit 2147bfe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
22 changes: 1 addition & 21 deletions creator-node/scripts/register.js
Expand Up @@ -26,32 +26,12 @@ async function main() {

await audiusLibs.init();

// Wait for node to be healthy
let healthy = false;
while (!healthy) {
try {
const { data } = await axios({
url: "/health_check",
baseURL: config.get("creatorNodeEndpoint"),
method: "get",
timeout: 1000,
});

healthy = data.data.healthy;
} catch (e) {
}

if (!healthy) {
console.log("waiting for node to be healthy");
await new Promise(resolve => setTimeout(resolve, 5000));
}
}

const tx = await audiusLibs.ethContracts.ServiceProviderFactoryClient.registerWithDelegate(
"content-node",
config.get("creatorNodeEndpoint"),
new BN("200000000000000000000000"),
config.get("delegateOwnerWallet"),
false,
);
}

Expand Down
1 change: 0 additions & 1 deletion dev-tools/audius-cmd
Expand Up @@ -9,7 +9,6 @@ fi
tmpfiles=()
updated_args=()
for arg in "$@"; do
echo "$arg"
if [[ "$arg" == :* ]]; then
filename="${arg:1}"
tmpfile="/tmp/$RANDOM.${filename#*.}"
Expand Down

0 comments on commit 2147bfe

Please sign in to comment.