forked from rollkit/rollkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rollkit rebuild command to update entrypoint (rollkit#1707)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a `rebuild` command to the CLI for rebuilding the rollup entrypoint based on configuration in `rollkit.toml`. - **Refactor** - Improved the logic for building and running entrypoint binaries by introducing a dedicated function to handle the build process. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Javed Khan <[email protected]>
- Loading branch information
1 parent
d674e80
commit f7d735e
Showing
5 changed files
with
84 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package commands | ||
|
||
import ( | ||
"log" | ||
|
||
rollconf "github.com/rollkit/rollkit/config" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
// RebuildCmd is a command to rebuild rollup entrypoint | ||
var RebuildCmd = &cobra.Command{ | ||
Use: "rebuild", | ||
Short: "Rebuild rollup entrypoint", | ||
Long: "Rebuild rollup entrypoint specified in the rollkit.toml", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
var err error | ||
rollkitConfig, err = rollconf.ReadToml() | ||
if err != nil { | ||
log.Fatalf("Could not read rollkit.toml file: %s", err) | ||
} | ||
|
||
if _, err := buildEntrypoint(rollkitConfig.RootDir, rollkitConfig.Entrypoint, true); err != nil { | ||
log.Fatalf("Could not rebuild rollup entrypoint: %s", err) | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## rollkit rebuild | ||
|
||
Rebuild rollup entrypoint | ||
|
||
### Synopsis | ||
|
||
Rebuild rollup entrypoint specified in the rollkit.toml | ||
|
||
``` | ||
rollkit rebuild [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for rebuild | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--home string directory for config and data (default "HOME/.rollkit") | ||
--log_level string set the log level; default is info. other options include debug, info, error, none (default "info") | ||
--trace print out full stack trace on errors | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [rollkit](rollkit.md) - The first sovereign rollup framework that allows you to launch a sovereign, customizable blockchain as easily as a smart contract. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters