fix: remove some sepolia detritus

This commit is contained in:
dr-frmr 2024-04-17 00:08:36 +09:00
parent 8a929641b4
commit 4b7a4dc0a1
No known key found for this signature in database
3 changed files with 12 additions and 28 deletions

View File

@ -49,14 +49,14 @@ Make sure not to use the same home directory for two nodes at once! You can use
TODO: document feature flags in `--simulation-mode` TODO: document feature flags in `--simulation-mode`
```bash ```bash
# OPTIONAL: --release flag # OPTIONAL: --release flag
cargo +nightly run -p kinode -- home --testnet cargo +nightly run -p kinode -- home
``` ```
On boot you will be prompted to navigate to `localhost:8080`. Make sure your browser wallet matches the network that the node is being booted on. Follow the registration UI -- if you want to register a new ID you will either need [Sepolia testnet tokens](https://www.infura.io/faucet/sepolia) or an invite code. On boot you will be prompted to navigate to `localhost:8080`. Make sure your browser wallet matches the network that the node is being booted on. Follow the registration UI -- if you want to register a new ID you will either need Optimism ETH or an invite code.
## Configuring the ETH RPC Provider ## Configuring the ETH RPC Provider
By default, a node will use the hardcoded providers for the network ([testnet](./kinode/default_providers_testnet.json)/[mainnet](./kinode/default_providers_mainnet.json)) it is booted on. A node can use a WebSockets RPC URL directly, or use another Kinode as a relay point. To adjust the providers a node uses, just create and modify the `.eth_providers` file in the node's home folder (set at boot). See the Kinode Book for more docs, and see the [default providers file here](./kinode/default_providers_testnet.json) for a template to create `.eth_providers`. By default, a node will use the [hardcoded providers](./kinode/default_providers_mainnet.json) for the network it is booted on. A node can use a WebSockets RPC URL directly, or use another Kinode as a relay point. To adjust the providers a node uses, just create and modify the `.eth_providers` file in the node's home folder (set at boot). See the Kinode Book for more docs, and see the [default providers file here](./kinode/default_providers_mainnet.json) for a template to create `.eth_providers`.
You may also add a RPC provider or otherwise modify your configuration by sending messages from the terminal to the `eth:distro:sys` process. Use this message format to add a provider -- this will make your node's performance better when accessing a blockchain: You may also add a RPC provider or otherwise modify your configuration by sending messages from the terminal to the `eth:distro:sys` process. Use this message format to add a provider -- this will make your node's performance better when accessing a blockchain:
``` ```

View File

@ -45,7 +45,6 @@ async fn serve_register_fe(
our_ip: String, our_ip: String,
ws_networking: (tokio::net::TcpListener, bool), ws_networking: (tokio::net::TcpListener, bool),
http_server_port: u16, http_server_port: u16,
testnet: bool,
maybe_rpc: Option<String>, maybe_rpc: Option<String>,
) -> (Identity, Vec<u8>, Keyfile) { ) -> (Identity, Vec<u8>, Keyfile) {
// check if we have keys saved on disk, encrypted // check if we have keys saved on disk, encrypted
@ -74,7 +73,6 @@ async fn serve_register_fe(
ws_networking, ws_networking,
http_server_port, http_server_port,
disk_keyfile, disk_keyfile,
testnet,
maybe_rpc) => { maybe_rpc) => {
panic!("registration failed") panic!("registration failed")
} }
@ -304,7 +302,6 @@ async fn main() {
our_ip.to_string(), our_ip.to_string(),
(ws_tcp_handle, flag_used), (ws_tcp_handle, flag_used),
http_server_port, http_server_port,
fakenode, // true if fakenode
matches.get_one::<String>("rpc").cloned(), matches.get_one::<String>("rpc").cloned(),
) )
.await; .await;

View File

@ -31,10 +31,10 @@ use warp::{
type RegistrationSender = mpsc::Sender<(Identity, Keyfile, Vec<u8>)>; type RegistrationSender = mpsc::Sender<(Identity, Keyfile, Vec<u8>)>;
pub const KNS_SEPOLIA_ADDRESS: EthAddress = EthAddress::new([ // pub const KNS_SEPOLIA_ADDRESS: EthAddress = EthAddress::new([
0x38, 0x07, 0xFB, 0xD6, 0x92, 0xAa, 0x5c, 0x96, 0xF1, 0xD8, 0xD7, 0xc5, 0x9a, 0x13, 0x46, 0xa8, // 0x38, 0x07, 0xFB, 0xD6, 0x92, 0xAa, 0x5c, 0x96, 0xF1, 0xD8, 0xD7, 0xc5, 0x9a, 0x13, 0x46, 0xa8,
0x85, 0xF4, 0x0B, 0x1C, // 0x85, 0xF4, 0x0B, 0x1C,
]); // ]);
pub const KNS_OPTIMISM_ADDRESS: EthAddress = EthAddress::new([ pub const KNS_OPTIMISM_ADDRESS: EthAddress = EthAddress::new([
0xca, 0x5b, 0x58, 0x11, 0xc0, 0xC4, 0x0a, 0xAB, 0x32, 0x95, 0xf9, 0x32, 0xb1, 0xB5, 0x11, 0x2E, 0xca, 0x5b, 0x58, 0x11, 0xc0, 0xC4, 0x0a, 0xAB, 0x32, 0x95, 0xf9, 0x32, 0xb1, 0xB5, 0x11, 0x2E,
@ -120,7 +120,6 @@ pub async fn register(
ws_networking: (tokio::net::TcpListener, bool), ws_networking: (tokio::net::TcpListener, bool),
http_port: u16, http_port: u16,
keyfile: Option<Vec<u8>>, keyfile: Option<Vec<u8>>,
testnet: bool,
maybe_rpc: Option<String>, maybe_rpc: Option<String>,
) { ) {
// Networking info is generated and passed to the UI, but not used until confirmed // Networking info is generated and passed to the UI, but not used until confirmed
@ -147,17 +146,11 @@ pub async fn register(
}); });
// KnsRegistrar contract address // KnsRegistrar contract address
let kns_address = if testnet { let kns_address = KNS_OPTIMISM_ADDRESS;
KNS_SEPOLIA_ADDRESS
} else {
KNS_OPTIMISM_ADDRESS
};
// This ETH provider uses public rpc endpoints to verify registration signatures. // This ETH provider uses public rpc endpoints to verify registration signatures.
let url = if let Some(rpc_url) = maybe_rpc { let url = if let Some(rpc_url) = maybe_rpc {
rpc_url rpc_url
} else if testnet {
"wss://ethereum-sepolia-rpc.publicnode.com".to_string()
} else { } else {
"wss://optimism-rpc.publicnode.com".to_string() "wss://optimism-rpc.publicnode.com".to_string()
}; };
@ -203,13 +196,9 @@ pub async fn register(
.or(warp::path("set-password") .or(warp::path("set-password")
.and(warp::get()) .and(warp::get())
.map(move || warp::reply::html(include_str!("register-ui/build/index.html")))) .map(move || warp::reply::html(include_str!("register-ui/build/index.html"))))
.or(warp::path("current-chain").and(warp::get()).map(move || { .or(warp::path("current-chain")
if testnet { .and(warp::get())
warp::reply::json(&"0xaa36a7") .map(move || warp::reply::json(&"0xa")))
} else {
warp::reply::json(&"0xa")
}
}))
.or(warp::path("our").and(warp::get()).and(keyfile.clone()).map( .or(warp::path("our").and(warp::get()).and(keyfile.clone()).map(
move |keyfile: Option<Vec<u8>>| { move |keyfile: Option<Vec<u8>>| {
if let Some(keyfile) = keyfile { if let Some(keyfile) = keyfile {
@ -265,7 +254,6 @@ pub async fn register(
tx, tx,
our_temp_id, our_temp_id,
net_keypair, net_keypair,
testnet,
kns_address, kns_address,
boot_provider, boot_provider,
) )
@ -399,7 +387,6 @@ async fn handle_boot(
sender: Arc<RegistrationSender>, sender: Arc<RegistrationSender>,
our: Arc<Identity>, our: Arc<Identity>,
networking_keypair: Arc<Vec<u8>>, networking_keypair: Arc<Vec<u8>>,
testnet: bool,
kns_address: EthAddress, kns_address: EthAddress,
provider: Arc<Provider<PubSubFrontend>>, provider: Arc<Provider<PubSubFrontend>>,
) -> Result<impl Reply, Rejection> { ) -> Result<impl Reply, Rejection> {
@ -503,7 +490,7 @@ async fn handle_boot(
.into_response()); .into_response());
}; };
let chain_id: u64 = if testnet { 11155111 } else { 10 }; let chain_id: u64 = 10;
// manual json creation to preserve order.. // manual json creation to preserve order..
let sig_data_json = format!( let sig_data_json = format!(