Skip to content

Commit

Permalink
Merge pull request #3446 from OriginTrail/v8/blockchain-events-improv…
Browse files Browse the repository at this point in the history
…ements

Blockchain events improvements
  • Loading branch information
u-hubar authored Dec 1, 2024
2 parents 7051518 + 7d7e68b commit 865100c
Show file tree
Hide file tree
Showing 22 changed files with 686 additions and 750 deletions.
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

0 comments on commit 865100c

Please sign in to comment.