Skip to content

Commit

Permalink
Add polygon amoy config
Browse files Browse the repository at this point in the history
Signed-off-by: avichalp <hi@avichalp.me>
  • Loading branch information
avichalp committed Apr 16, 2024
1 parent ec209a0 commit 2790fbe
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker/deployed/testnet/api/.env_validator.example
Original file line number Diff line number Diff line change
@@ -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=
19 changes: 19 additions & 0 deletions docker/deployed/testnet/api/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions pkg/client/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var ChainIDs = struct {
OptimismSepolia ChainID
ArbitrumSepolia ChainID
FilecoinCalibration ChainID
PolygonAmoy ChainID
Local ChainID
}{
Ethereum: 1,
Expand All @@ -37,6 +38,7 @@ var ChainIDs = struct {
OptimismSepolia: 11155420,
ArbitrumSepolia: 421614,
FilecoinCalibration: 314159,
PolygonAmoy: 80002,
Local: 31337,
}

Expand Down Expand Up @@ -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,
Expand All @@ -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",
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/client/v1/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2790fbe

Please sign in to comment.