Skip to content

Commit

Permalink
Blockchain Storage Path (#315)
Browse files Browse the repository at this point in the history
* 283

* Update FileSystemExtensions.cs

Co-authored-by: Christopher Schuchardt <[email protected]>

* Update src/neoxp/Extensions/FileSystemExtensions.cs

Co-authored-by: Christopher Schuchardt <[email protected]>

---------

Co-authored-by: Jimmy <[email protected]>
Co-authored-by: Christopher Schuchardt <[email protected]>
  • Loading branch information
3 people authored Nov 15, 2023
1 parent 8f1bbea commit 33e2c1d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/neoxp/Extensions/FileSystemExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,16 @@ public static string GetNodePath(this IFileSystem fileSystem, ExpressConsensusNo

var account = node.Wallet.Accounts.Single(a => a.IsDefault);

var rootPath = fileSystem.Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.DoNotVerify),
"Neo-Express",
"blockchain-nodes");
return fileSystem.Path.Combine(rootPath, account.ScriptHash);
var homeDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile, Environment.SpecialFolderOption.DoNotVerify);
var expressBlockchainDir = fileSystem.Path.Combine(homeDir, ".neo-express", "blockchain-nodes", account.ScriptHash);

var appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.DoNotVerify);
var expressOldBlockchainDir = fileSystem.Path.Combine(appData, "Neo-Express", "blockchain-nodes", account.ScriptHash);

if (fileSystem.Directory.Exists(expressOldBlockchainDir))
return expressOldBlockchainDir;

return expressBlockchainDir;
}

public static async Task<(NefFile nefFile, ContractManifest manifest)> LoadContractAsync(this IFileSystem fileSystem, string contractPath)
Expand Down

0 comments on commit 33e2c1d

Please sign in to comment.