@@ -4,12 +4,12 @@ use std::io::{prelude::*, BufReader, Read};
44use std:: path:: PathBuf ;
55use std:: { env, process} ;
66
7- use crate :: console :: load_session;
8- use crate :: devnet :: { self , DevnetOrchestrator } ;
7+ use crate :: poke :: load_session;
8+ use crate :: integrate :: { self , DevnetOrchestrator } ;
99use crate :: test:: run_tests;
1010use crate :: types:: { MainConfig , MainConfigFile , RequirementConfig } ;
1111use crate :: {
12- generators :: {
12+ generate :: {
1313 self ,
1414 changes:: { Changes , TOMLEdition } ,
1515 } ,
@@ -54,30 +54,30 @@ struct Opts {
5454
5555#[ derive( Clap ) ]
5656enum Command {
57- /// New subcommand
57+ /// Create and scaffold a new project
5858 #[ clap( name = "new" ) ]
5959 New ( GenerateProject ) ,
6060 /// Contract subcommand
6161 #[ clap( name = "contract" ) ]
6262 Contract ( Contract ) ,
63- /// Console subcommand
64- #[ clap( name = "console " ) ]
65- Console ( Console ) ,
66- /// Test subcommand
63+ /// Load contracts in a REPL for interactions
64+ #[ clap( name = "poke " ) ]
65+ Poke ( Poke ) ,
66+ /// Execute test suite
6767 #[ clap( name = "test" ) ]
6868 Test ( Test ) ,
69- /// Check subcommand
69+ /// Check contracts syntax
7070 #[ clap( name = "check" ) ]
7171 Check ( Check ) ,
72- /// Deploy subcommand
73- #[ clap( name = "deploy " ) ]
74- Deploy ( Deploy ) ,
75- /// Run subcommand
72+ /// Publish contracts on chain
73+ #[ clap( name = "publish " ) ]
74+ Publish ( Publish ) ,
75+ /// Execute Clarinet Extension
7676 #[ clap( name = "run" ) ]
7777 Run ( Run ) ,
7878 /// Devnet subcommand
79- #[ clap( name = "devnet " ) ]
80- Devnet ( Devnet ) ,
79+ #[ clap( name = "integrate " ) ]
80+ Integrate ( Integrate ) ,
8181}
8282
8383#[ derive( Clap ) ]
@@ -142,7 +142,7 @@ struct ForkContract {
142142}
143143
144144#[ derive( Clap ) ]
145- struct Console {
145+ struct Poke {
146146 /// Print debug info
147147 #[ clap( short = 'd' ) ]
148148 pub debug : bool ,
@@ -152,14 +152,7 @@ struct Console {
152152}
153153
154154#[ derive( Clap ) ]
155- enum Devnet {
156- /// Start Devnet subcommand
157- #[ clap( name = "start" ) ]
158- Start ( StartDevnet ) ,
159- }
160-
161- #[ derive( Clap ) ]
162- struct StartDevnet {
155+ struct Integrate {
163156 /// Print debug info
164157 #[ clap( short = 'd' ) ]
165158 pub debug : bool ,
@@ -202,7 +195,7 @@ struct Run {
202195}
203196
204197#[ derive( Clap ) ]
205- struct Deploy {
198+ struct Publish {
206199 /// Print debug info
207200 #[ clap( short = 'd' ) ]
208201 pub debug : bool ,
@@ -237,14 +230,14 @@ pub fn main() {
237230 current_dir. to_str ( ) . unwrap ( ) . to_owned ( )
238231 } ;
239232
240- let changes = generators :: get_changes_for_new_project ( current_path, project_opts. name ) ;
233+ let changes = generate :: get_changes_for_new_project ( current_path, project_opts. name ) ;
241234 execute_changes ( changes) ;
242235 }
243236 Command :: Contract ( subcommand) => match subcommand {
244237 Contract :: NewContract ( new_contract) => {
245238 let manifest_path = get_manifest_path_or_exit ( new_contract. manifest_path ) ;
246239
247- let changes = generators :: get_changes_for_new_contract (
240+ let changes = generate :: get_changes_for_new_contract (
248241 manifest_path,
249242 new_contract. name ,
250243 None ,
@@ -299,7 +292,7 @@ pub fn main() {
299292 let contract_name = components. last ( ) . unwrap ( ) ;
300293
301294 if & contract_id == & fork_contract. contract_id {
302- let mut change_set = generators :: get_changes_for_new_contract (
295+ let mut change_set = generate :: get_changes_for_new_contract (
303296 manifest_path. clone ( ) ,
304297 contract_name. to_string ( ) ,
305298 Some ( code) ,
@@ -309,7 +302,7 @@ pub fn main() {
309302 changes. append ( & mut change_set) ;
310303
311304 for dep in deps. iter ( ) {
312- let mut change_set = generators :: get_changes_for_new_link (
305+ let mut change_set = generate :: get_changes_for_new_link (
313306 manifest_path. clone ( ) ,
314307 dep. clone ( ) ,
315308 None ,
@@ -321,7 +314,7 @@ pub fn main() {
321314 execute_changes ( changes) ;
322315 }
323316 } ,
324- Command :: Console ( cmd) => {
317+ Command :: Poke ( cmd) => {
325318 let manifest_path = get_manifest_path_or_exit ( cmd. manifest_path ) ;
326319 let start_repl = true ;
327320 load_session ( manifest_path, start_repl, "development" . into ( ) )
@@ -362,14 +355,16 @@ pub fn main() {
362355 manifest_path,
363356 ) ;
364357 }
365- Command :: Deploy ( deploy) => {
358+ Command :: Publish ( deploy) => {
366359 let manifest_path = get_manifest_path_or_exit ( deploy. manifest_path ) ;
367360 let start_repl = false ;
368361 let mode = if deploy. mocknet == true {
369362 "mocknet"
370363 } else if deploy. testnet == true {
371364 "testnet"
372365 } else {
366+ // TODO(ludo): before supporting mainnet deployments, we want to add a pass
367+ // making sure that addresses are consistent.
373368 panic ! ( "Target deployment must be specified with --mocknet or --testnet" )
374369 } ;
375370 let res = load_session ( manifest_path, start_repl, mode. into ( ) ) ;
@@ -517,16 +512,14 @@ pub fn main() {
517512 // Sign the transaction
518513 // Send the transaction
519514 }
520- Command :: Devnet ( cmd) => match cmd {
521- Devnet :: Start ( sub_cmd) => {
522- let manifest_path = get_manifest_path_or_exit ( sub_cmd. manifest_path ) ;
523- println ! (
524- "Start orchestrating stacks-node, stacks-blockchain-api, bitcoind, bitcoin explorer, stacks-explorer"
525- ) ;
526- let mut devnet = DevnetOrchestrator :: new ( manifest_path) ;
527- let devnet_event_tx = devnet. event_tx . clone ( ) ;
528- devnet:: run_devnet ( & mut devnet) ;
529- }
515+ Command :: Integrate ( cmd) => {
516+ let manifest_path = get_manifest_path_or_exit ( cmd. manifest_path ) ;
517+ println ! (
518+ "Start orchestrating stacks-node, stacks-blockchain-api, bitcoind, bitcoin explorer, stacks-explorer"
519+ ) ;
520+ let mut devnet = DevnetOrchestrator :: new ( manifest_path) ;
521+ let devnet_event_tx = devnet. event_tx . clone ( ) ;
522+ integrate:: run_devnet ( & mut devnet) ;
530523 }
531524 } ;
532525}
0 commit comments