Skip to content

Commit

Permalink
Website fixes for latest Walrus testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
mario4tier committed Dec 15, 2024
1 parent 8358814 commit 35bf588
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,22 @@ const main = async () => {

let siteObjectId = await readSiteObjectId(configFilePathFull)

console.log('Buying test WAL coins from the faucet...')
try {
execSync(`walrus --wallet ${WALLET_CONFIG_PATH_FULL} get-wal`, {
stdio: 'inherit',
})
} catch (e) {
console.warn(e)
}

// If the site has not yet been published (no site object ID in the config),
// then publish the site to Walrus Sites.
if (siteObjectId == null) {
console.log('Publishing the app to Walrus Sites...')
const exec_command = `site-builder --config ${walrusConfigPathFull} --wallet ${WALLET_CONFIG_PATH_FULL} publish ${sitePathFull}`
console.log(`exec: ${exec_command}`)
const { stdout, stderr } = await exec(exec_command)
const { stdout, stderr } = await exec(
`site-builder --config ${walrusConfigPathFull} --wallet ${WALLET_CONFIG_PATH_FULL} publish ${sitePathFull}`
)

// Get the site object ID from the publish command output.
stdout.on('data', async (data) => {
Expand All @@ -61,7 +70,8 @@ const main = async () => {

stderr.on('data', async (error) => {
console.error(error)
// Do not exit if the line starts with "[warn]"
// Do not exit if it's a warning.
// @todo: Find a better way to catch warnings, e.g. by severity level or error code.
if (error.startsWith('[warn]')) {
return
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# module: site
# portal: walrus.site
package: 0x514cf7ce2df33b9e2ca69e75bc9645ef38aca67b6f2852992a34e35e9f907f58
package: 0xdf9033cac39b7a9b9f76fb6896c9fc5283ba730d6976a2b1d85ad1e6036c3272
# general:
# rpc_url: https://fullnode.testnet.sui.io:443
# wallet: /path/to/.sui/sui_config/client.yaml
Expand Down

0 comments on commit 35bf588

Please sign in to comment.