Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blockchain events improvements #3446

Merged
merged 12 commits into from
Dec 1, 2024
21 changes: 19 additions & 2 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,12 @@
"config": {
"blockchains": ["hardhat1:31337", "hardhat2:31337"],
"rpcEndpoints": {
"hardhat1:31337:": ["http://localhost:8545"],
"hardhat1:31337": ["http://localhost:8545"],
"hardhat2:31337": ["http://localhost:9545"]
},
"hubContractAddress": {
"hardhat1:31337": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
"hardhat2:31337": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
}
}
}
Expand Down Expand Up @@ -354,8 +358,12 @@
"config": {
"blockchains": ["hardhat1:31337", "hardhat2:31337"],
"rpcEndpoints": {
"hardhat1:31337:": ["http://localhost:8545"],
"hardhat1:31337": ["http://localhost:8545"],
"hardhat2:31337": ["http://localhost:9545"]
},
"hubContractAddress": {
"hardhat1:31337": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
"hardhat2:31337": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
}
}
}
Expand Down Expand Up @@ -539,6 +547,9 @@
"blockchains": ["base:84532"],
"rpcEndpoints": {
"base:84532": ["https://sepolia.base.org"]
},
"hubContractAddress": {
"base:84532": "0xCca0eA14540588A09c85cD6A6Fc53eA3A7010692"
}
}
}
Expand Down Expand Up @@ -721,6 +732,9 @@
"blockchains": ["base:84532"],
"rpcEndpoints": {
"base:84532": ["https://sepolia.base.org"]
},
"hubContractAddress": {
"base:84532": "0xAB4A4794Fc1F415C24807B947280aCa8dC492238"
}
}
}
Expand Down Expand Up @@ -930,6 +944,9 @@
"https://astrosat.origintrail.network/",
"https://astrosat-2.origintrail.network/"
]
},
"hubContractAddress": {
"otp:2043": "0x5fA7916c48Fe6D5F1738d12Ad234b78c90B4cAdA"
}
}
}
Expand Down
31 changes: 31 additions & 0 deletions installer/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,37 @@ EOF
# Configure Base-Sepolia
configure_blockchain "base" $base_blockchain_id

# Function to configure blockchain events services
configure_blockchain_events_services() {
local blockchain=$1
local blockchain_id=$2

print_color $CYAN "🔧 Configuring Blockchain Events Service for Base Sepolia (Testnet)..."

read -p "$(print_color $YELLOW "Enter your RPC endpoint: ")" RPC_ENDPOINT
print_color $GREEN "✅ RPC endpoint: $RPC_ENDPOINT"

local jq_filter=$(cat <<EOF
.modules.blockchainEvents.implementation["ot-ethers"] = {
"enabled": true,
"config": {
"blockchains": ["$blockchain:$blockchain_id"],
rpcEndpoints: {
"$blockchain:$blockchain_id": ["$RPC_ENDPOINT"]
}
}
}
EOF
)

jq "$jq_filter" $CONFIG_DIR/.origintrail_noderc > $CONFIG_DIR/origintrail_noderc_tmp
mv $CONFIG_DIR/origintrail_noderc_tmp $CONFIG_DIR/.origintrail_noderc
chmod 600 $CONFIG_DIR/.origintrail_noderc
}

# Configure blockchain events service for Base Sepolia
configure_blockchain_events_services "base" $base_blockchain_id

# Now execute npm install after configuring wallets
print_color $CYAN "📦 Installing npm packages..."
perform_step npm ci --omit=dev --ignore-scripts "Executing npm install"
Expand Down
3 changes: 1 addition & 2 deletions ot-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,14 @@ class OTNode {
this.initializeEventEmitter();

await this.initializeModules();
this.initializeBlockchainEventsService();
await this.initializeParanets();

await this.createProfiles();

await this.initializeCommandExecutor();
await this.initializeShardingTableService();

this.initializeBlockchainEventsService();

await this.initializeRouters();
await this.startNetworkModule();
await this.initializeBLSService();
Expand Down
Loading
Loading