Open leexusheng opened 1 month ago
It is not officially supported; as you can see, the rocksdb
dependency may not work on that architecture.
You may try building with the Cargo.toml
file modified to not use the rocks
feature from snarkvm
, but that will mean that your storage will be in-memory only.
thanks to your reply, but if i try to delete the feature "rocks" in the Cargo.toml file
node/bft/storage-service/src/persistent.rs:22:17 rocksdb::{
| ^^^^^^^ could not find rocksdb
in helpers
how can i do .thx
It seems that the node is currently hardcoded to use the persistent storage for both client and validator nodes; however, you could try introducing the following changes to go memory-only:
diff --git a/Cargo.toml b/Cargo.toml
index 6898e5400..183ae2b87 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -48,7 +48,7 @@ default-features = false
git = "https://github.com/AleoNet/snarkVM.git"
rev = "d170a9f" # If this is updated, the rev in `node/rest/Cargo.toml` must be updated as well.
#version = "=0.16.18"
-features = [ "circuit", "console", "rocks" ]
+features = [ "circuit", "console" ]
[[bin]]
name = "snarkos"
diff --git a/node/consensus/Cargo.toml b/node/consensus/Cargo.toml
index 81fdcd867..f5baa6af0 100644
--- a/node/consensus/Cargo.toml
+++ b/node/consensus/Cargo.toml
@@ -66,7 +66,7 @@ features = [ "ledger", "ledger-write" ]
path = "../bft/storage-service"
version = "=2.2.7"
default-features = false
-features = [ "persistent" ]
+features = [ "memory" ]
[dependencies.snarkvm]
workspace = true
diff --git a/node/consensus/src/lib.rs b/node/consensus/src/lib.rs
index fdf247dfd..43c0778ee 100644
--- a/node/consensus/src/lib.rs
+++ b/node/consensus/src/lib.rs
@@ -32,7 +32,7 @@ use snarkos_node_bft::{
BFT,
};
use snarkos_node_bft_ledger_service::LedgerService;
-use snarkos_node_bft_storage_service::BFTPersistentStorage;
+use snarkos_node_bft_storage_service::BFTMemoryService;
use snarkvm::{
ledger::{
block::Transaction,
@@ -122,7 +122,7 @@ impl<N: Network> Consensus<N> {
StorageMode::Production | StorageMode::Custom(..) => None,
};
// Initialize the Narwhal transmissions.
- let transmissions = Arc::new(BFTPersistentStorage::open(storage_mode)?);
+ let transmissions = Arc::new(BFTMemoryService::new());
// Initialize the Narwhal storage.
let storage = NarwhalStorage::new(ledger.clone(), transmissions, BatchHeader::<N>::MAX_GC_ROUNDS as u64);
// Initialize the BFT.
diff --git a/node/src/node.rs b/node/src/node.rs
index f5fe6d2fa..a3b481643 100644
--- a/node/src/node.rs
+++ b/node/src/node.rs
@@ -17,7 +17,7 @@ use snarkos_account::Account;
use snarkos_node_router::messages::NodeType;
use snarkvm::prelude::{
block::Block,
- store::helpers::{memory::ConsensusMemory, rocksdb::ConsensusDB},
+ store::helpers::memory::ConsensusMemory,
Address,
Network,
PrivateKey,
@@ -33,11 +33,11 @@ use std::{
pub enum Node<N: Network> {
/// A validator is a full node, capable of validating blocks.
- Validator(Arc<Validator<N, ConsensusDB<N>>>),
+ Validator(Arc<Validator<N, ConsensusMemory<N>>>),
/// A prover is a light node, capable of producing proofs for consensus.
Prover(Arc<Prover<N, ConsensusMemory<N>>>),
/// A client node is a full node, capable of querying with the network.
- Client(Arc<Client<N, ConsensusDB<N>>>),
+ Client(Arc<Client<N, ConsensusMemory<N>>>),
}
impl<N: Network> Node<N> {
(you can hand-pick these changes or save this snippet and git apply
it)
Thank you for your reply, I tried to modify the code with the method you provided, but it still can't be installed on riscv, cloud you tell me whichmalloc (jemalloc or glibc or tcmalloc) is needed for this program on RISC v. I've tried export LD_PRELOAD= RISC v version of these libraries, but I still get the error,Thanks again!!!!
You may use any allocator that RISC-V supports. The OS allocator should be used by default; I'm not sure why it wouldn't work, but you're free to use a different one that does.
🐛 Bug Report
rustc 1.76.0 (07dca489a 2024-02-04)
when i build aleo on riscv64