tidy up README, startup info, typos
This commit is contained in:
Generated
+5
-3
@@ -2271,7 +2271,7 @@ dependencies = [
|
||||
"libc",
|
||||
"option-ext",
|
||||
"redox_users",
|
||||
"windows-sys 0.60.2",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2970,9 +2970,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "glob"
|
||||
version = "0.3.2"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
|
||||
checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
|
||||
|
||||
[[package]]
|
||||
name = "gloo-net"
|
||||
@@ -5747,6 +5747,7 @@ dependencies = [
|
||||
"chrono",
|
||||
"clap",
|
||||
"cosmrs 0.22.0",
|
||||
"glob",
|
||||
"nym-bin-common",
|
||||
"nym-config",
|
||||
"nym-network-defaults",
|
||||
@@ -5766,6 +5767,7 @@ dependencies = [
|
||||
"tower-http",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"url",
|
||||
"utoipa",
|
||||
"utoipa-swagger-ui",
|
||||
"utoipauto",
|
||||
|
||||
@@ -156,7 +156,7 @@ impl PostgresStorageTransaction {
|
||||
let messages = chain_tx
|
||||
.parsed_messages
|
||||
.values()
|
||||
.map(|v| v.clone())
|
||||
.cloned()
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let signer_infos = chain_tx
|
||||
|
||||
@@ -9,19 +9,21 @@ pub(crate) struct Group;
|
||||
|
||||
impl CosmosModule for Group {
|
||||
fn register_messages(&self, _registry: &mut MessageRegistry) {
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgCreateGroup'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgUpdateGroupMembers'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgUpdateGroupAdmin'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgUpdateGroupMetadata'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgCreateGroupWithPolicy'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgCreateGroupPolicy'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgUpdateGroupPolicyAdmin'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgUpdateGroupPolicyDecisionPolicy'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgUpdateGroupPolicyMetadata'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgSubmitProposal'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgWithdrawProposal'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgVote'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgExec'");
|
||||
warn!("mising cosmos-sdk-proto definition for 'group::MsgLeaveGroup'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgCreateGroup'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgUpdateGroupMembers'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgUpdateGroupAdmin'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgUpdateGroupMetadata'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgCreateGroupWithPolicy'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgCreateGroupPolicy'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgUpdateGroupPolicyAdmin'");
|
||||
warn!(
|
||||
"missing cosmos-sdk-proto definition for 'group::MsgUpdateGroupPolicyDecisionPolicy'"
|
||||
);
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgUpdateGroupPolicyMetadata'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgSubmitProposal'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgWithdrawProposal'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgVote'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgExec'");
|
||||
warn!("missing cosmos-sdk-proto definition for 'group::MsgLeaveGroup'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,16 +61,22 @@ GRANT ALL ON DATABASE nym_data_observatory_data TO nym_data_observatory;
|
||||
Then run:
|
||||
|
||||
```
|
||||
cargo run -- init --db_url postgres://nym_data_observatory:data-data-data@localhost/nym_data_observatory_data
|
||||
cargo run -- init --db_url postgres://testuser:testpass@localhost:5433/nym_data_observatory_test
|
||||
```
|
||||
|
||||
and then:
|
||||
|
||||
```
|
||||
NYM_DATA_OBSERVATORY_DB_URL=postgres://nym_data_observatory:data-data-data@localhost/nym_data_observatory_data \
|
||||
NYM_DATA_OBSERVATORY_DB_URL=postgres://testuser:testpass@localhost:5433/nym_data_observatory_test \
|
||||
NYM_DATA_OBSERVATORY_WEBHOOK_URL="https://webhook.site" \
|
||||
NYM_DATA_OBSERVATORY_WEBHOOK_AUTH=1234 \
|
||||
cargo run -- run
|
||||
cargo run -- run --websocket-url wss://rpc.nymtech.net/websocket --rpc-url https://rpc.nymtech.net
|
||||
```
|
||||
|
||||
or just:
|
||||
|
||||
```
|
||||
NYM_DATA_OBSERVATORY_DB_URL=postgres://testuser:testpass@localhost:5433/nym_data_observatory_test cargo run -- run --websocket-url wss://rpc.nymtech.net/websocket --rpc-url https://rpc.nymtech.net
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@@ -6,10 +6,8 @@ use crate::error::NymDataObservatoryError;
|
||||
use tracing::{info, warn};
|
||||
|
||||
pub(crate) fn get_run_config(args: Args) -> Result<Config, NymDataObservatoryError> {
|
||||
info!("{args:#?}");
|
||||
|
||||
let Args {
|
||||
mut watch_for_chain_message_types,
|
||||
watch_for_chain_message_types,
|
||||
webhook_auth,
|
||||
webhook_url,
|
||||
..
|
||||
@@ -21,11 +19,6 @@ pub(crate) fn get_run_config(args: Args) -> Result<Config, NymDataObservatoryErr
|
||||
return Config::read_from_toml_file_in_default_location();
|
||||
}
|
||||
|
||||
// set default messages
|
||||
if watch_for_chain_message_types.is_empty() {
|
||||
watch_for_chain_message_types = vec!["/cosmos.bank.v1beta1.MsgSend".to_string()];
|
||||
}
|
||||
|
||||
let config_path = default_config_filepath();
|
||||
let data_dir = Config::default_data_directory(&config_path)?;
|
||||
|
||||
|
||||
@@ -104,17 +104,26 @@ async fn wait_for_shutdown(
|
||||
pub(crate) async fn execute(args: Args, http_port: u16) -> Result<(), NymDataObservatoryError> {
|
||||
let start = OffsetDateTime::now_utc();
|
||||
|
||||
info!("passed arguments: {args:#?}");
|
||||
|
||||
let config = config::get_run_config(args)?;
|
||||
let config = config::get_run_config(args.clone())?;
|
||||
|
||||
let db_connection_string = config.chain_scraper_connection_string();
|
||||
|
||||
info!("Config is {config:#?}");
|
||||
info!("nyxd wss: {}", args.websocket_url.to_string());
|
||||
info!("nyxd rpc: {}", args.rpc_url.to_string());
|
||||
info!("start_block_height: {:#?}", args.start_block_height);
|
||||
info!(
|
||||
"Chain History Database path is {:?}",
|
||||
std::path::Path::new(&config.chain_scraper_connection_string()).canonicalize()
|
||||
"webhooks: {}",
|
||||
config.data_observatory_config.webhooks.len()
|
||||
);
|
||||
for w in &config.data_observatory_config.webhooks {
|
||||
info!(
|
||||
"- {}: {} {:?}",
|
||||
&w.id,
|
||||
w.webhook_url.as_str(),
|
||||
w.watch_for_chain_message_types
|
||||
);
|
||||
}
|
||||
info!("nuke_db: {}", args.nuke_db);
|
||||
|
||||
let storage = db::Storage::init(db_connection_string).await?;
|
||||
let watcher_pool = storage.pool_owned();
|
||||
@@ -135,7 +144,7 @@ pub(crate) async fn execute(args: Args, http_port: u16) -> Result<(), NymDataObs
|
||||
let config = config.clone();
|
||||
async move {
|
||||
// this only blocks until startup sync is done; it then runs on its own set of tasks
|
||||
let scraper = run_chain_scraper(&config, scraper_pool).await?;
|
||||
let scraper = run_chain_scraper(args, &config, scraper_pool).await?;
|
||||
Ok(scraper.cancel_token())
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::FromRow;
|
||||
use time::OffsetDateTime;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize, Debug, ToSchema)]
|
||||
@@ -33,26 +31,3 @@ pub(crate) struct PriceHistory {
|
||||
pub(crate) gbp: f64,
|
||||
pub(crate) btc: f64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, ToSchema)]
|
||||
pub(crate) struct PaymentRecord {
|
||||
pub(crate) transaction_hash: String,
|
||||
pub(crate) sender_address: String,
|
||||
pub(crate) receiver_address: String,
|
||||
pub(crate) amount: f64,
|
||||
pub(crate) timestamp: i64,
|
||||
pub(crate) height: i64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, FromRow)]
|
||||
pub(crate) struct Transaction {
|
||||
pub(crate) id: i64,
|
||||
pub(crate) tx_hash: String,
|
||||
pub(crate) height: i64,
|
||||
pub(crate) message_index: i64,
|
||||
pub(crate) sender: String,
|
||||
pub(crate) recipient: String,
|
||||
pub(crate) amount: String,
|
||||
pub(crate) memo: Option<String>,
|
||||
pub(crate) created_at: Option<OffsetDateTime>,
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ use nyxd_scraper_psql::models::DbCoin;
|
||||
use serde_json::Value;
|
||||
use time::PrimitiveDateTime;
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn insert_wasm_execute(
|
||||
pool: &DbPool,
|
||||
sender: String,
|
||||
|
||||
Reference in New Issue
Block a user