Skip to content

Instantly share code, notes, and snippets.

View DylanVerstraete's full-sized avatar

Dylan Verstraete DylanVerstraete

  • Ghent, Belgium
View GitHub Profile
use crate::Client;
use alloy::{providers::Provider, rpc::types::eth::Block};
use anyhow::Result;
use async_trait::async_trait;
use futures_util::StreamExt;
use tokio::sync::mpsc;
use tokio::task::JoinHandle;
use tracing::{debug, info};
use crate::Error;
use alloy::consensus::Signed;
use alloy::consensus::{TxEip1559, TxEip2930, TxLegacy};
use alloy::core::primitives::{Address, U256};
use alloy::rpc::types::eth::Transaction;
pub trait BlockItem: Sized {
fn to_bytes(&self) -> Vec<u8>;
fn chain_id(&self) -> u64;
fn block_number(&self) -> U256;
const { ApiPromise, WsProvider } = require('@polkadot/api')
async function main () {
const provider = new WsProvider('wss://rpc.cc3-testnet.creditcoin.network/ws')
const api = await ApiPromise.create({ provider })
const entries = await api.query.staking.validators.entries();
const validators = entries.map(([key, v]) => {
return key.args.map((k) => k.toHuman());
➜ cli git:(feat_cli_check_min_bond) ✗ PROXY_ENABLED=yes PROXY_SECRET_VARIANT=no-funds jest -i src/test/integration-tests/validate.test.ts -t 'should error with not enough bonded' --force-exit --verbose --detectOpenHandles
console.log
Sending transaction...
at src/lib/tx.ts:14:17
console.log
Sending transaction...
at src/lib/tx.ts:14:17
2024-03-20 14:51:07 [304767] 💸 new validator set of size 10 has been processed for era 57
DigestItem: given=DigestItem::Consensus([102, 114, 111, 110], [1, 26, 10, 1, 243, 219, 107, 186, 90, 57, 158, 70, 49, 0, 147, 90, 214, 162, 147, 55, 9, 132, 120, 168, 37, 117, 104, 16, 215, 60, 16, 249, 156, 0]), expected=DigestItem::Consensus([102, 114, 111, 110], [1, 71, 52, 48, 215, 234, 111, 133, 35, 72, 207, 3, 221, 240, 81, 103, 90, 78, 252, 96, 126, 212, 217, 160, 148, 33, 70, 148, 142, 112, 61, 139, 66, 0])
2024-03-20 14:51:09 ⚠️ Ethereum declares internal migrations (which *might* execute). On-chain `StorageVersion(0)` vs current storage version `NoStorageVersionSet`
====================
Version: 3.22.0-6af1c862b64
0: sp_panic_handler::set::{{closure}}
1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
➜ creditcoin3 git:(dev) ✗ ./target/debug/creditcoin3-node --dev -d /tmp/a1
2024-03-19 13:24:41 Frontier Node
2024-03-19 13:24:41 ✌️ version 3.21.0-a7fee5b189b
2024-03-19 13:24:41 ❤️ by Gluwa Inc.:Nathan Whitaker <nathan.whitaker@gluwa.com>, 2021-2024
2024-03-19 13:24:41 📋 Chain specification: Development
2024-03-19 13:24:41 🏷 Node name: snotty-dust-7840
2024-03-19 13:24:41 👤 Role: AUTHORITY
2024-03-19 13:24:41 💾 Database: RocksDb at /tmp/a1/chains/dev/db/full
EVM accounts: {0x1000000000000000000000000000000000000001: GenesisAccount { nonce: 1, balance: 1000000000000000000000000, storage: {}, code: [0] }, 0x3cd0a705a2dc65e5b1e1205896baa2be8a07c6e0: GenesisAccount { nonce: 0, balance: 1000000000000000000000000, storage: {}, code: [] }, 0x773539d4ac0e786233d90a233654ccee26a613d9: GenesisAccount { nonce: 0, balance: 1000000000000000000000000, storage: {}, code: [] }, 0x798d4ba9baf0064ec19eb4f0a1a45785ae9d6dfc: GenesisAccount { nonce: 0, balance: 1000000000000000000000000, storage: {}, code: [] }, 0xc0f0f4ab32
for role in roles {
let postgres_pool = postgres_pool.clone();
let new_role_id = controllers::roles::create(
postgres_pool.clone(),
ModifiableRole {
name: role.name.clone(),
},
new_project_id,
)
2023-12-30 16:34:56.311574 [INFO ] Processor is running
2023-12-30 16:34:56.311595 [INFO ] Farmerbot up and running (version: 0.2.1)
2023-12-30 16:34:56.311600 [INFO ] [POWERMANAGER] Startup proces: powering on all nodes that are down.
2023-12-30 16:34:56.311964 [DEBUG] Received job with guid bfa9ff4d-24d4-48aa-8736-3fc7fe900c9a
2023-12-30 16:34:56.312312 [DEBUG] Assigned job bfa9ff4d-24d4-48aa-8736-3fc7fe900c9a to jobs.actors.farmerbot.powermanager:
2023-12-30 16:34:56.312412 [DEBUG] jobs.ActionJob{
guid: 'bfa9ff4d-24d4-48aa-8736-3fc7fe900c9a'
twinid: 0
action: 'farmerbot.powermanager.poweron'
args: params.Params{
use anyhow::{Error, Result};
use diesel::{prelude::*, result::Error as DieselError, serialize::ToSql};
use diesel_async::{AsyncPgConnection, RunQueryDsl};
use serde::{Deserialize, Serialize};
use crate::schema::{
role_permission as RolePermissionSchema,
role_permission::dsl::role_permission as role_permissions,
};
use anyhow::Result;
use log::debug;
use reed_solomon_erasure::galois_8::ReedSolomon;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum CoderError {
#[error("invalid configuration of data and parity shards: {0} {1}")]
InvalidConfiguration(usize, usize),
#[error("failed to encode data")]