Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
0b52f194
Commit
0b52f194
authored
5 years ago
by
Arkadiy Paronyan
Committed by
Bastian Köcher
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed node binary (#4244)
* Fixed node binary * Remove extra params
parent
e8a655bb
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
substrate/bin/node/cli/src/cli.rs
+7
-18
7 additions, 18 deletions
substrate/bin/node/cli/src/cli.rs
substrate/client/cli/src/lib.rs
+10
-8
10 additions, 8 deletions
substrate/client/cli/src/lib.rs
substrate/client/cli/src/params.rs
+16
-0
16 additions, 0 deletions
substrate/client/cli/src/params.rs
with
33 additions
and
26 deletions
substrate/bin/node/cli/src/cli.rs
+
7
−
18
View file @
0b52f194
...
...
@@ -14,10 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
pub
use
substrate_cli
::
er
ror
;
pub
use
substrate_cli
::
V
er
sionInfo
;
use
tokio
::
prelude
::
Future
;
use
tokio
::
runtime
::{
Builder
as
RuntimeBuilder
,
Runtime
};
pub
use
substrate_cli
::{
VersionInfo
,
IntoExit
,
NoCustom
,
SharedParams
,
ExecutionStrategyParam
};
use
substrate_cli
::{
IntoExit
,
NoCustom
,
SharedParams
,
ImportParams
,
error
};
use
substrate_service
::{
AbstractService
,
Roles
as
ServiceRoles
,
Configuration
};
use
log
::
info
;
use
structopt
::{
StructOpt
,
clap
::
App
};
...
...
@@ -25,7 +25,6 @@ use substrate_cli::{display_role, parse_and_prepare, AugmentClap, GetLogFilter,
use
crate
::{
service
,
ChainSpec
,
load_spec
};
use
crate
::
factory_impl
::
FactoryState
;
use
transaction_factory
::
RuntimeAdapter
;
use
client
::
ExecutionStrategies
;
/// Custom subcommands.
#[derive(Clone,
Debug,
StructOpt)]
...
...
@@ -82,15 +81,9 @@ pub struct FactoryCmd {
#[structopt(flatten)]
pub
shared_params
:
SharedParams
,
/// The means of execution used when calling into the runtime while importing blocks.
#[structopt(
long
=
"execution"
,
value_name
=
"STRATEGY"
,
possible_values
=
&
ExecutionStrategyParam::variants(),
case_insensitive
=
true
,
default_value
=
"NativeElseWasm"
)]
pub
execution
:
ExecutionStrategyParam
,
#[allow(missing_docs)]
#[structopt(flatten)]
pub
import_params
:
ImportParams
,
}
impl
AugmentClap
for
FactoryCmd
{
...
...
@@ -147,12 +140,8 @@ pub fn run<I, T, E>(args: I, exit: E, version: substrate_cli::VersionInfo) -> er
&
cli_args
.shared_params
,
&
version
,
)
?
;
config
.execution_strategies
=
ExecutionStrategies
{
importing
:
cli_args
.execution
.into
(),
block_construction
:
cli_args
.execution
.into
(),
other
:
cli_args
.execution
.into
(),
..
Default
::
default
()
};
substrate_cli
::
fill_import_params
(
&
mut
config
,
&
cli_args
.import_params
,
ServiceRoles
::
FULL
)
?
;
match
ChainSpec
::
from
(
config
.chain_spec
.id
())
{
Some
(
ref
c
)
if
c
==
&
ChainSpec
::
Development
||
c
==
&
ChainSpec
::
LocalTestnet
=>
{},
...
...
This diff is collapsed.
Click to expand it.
substrate/client/cli/src/lib.rs
+
10
−
8
View file @
0b52f194
...
...
@@ -56,7 +56,7 @@ use params::{
NetworkConfigurationParams
,
MergeParameters
,
TransactionPoolParams
,
NodeKeyParams
,
NodeKeyType
,
Cors
,
CheckBlockCmd
,
};
pub
use
params
::{
NoCustom
,
CoreParams
,
SharedParams
,
ExecutionStrategy
as
ExecutionStrategy
Param
};
pub
use
params
::{
NoCustom
,
CoreParams
,
SharedParams
,
ImportParams
,
ExecutionStrategy
};
pub
use
traits
::{
GetLogFilter
,
AugmentClap
};
use
app_dirs
::{
AppInfo
,
AppDataType
};
use
log
::
info
;
...
...
@@ -440,7 +440,8 @@ impl<'a> ParseAndPrepareImport<'a> {
E
:
ChainSpecExtension
,
Exit
:
IntoExit
{
let
config
=
create_config_with_db_path
(
spec_factory
,
&
self
.params.shared_params
,
self
.version
)
?
;
let
mut
config
=
create_config_with_db_path
(
spec_factory
,
&
self
.params.shared_params
,
self
.version
)
?
;
fill_import_params
(
&
mut
config
,
&
self
.params.import_params
,
service
::
Roles
::
FULL
)
?
;
let
file
:
Box
<
dyn
ReadPlusSeek
+
Send
>
=
match
self
.params.input
{
Some
(
filename
)
=>
Box
::
new
(
File
::
open
(
filename
)
?
),
...
...
@@ -499,7 +500,8 @@ impl<'a> CheckBlock<'a> {
E
:
ChainSpecExtension
,
Exit
:
IntoExit
{
let
config
=
create_config_with_db_path
(
spec_factory
,
&
self
.params.shared_params
,
self
.version
)
?
;
let
mut
config
=
create_config_with_db_path
(
spec_factory
,
&
self
.params.shared_params
,
self
.version
)
?
;
fill_import_params
(
&
mut
config
,
&
self
.params.import_params
,
service
::
Roles
::
FULL
)
?
;
let
input
=
if
self
.params.input
.starts_with
(
"0x"
)
{
&
self
.params.input
[
2
..
]
}
else
{
&
self
.params.input
[
..
]
};
let
block_id
=
match
FromStr
::
from_str
(
input
)
{
...
...
@@ -738,7 +740,8 @@ fn fill_config_keystore_password<C, G, E>(
Ok
(())
}
fn
fill_shared_config
<
C
,
G
,
E
>
(
config
:
&
mut
Configuration
<
C
,
G
,
E
>
,
cli
:
&
SharedParams
,
role
:
service
::
Roles
)
/// Put block import CLI params into `config` object.
pub
fn
fill_import_params
<
C
,
G
,
E
>
(
config
:
&
mut
Configuration
<
C
,
G
,
E
>
,
cli
:
&
ImportParams
,
role
:
service
::
Roles
)
->
error
::
Result
<
()
>
where
C
:
Default
,
...
...
@@ -776,7 +779,7 @@ where
config
.wasm_method
=
cli
.wasm_method
.into
();
let
exec
=
&
cli
.execution_strategies
;
let
exec_all_or
=
|
strat
:
params
::
ExecutionStrategy
|
exec
.execution
.unwrap_or
(
strat
)
.into
();
let
exec_all_or
=
|
strat
:
ExecutionStrategy
|
exec
.execution
.unwrap_or
(
strat
)
.into
();
config
.execution_strategies
=
ExecutionStrategies
{
syncing
:
exec_all_or
(
exec
.execution_syncing
),
importing
:
exec_all_or
(
exec
.execution_import_block
),
...
...
@@ -813,7 +816,7 @@ where
service
::
Roles
::
FULL
};
fill_
shared_config
(
&
mut
config
,
&
cli
.
shared
_params
,
role
)
?
;
fill_
import_params
(
&
mut
config
,
&
cli
.
import
_params
,
role
)
?
;
config
.impl_name
=
impl_name
;
config
.impl_commit
=
version
.commit
;
...
...
@@ -924,8 +927,7 @@ where
let
spec
=
load_spec
(
cli
,
spec_factory
)
?
;
let
base_path
=
base_path
(
cli
,
version
);
let
mut
config
=
service
::
Configuration
::
default_with_spec_and_base_path
(
spec
.clone
(),
Some
(
base_path
));
fill_shared_config
(
&
mut
config
,
&
cli
,
service
::
Roles
::
FULL
)
?
;
let
config
=
service
::
Configuration
::
default_with_spec_and_base_path
(
spec
.clone
(),
Some
(
base_path
));
Ok
(
config
)
}
...
...
This diff is collapsed.
Click to expand it.
substrate/client/cli/src/params.rs
+
16
−
0
View file @
0b52f194
...
...
@@ -109,7 +109,11 @@ pub struct SharedParams {
/// Sets a custom logging filter.
#[structopt(short
=
"l"
,
long
=
"log"
,
value_name
=
"LOG_PATTERN"
)]
pub
log
:
Option
<
String
>
,
}
/// Parameters for block import.
#[derive(Debug,
StructOpt,
Clone)]
pub
struct
ImportParams
{
/// Specify the state pruning mode, a number of blocks to keep or 'archive'.
///
/// Default is to keep all block states if the node is running as a
...
...
@@ -505,6 +509,10 @@ pub struct RunCmd {
#[structopt(flatten)]
pub
shared_params
:
SharedParams
,
#[allow(missing_docs)]
#[structopt(flatten)]
pub
import_params
:
ImportParams
,
#[allow(missing_docs)]
#[structopt(flatten)]
pub
network_config
:
NetworkConfigurationParams
,
...
...
@@ -764,6 +772,10 @@ pub struct ImportBlocksCmd {
#[allow(missing_docs)]
#[structopt(flatten)]
pub
shared_params
:
SharedParams
,
#[allow(missing_docs)]
#[structopt(flatten)]
pub
import_params
:
ImportParams
,
}
impl_get_log_filter!
(
ImportBlocksCmd
);
...
...
@@ -784,6 +796,10 @@ pub struct CheckBlockCmd {
#[allow(missing_docs)]
#[structopt(flatten)]
pub
shared_params
:
SharedParams
,
#[allow(missing_docs)]
#[structopt(flatten)]
pub
import_params
:
ImportParams
,
}
impl_get_log_filter!
(
CheckBlockCmd
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment