-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add logic run and restructure folders
- Loading branch information
Showing
12 changed files
with
194 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
package chains | ||
|
||
// ChainType defines the type of the target chain. | ||
type ChainType int | ||
|
||
const ( | ||
ChainTypeUndefined ChainType = iota | ||
ChainTypeEVM | ||
Cosmwasm | ||
) | ||
|
||
// Config defines the common configuration for the target chain client. | ||
type Config struct{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package evm | ||
|
||
import "go.uber.org/zap" | ||
|
||
// Key represents a key in the keystore. | ||
type Key struct { | ||
Name string | ||
ChainID string | ||
PrivKey string | ||
PubKey string | ||
} | ||
|
||
// NewKey creates a new key instance. | ||
func NewKey(name, chainID, privKey, pubKey string) Key { | ||
return Key{ | ||
Name: name, | ||
ChainID: chainID, | ||
PrivKey: privKey, | ||
PubKey: pubKey, | ||
} | ||
} | ||
|
||
// KeyStore stores information for interacting with the key store. | ||
type KeyStore struct { | ||
Log *zap.Logger | ||
Path string | ||
} | ||
|
||
// NewKeyStore creates a new key store instance. | ||
func NewKeyStore(log *zap.Logger, cfgPath string) KeyStore { | ||
return KeyStore{ | ||
Log: log, | ||
Path: cfgPath, | ||
} | ||
} | ||
|
||
// SaveKeys saves keys to the store. | ||
func (ks *KeyStore) SaveKeys(keys []Key, cfgPath string) error { | ||
return nil | ||
} | ||
|
||
// GetKeys gets keys from the store. | ||
func (ks *KeyStore) GetKeys() ([]Key, error) { | ||
return nil, nil | ||
} | ||
|
||
// GetKey gets a key by name from the store. | ||
func (ks *KeyStore) GetKey(name string) (Key, error) { | ||
return Key{}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
package falcon | ||
|
||
type Config struct{} | ||
import ( | ||
"time" | ||
|
||
"github.com/bandprotocol/falcon/falcon/band" | ||
"github.com/bandprotocol/falcon/falcon/chains" | ||
) | ||
|
||
// TargetChainConfig is the metadata of the configured target chain. | ||
type TargetChainConfig struct { | ||
Name string `toml:"id"` | ||
Type chains.ChainType `toml:"type"` | ||
ConfigPath string `toml:"path"` | ||
} | ||
|
||
// Config defines the configuration for the falcon tunnel relayer. | ||
type Config struct { | ||
BandChainConfig band.Config `toml:"bandchain"` | ||
TargetChains []TargetChainConfig `toml:"target_chains"` | ||
CheckingPacketInterval time.Duration `toml:"checking_packet_interval"` | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
package falcon | ||
|
||
import ( | ||
"context" | ||
|
||
"go.uber.org/zap" | ||
) | ||
|
||
// Scheduler is a struct to manage all tunnel relayers | ||
type Scheduler struct { | ||
Log *zap.Logger | ||
TunnelRelayers []TunnelRelayer | ||
} | ||
|
||
// NewScheduler creates a new Scheduler | ||
func NewScheduler( | ||
log *zap.Logger, | ||
tunnelRelayers []TunnelRelayer, | ||
) *Scheduler { | ||
return &Scheduler{ | ||
Log: log, | ||
TunnelRelayers: tunnelRelayers, | ||
} | ||
} | ||
|
||
// Start starts all tunnel relayers | ||
func (s *Scheduler) Start() error { | ||
return nil | ||
} | ||
|
||
// Stop stops all tunnel relayers | ||
func (s *Scheduler) Stop() error { | ||
func (s *Scheduler) Start(ctx context.Context) error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
package main | ||
|
||
import "github.com/bandprotocol/falcon/cmd" | ||
import ( | ||
"os" | ||
|
||
"github.com/bandprotocol/falcon/cmd" | ||
) | ||
|
||
func main() { | ||
cmd.Execute() | ||
if err := cmd.Execute(); err != nil { | ||
os.Exit(1) | ||
} | ||
} |