Conversation
|
Wait for neo-project/neo#2212 |
vncoelho
left a comment
There was a problem hiding this comment.
Looks good, I will test tomorrow.
|
Wait for neo-project/neo#2213 |
|
Wait for #454 |
|
how to use it to start consensus? |
Plugin.GetService<IConsensusProvider>()?.Start(wallet);Use this code in cli. |
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neo.Plugins.StateService.Tests", "tests\Neo.Plugins.StateService.Tests\Neo.Plugins.StateService.Tests.csproj", "{149822EC-4E0C-425F-A032-4196B615BFEB}" | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Neo.Plugins.StateService.Tests", "tests\Neo.Plugins.StateService.Tests\Neo.Plugins.StateService.Tests.csproj", "{149822EC-4E0C-425F-A032-4196B615BFEB}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dBFT", "src\dBFT\dBFT.csproj", "{90185D3E-4813-4BC1-98FE-26FD34311403}" |
There was a problem hiding this comment.
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dBFT", "src\dBFT\dBFT.csproj", "{90185D3E-4813-4BC1-98FE-26FD34311403}" | |
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dBFT2.0", "src\dBFT\dBFT.csproj", "{90185D3E-4813-4BC1-98FE-26FD34311403}" |
?
There was a problem hiding this comment.
The project name shouldn't include version number.
src/dBFT/dBFT/config.json
Outdated
| { | ||
| "PluginConfiguration": { | ||
| "RecoveryLogs": "ConsensusState", | ||
| "IgnoreRecoveryLogs": false |
There was a problem hiding this comment.
But how do you pass the wallet?
There was a problem hiding this comment.
An encapsulated wallet such as RPCServer DummyWallet?
There was a problem hiding this comment.
But perhaps we will need to pass the path and password duplicated here...
There was a problem hiding this comment.
We can register the wallet as a service. But maybe we should do it in another pr.
There was a problem hiding this comment.
will we control the start consensus in the plugin config instead of neo-cli config?
There was a problem hiding this comment.
I think so, @cloud8little, control it on neo-cli config will be a little bit confusing in my opinion.
It looks like we need to do this extra effort here to create the wallet as a service as Erik mentioned.
There was a problem hiding this comment.
@erikzhang,
another way to do could be to create a function here (called GetStartConsensus()) that return true or false (getting there value from the dBFT config file here..
On the neo-node we check if this plugin exist and call this function.
If true calls
cs IConsensusProvider consensus = Plugin.Plugins.OfType<IConsensusProvider>().FirstOrDefault(); consensus?.Start(wallet);
|
|
I tried without success here as well,@ProDog....aheuahea |
|
IConsensusProvider consensus = Plugin.Plugins.OfType<IConsensusProvider>().FirstOrDefault();
consensus?.Start(wallet);Use this code. |
|
Test: PASS So, we'll create the start consensus command in another PR, right? |
|
Ready to review. |
| { | ||
| walletProvider = GetService<IWalletProvider>(); | ||
| if (Settings.Default.AutoStart) | ||
| walletProvider.WalletOpened += WalletProvider_WalletOpened; |
There was a problem hiding this comment.
What is this syntax?
WalletProvider_WalletOpened is a function?
| "RecoveryLogs": "ConsensusState", | ||
| "IgnoreRecoveryLogs": false | ||
| "IgnoreRecoveryLogs": false, | ||
| "AutoStart": false |
There was a problem hiding this comment.
Why not True as default? Who use the plugin usually will want it true.
| walletProvider.WalletOpened += WalletProvider_WalletOpened; | ||
| } | ||
|
|
||
| private void WalletProvider_WalletOpened(object sender, Wallet wallet) |
There was a problem hiding this comment.
What will be the message is wallet closed?
There was a problem hiding this comment.
It will pass the wallet with null value.
|
Give me one day more for review |
This comment has been minimized.
This comment has been minimized.
|
Works well on mine. |
|
Works well on mine. Wait for @shargon 's review. |






No description provided.