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

Add polygon amoy config #622

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading