Skip to content

Commit

Permalink
Revert using separate registry for the AI Subnet
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko committed Sep 30, 2024
1 parent 2cd552f commit 4a1f48c
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions eth/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,25 +211,12 @@ func (c *client) setContracts(opts *bind.TransactOpts) error {

glog.V(common.SHORT).Infof("LivepeerToken: %v", c.tokenAddr.Hex())

chainID, err := c.backend.ChainID(context.Background())
serviceRegistryAddr, err := c.GetContract(crypto.Keccak256Hash([]byte("ServiceRegistry")))
if err != nil {
glog.Errorf("Failed to get chain ID from remote ethereum node: %v", err)
glog.Errorf("Error getting ServiceRegistry address: %v", err)
return err
}

// TODO: This is a temporary setup for a separate AIServiceRegistry. Revise this when AI subnet merges with the mainnet.
var serviceRegistryAddr ethcommon.Address
arbitrumOneChainID := big.NewInt(42161)
if chainID.Cmp(arbitrumOneChainID) == 0 {
serviceRegistryAddr = ethcommon.HexToAddress("0x04C0b249740175999E5BF5c9ac1dA92431EF34C5")
} else {
serviceRegistryAddr, err = c.GetContract(crypto.Keccak256Hash([]byte("ServiceRegistry")))
if err != nil {
glog.Errorf("Error getting ServiceRegistry address: %v", err)
return err
}
}

c.serviceRegistryAddr = serviceRegistryAddr

serviceRegistry, err := contracts.NewServiceRegistry(serviceRegistryAddr, c.backend)
Expand Down

0 comments on commit 4a1f48c

Please sign in to comment.