Skip to content
Draft
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
272 changes: 272 additions & 0 deletions CONFIG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
[//]: # (Documentation generated from docs.toml - DO NOT EDIT.)

This document describes the TOML format for configuration.
## Example

```toml
ChainID = "4"

[[Aptos.Nodes]]
Name = 'primary'
URL = "http://chainlink-aptos.devnet:8080/v1"
```

## Global
```toml
Enabled = true # Default
ChainID = 'TODO' # Example
NetworkName = 'TODO' # Example
NetworkNameFull = 'TODO' # Example
```


### Enabled
```toml
Enabled = true # Default
```
Enabled TODO

### ChainID
```toml
ChainID = 'TODO' # Example
```
ChainID TODO

### NetworkName
```toml
NetworkName = 'TODO' # Example
```
NetworkName TODO

### NetworkNameFull
```toml
NetworkNameFull = 'TODO' # Example
```
NetworkNameFull TODO

## TransactionManager
```toml
[TransactionManager]
BroadcastChanSize = 100 # Default
ConfirmPoll = '2s' # Default
ConfirmPollSecs = 1 # Example
DefaultMaxGasAmount = 200000 # Default
MaxSimulateAttempts = 5 # Default
MaxSubmitRetryAttempts = 10 # Default
SubmitDelayDuration = '3s' # Default
TxExpiration = '10s' # Default
TxExpirationSecs = 360 # Example
MaxTxRetryAttempts = 5 # Default
PruneInterval = '4h' # Default
PruneIntervalSecs = 1 # Example
PruneTxExpiration = '2h' # Default
PruneTxExpirationSecs = 42 # Example
```


### BroadcastChanSize
```toml
BroadcastChanSize = 100 # Default
```
BroadcastChanSize TODO

### ConfirmPoll
```toml
ConfirmPoll = '2s' # Default
```
ConfirmPoll TODO

### ConfirmPollSecs
```toml
ConfirmPollSecs = 1 # Example
```
ConfirmPollSecs is deprecated. Use ConfirmPoll instead.

### DefaultMaxGasAmount
```toml
DefaultMaxGasAmount = 200000 # Default
```
DefaultMaxGasAmount TODO
https://github.com/aptos-labs/aptos-ts-sdk/blob/32d4360740392782c1368647f89ba62e1b6a2cb3/src/utils/const.ts#L21

### MaxSimulateAttempts
```toml
MaxSimulateAttempts = 5 # Default
```
MaxSimulateAttempts TODO

### MaxSubmitRetryAttempts
```toml
MaxSubmitRetryAttempts = 10 # Default
```
MaxSubmitRetryAttempts TODO

### SubmitDelayDuration
```toml
SubmitDelayDuration = '3s' # Default
```
SubmitDelayDuration TODO

### TxExpiration
```toml
TxExpiration = '10s' # Default
```
TxExpiration TODO

### TxExpirationSecs
```toml
TxExpirationSecs = 360 # Example
```
TxExpirationSecs is deprecated. Use TxExpiration instead.

### MaxTxRetryAttempts
```toml
MaxTxRetryAttempts = 5 # Default
```
MaxTxRetryAttempts TODO

### PruneInterval
```toml
PruneInterval = '4h' # Default
```
PruneInterval TODO

### PruneIntervalSecs
```toml
PruneIntervalSecs = 1 # Example
```
PruneIntervalSecs is deprecated. Use PruneInterval instead.

### PruneTxExpiration
```toml
PruneTxExpiration = '2h' # Default
```
PruneTxExpiration TODO

### PruneTxExpirationSecs
```toml
PruneTxExpirationSecs = 42 # Example
```
PruneTxExpirationSecs is deprecated. Use PruneTxExpiration instead.

## LogPoller
```toml
[LogPoller]
EventPollingInterval = '12s' # Default
TxPollingInterval = '12s' # Default
PollTimeout = '10s' # Default
EventBatchSize = 100 # Default
TxBatchSize = 100 # Default
TXPollerDisabled = false # Default
```


### EventPollingInterval
```toml
EventPollingInterval = '12s' # Default
```
EventPollingInterval TODO

### TxPollingInterval
```toml
TxPollingInterval = '12s' # Default
```
TxPollingInterval TODO

### PollTimeout
```toml
PollTimeout = '10s' # Default
```
PollTimeout TODO

### EventBatchSize
```toml
EventBatchSize = 100 # Default
```
EventBatchSize TODO

### TxBatchSize
```toml
TxBatchSize = 100 # Default
```
TxBatchSize TODO

### TXPollerDisabled
```toml
TXPollerDisabled = false # Default
```
TXPollerDisabled TODO

## BalanceMonitor
```toml
[BalanceMonitor]
BalancePollPeriod = '10s' # Default
```


### BalancePollPeriod
```toml
BalancePollPeriod = '10s' # Default
```
BalancePollPeriod TODO

## WriteTargetCap
```toml
[WriteTargetCap]
ConfirmerPollPeriod = '1s' # Default
ConfirmerTimeout = '10s' # Default
```


### ConfirmerPollPeriod
```toml
ConfirmerPollPeriod = '1s' # Default
```
ConfirmerPollPeriod TODO

### ConfirmerTimeout
```toml
ConfirmerTimeout = '10s' # Default
```
ConfirmerTimeout TODO

## Workflow
```toml
[Workflow]
ForwarderAddress = 'TODO' # Example
PublicKey = 'TODO' # Example
```


### ForwarderAddress
```toml
ForwarderAddress = 'TODO' # Example
```
ForwarderAddress TODO

### PublicKey
```toml
PublicKey = 'TODO' # Example
```
PublicKey TODO

## Nodes
```toml
[[Nodes]]
Name = 'TODO' # Example
URL = '' # Example
```


### Name
```toml
Name = 'TODO' # Example
```
Name TODO

### URL
```toml
URL = '' # Example
```
URL TODO

4 changes: 2 additions & 2 deletions cmd/chainlink-aptos/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ type pluginRelayer struct {
// [github.com/smartcontractkit/chainlink-common/pkg/loop.PluginRelayer]
// loopKs must be an implementation that can construct a aptos keystore adapter
// [github.com/smartcontractkit/chainlink-aptos/relayer/txm.NewKeystoreAdapter]
func (p *pluginRelayer) NewRelayer(ctx context.Context, rawConfig string, loopKs loop.Keystore, capRegistry core.CapabilitiesRegistry) (loop.Relayer, error) {
func (p *pluginRelayer) NewRelayer(ctx context.Context, rawConfig string, loopKS, csaKS core.Keystore, capRegistry core.CapabilitiesRegistry) (loop.Relayer, error) {
// Initialize the chain service
cfg, err := config.NewDecodedTOMLConfig(rawConfig)
if err != nil {
return nil, fmt.Errorf("failed to read configs: %w", err)
}
opts := chain.ChainOpts{
Logger: p.Logger,
KeyStore: loopKs,
KeyStore: loopKS,
DS: p.ds,
}
chain, err := chain.NewChain(cfg, opts)
Expand Down
24 changes: 24 additions & 0 deletions cmd/config-docs/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package main

import (
"flag"
"fmt"
"log"
"os"
"path/filepath"

"github.com/smartcontractkit/chainlink-aptos/relayer/config"
)

var outDir = flag.String("o", "", "output directory")

func main() {
s, err := config.GenerateDocs()
if err != nil {
log.Fatalln("Failed to generate docs:", err)
}
if err = os.WriteFile(filepath.Join(*outDir, "CONFIG.md"), []byte(s), 0600); err != nil {
fmt.Fprintf(os.Stderr, "failed to write config docs: %v\n", err)
os.Exit(1)
}
}
19 changes: 19 additions & 0 deletions config_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package aptos

import (
_ "embed"
"testing"

"github.com/stretchr/testify/assert"

"github.com/smartcontractkit/chainlink-aptos/relayer/config"
)

//go:embed CONFIG.md
var configMD string

func TestConfigDocs(t *testing.T) {
cfg, err := config.GenerateDocs()
assert.NoError(t, err, "invalid config docs")
assert.Equal(t, configMD, cfg, "CONFIG.md is out of date. Run 'go generate .' to regenerate.")
}
Loading
Loading