diff --git a/docker/deployed/testnet/api/.env_validator.example b/docker/deployed/testnet/api/.env_validator.example index a8b54cca..3db2d265 100644 --- a/docker/deployed/testnet/api/.env_validator.example +++ b/docker/deployed/testnet/api/.env_validator.example @@ -1,5 +1,6 @@ VALIDATOR_ALCHEMY_ETHEREUM_SEPOLIA_API_KEY= VALIDATOR_GLIF_FILECOIN_CALIBRATION_API_KEY= +VALIDATOR_ALCHEMY_POLYGON_AMOY_API_KEY= VALIDATOR_ALCHEMY_ARBITRUM_SEPOLIA_API_KEY= VALIDATOR_ALCHEMY_OPTIMISM_SEPOLIA_API_KEY= METRICS_HUB_API_KEY= diff --git a/docker/deployed/testnet/api/config.json b/docker/deployed/testnet/api/config.json index 2b23d75d..cde855dd 100644 --- a/docker/deployed/testnet/api/config.json +++ b/docker/deployed/testnet/api/config.json @@ -71,6 +71,25 @@ }, "HashCalculationStep": 150 }, + { + "Name": "Polygon Amoy", + "ChainID": 80002, + "Registry": { + "EthEndpoint": "wss://polygon-amoy.g.alchemy.com/v2/${VALIDATOR_ALCHEMY_POLYGON_AMOY_API_KEY}", + "ContractAddress": "0x170fb206132b693e38adFc8727dCfa303546Cec1" + }, + "EventFeed": { + "ChainAPIBackoff": "15s", + "NewBlockPollFreq": "5s", + "MinBlockDepth": 1, + "PersistEvents": true + }, + "EventProcessor": { + "BlockFailedExecutionBackoff": "10s", + "DedupExecutedTxns": true + }, + "HashCalculationStep": 360 + }, { "Name": "Arbitrum Sepolia", "ChainID": 421614, diff --git a/pkg/client/chains.go b/pkg/client/chains.go index c74ee2ac..4cf0abd7 100644 --- a/pkg/client/chains.go +++ b/pkg/client/chains.go @@ -25,6 +25,7 @@ var ChainIDs = struct { OptimismSepolia ChainID ArbitrumSepolia ChainID FilecoinCalibration ChainID + PolygonAmoy ChainID Local ChainID }{ Ethereum: 1, @@ -37,6 +38,7 @@ var ChainIDs = struct { OptimismSepolia: 11155420, ArbitrumSepolia: 421614, FilecoinCalibration: 314159, + PolygonAmoy: 80002, Local: 31337, } @@ -110,6 +112,12 @@ var Chains = map[ChainID]Chain{ Name: "Filecoin Calibration", ContractAddr: common.HexToAddress("0x030BCf3D50cad04c2e57391B12740982A9308621"), }, + ChainIDs.PolygonAmoy: { + Endpoint: testnetURL, + ID: ChainIDs.PolygonAmoy, + Name: "Polygon Amoy", + ContractAddr: common.HexToAddress("0x170fb206132b693e38adFc8727dCfa303546Cec1"), + }, ChainIDs.Local: { Endpoint: localURL, ID: ChainIDs.Local, @@ -134,6 +142,7 @@ var AlchemyURLs = map[ChainID]string{ ChainIDs.Optimism: "https://opt-mainnet.g.alchemy.com/v2/%s", ChainIDs.ArbitrumSepolia: "https://arb-sepolia.g.alchemy.com/v2/%s", ChainIDs.Arbitrum: "https://arb-mainnet.g.alchemy.com/v2/%s", + ChainIDs.PolygonAmoy: "https://polygon-amoy.g.alchemy.com/v2/%s", ChainIDs.Polygon: "https://polygon-mainnet.g.alchemy.com/v2/%s", } diff --git a/pkg/client/v1/client.go b/pkg/client/v1/client.go index 203b00c6..a63db319 100644 --- a/pkg/client/v1/client.go +++ b/pkg/client/v1/client.go @@ -20,7 +20,7 @@ import ( "github.com/textileio/go-tableland/pkg/wallet" ) -var defaultChain = client.Chains[client.ChainIDs.EthereumSepolia] +var defaultChain = client.Chains[client.ChainIDs.PolygonAmoy] // Client is the Tableland client. type Client struct {