cmd: rename llmd and llm to poold and pool

This commit is contained in:
Olaoluwa Osuntokun 2020-09-09 17:44:58 -07:00
parent 603d90e7bf
commit 33678c0ee6
No known key found for this signature in database
GPG key ID: BC13F65E2DC84465
6 changed files with 57 additions and 57 deletions

View file

@ -7,7 +7,7 @@ import (
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcutil"
"github.com/lightninglabs/llm/clmrpc"
"github.com/lightninglabs/pool/poolrpc"
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
"github.com/urfave/cli"
)
@ -41,7 +41,7 @@ type Account struct {
}
// NewAccountFromProto creates a display Account from its proto.
func NewAccountFromProto(a *clmrpc.Account) *Account {
func NewAccountFromProto(a *poolrpc.Account) *Account {
var opHash, latestTxHash chainhash.Hash
copy(opHash[:], a.Outpoint.Txid)
copy(latestTxHash[:], a.LatestTxid)
@ -111,9 +111,9 @@ func newAccount(ctx *cli.Context) error {
return err
}
req := &clmrpc.InitAccountRequest{
req := &poolrpc.InitAccountRequest{
AccountValue: amt,
Fees: &clmrpc.InitAccountRequest_ConfTarget{
Fees: &poolrpc.InitAccountRequest_ConfTarget{
ConfTarget: uint32(ctx.Uint64("conf_target")),
},
}
@ -124,11 +124,11 @@ func newAccount(ctx *cli.Context) error {
}
if height, err := parseUint64(ctx, 1, accountExpiryAbsolute, cmd); err == nil {
req.AccountExpiry = &clmrpc.InitAccountRequest_AbsoluteHeight{
req.AccountExpiry = &poolrpc.InitAccountRequest_AbsoluteHeight{
AbsoluteHeight: uint32(height),
}
} else if height, err := parseUint64(ctx, 1, accountExpiryRelative, cmd); err == nil {
req.AccountExpiry = &clmrpc.InitAccountRequest_RelativeHeight{
req.AccountExpiry = &poolrpc.InitAccountRequest_RelativeHeight{
RelativeHeight: uint32(height),
}
} else {
@ -168,12 +168,12 @@ func newAccount(ctx *cli.Context) error {
return nil
}
func printAccountFees(client clmrpc.TraderClient, amt btcutil.Amount,
func printAccountFees(client poolrpc.TraderClient, amt btcutil.Amount,
confTarget uint32) error {
req := &clmrpc.QuoteAccountRequest{
req := &poolrpc.QuoteAccountRequest{
AccountValue: uint64(amt),
Fees: &clmrpc.QuoteAccountRequest_ConfTarget{
Fees: &poolrpc.QuoteAccountRequest_ConfTarget{
ConfTarget: confTarget,
},
}
@ -212,7 +212,7 @@ func listAccounts(ctx *cli.Context) error {
defer cleanup()
resp, err := client.ListAccounts(
context.Background(), &clmrpc.ListAccountsRequest{},
context.Background(), &poolrpc.ListAccountsRequest{},
)
if err != nil {
return err
@ -289,7 +289,7 @@ func depositAccount(ctx *cli.Context) error {
defer cleanup()
resp, err := client.DepositAccount(
context.Background(), &clmrpc.DepositAccountRequest{
context.Background(), &poolrpc.DepositAccountRequest{
TraderKey: traderKey,
AmountSat: amt,
FeeRateSatPerKw: uint64(feeRate),
@ -380,9 +380,9 @@ func withdrawAccount(ctx *cli.Context) error {
defer cleanup()
resp, err := client.WithdrawAccount(
context.Background(), &clmrpc.WithdrawAccountRequest{
context.Background(), &poolrpc.WithdrawAccountRequest{
TraderKey: traderKey,
Outputs: []*clmrpc.Output{
Outputs: []*poolrpc.Output{
{
ValueSat: amt,
Address: addr,
@ -463,12 +463,12 @@ func closeAccount(ctx *cli.Context) error {
defer cleanup()
resp, err := client.CloseAccount(
context.Background(), &clmrpc.CloseAccountRequest{
context.Background(), &poolrpc.CloseAccountRequest{
TraderKey: traderKey,
FundsDestination: &clmrpc.CloseAccountRequest_OutputWithFee{
OutputWithFee: &clmrpc.OutputWithFee{
FundsDestination: &poolrpc.CloseAccountRequest_OutputWithFee{
OutputWithFee: &poolrpc.OutputWithFee{
Address: ctx.String("addr"),
Fees: &clmrpc.OutputWithFee_FeeRateSatPerKw{
Fees: &poolrpc.OutputWithFee_FeeRateSatPerKw{
FeeRateSatPerKw: uint64(satPerKw),
},
},
@ -540,7 +540,7 @@ func bumpAccountFee(ctx *cli.Context) error {
defer cleanup()
resp, err := client.BumpAccountFee(
context.Background(), &clmrpc.BumpAccountFeeRequest{
context.Background(), &poolrpc.BumpAccountFeeRequest{
TraderKey: traderKey,
FeeRateSatPerKw: uint64(satPerKw),
},
@ -582,7 +582,7 @@ func recoverAccounts(ctx *cli.Context) error {
defer cleanup()
resp, err := client.RecoverAccounts(
context.Background(), &clmrpc.RecoverAccountsRequest{},
context.Background(), &poolrpc.RecoverAccountsRequest{},
)
if err != nil {
return err

View file

@ -5,7 +5,7 @@ import (
"encoding/hex"
"fmt"
"github.com/lightninglabs/llm/clmrpc"
"github.com/lightninglabs/pool/poolrpc"
"github.com/urfave/cli"
)
@ -41,7 +41,7 @@ func auctionFee(ctx *cli.Context) error {
defer cleanup()
auctionFee, err := client.AuctionFee(
context.Background(), &clmrpc.AuctionFeeRequest{},
context.Background(), &poolrpc.AuctionFeeRequest{},
)
if err != nil {
return err
@ -97,7 +97,7 @@ func batchSnapshot(ctx *cli.Context) error {
ctxb := context.Background()
batchSnapshot, err := client.BatchSnapshot(
ctxb,
&clmrpc.BatchSnapshotRequest{
&poolrpc.BatchSnapshotRequest{
BatchId: batchID,
},
)

View file

@ -8,7 +8,7 @@ import (
"time"
"github.com/lightninglabs/aperture/lsat"
"github.com/lightninglabs/llm/clmrpc"
"github.com/lightninglabs/pool/poolrpc"
"github.com/urfave/cli"
"gopkg.in/macaroon.v2"
)
@ -29,7 +29,7 @@ type printableToken struct {
var listAuthCommand = cli.Command{
Name: "listauth",
Usage: "list all LSAT tokens",
Description: "Shows a list of all LSAT tokens that llmd has paid for",
Description: "Shows a list of all LSAT tokens that poold has paid for",
Action: listAuth,
}
@ -41,7 +41,7 @@ func listAuth(ctx *cli.Context) error {
defer cleanup()
resp, err := client.GetLsatTokens(
context.Background(), &clmrpc.TokensRequest{},
context.Background(), &poolrpc.TokensRequest{},
)
if err != nil {
return err

View file

@ -11,8 +11,8 @@ import (
"strconv"
"github.com/btcsuite/btcutil"
"github.com/lightninglabs/llm"
"github.com/lightninglabs/llm/clmrpc"
"github.com/lightninglabs/pool"
"github.com/lightninglabs/pool/poolrpc"
"github.com/lightninglabs/protobuf-hex-display/jsonpb"
"github.com/lightninglabs/protobuf-hex-display/proto"
"github.com/lightningnetwork/lnd/macaroons"
@ -33,12 +33,12 @@ var (
tlsCertFlag = cli.StringFlag{
Name: "tlscertpath",
Usage: "path to llm's TLS certificate, only needed if llm " +
Usage: "path to pool's TLS certificate, only needed if pool " +
"runs in the same process as lnd",
}
macaroonPathFlag = cli.StringFlag{
Name: "macaroonpath",
Usage: "path to macaroon file, only needed if llm runs " +
Usage: "path to macaroon file, only needed if pool runs " +
"in the same process as lnd",
}
)
@ -85,7 +85,7 @@ func fatal(err error) {
if errors.As(err, &e) {
_ = cli.ShowCommandHelp(e.ctx, e.command)
} else {
_, _ = fmt.Fprintf(os.Stderr, "[llm] %v\n", err)
_, _ = fmt.Fprintf(os.Stderr, "[pool] %v\n", err)
}
os.Exit(1)
}
@ -93,14 +93,14 @@ func fatal(err error) {
func main() {
app := cli.NewApp()
app.Version = llm.Version()
app.Name = "llm"
app.Usage = "control plane for your llmd"
app.Version = pool.Version()
app.Name = "pool"
app.Usage = "control plane for your poold"
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "rpcserver",
Value: "localhost:12010",
Usage: "llmd daemon address host:port",
Usage: "poold daemon address host:port",
},
tlsCertFlag,
macaroonPathFlag,
@ -116,7 +116,7 @@ func main() {
}
}
func getClient(ctx *cli.Context) (clmrpc.TraderClient, func(),
func getClient(ctx *cli.Context) (poolrpc.TraderClient, func(),
error) {
rpcServer := ctx.GlobalString("rpcserver")
@ -128,7 +128,7 @@ func getClient(ctx *cli.Context) (clmrpc.TraderClient, func(),
}
cleanup := func() { _ = conn.Close() }
traderClient := clmrpc.NewTraderClient(conn)
traderClient := poolrpc.NewTraderClient(conn)
return traderClient, cleanup, nil
}

View file

@ -9,9 +9,9 @@ import (
"strings"
"github.com/btcsuite/btcutil"
"github.com/lightninglabs/llm/clmrpc"
"github.com/lightninglabs/llm/order"
"github.com/lightninglabs/llm/terms"
"github.com/lightninglabs/pool/poolrpc"
"github.com/lightninglabs/pool/order"
"github.com/lightninglabs/pool/terms"
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
"github.com/urfave/cli"
)
@ -85,12 +85,12 @@ func promptForConfirmation(msg string) bool {
// line positional arguments and/or flags and parses them based on their
// destination data type. No formal in-depth validation is performed as the
// server will do that on the RPC level anyway.
func parseCommonParams(ctx *cli.Context, blockDuration uint32) (*clmrpc.Order, error) {
func parseCommonParams(ctx *cli.Context, blockDuration uint32) (*poolrpc.Order, error) {
var (
err error
amt btcutil.Amount
args = ctx.Args()
params = &clmrpc.Order{}
params = &poolrpc.Order{}
)
switch {
@ -207,7 +207,7 @@ func ordersSubmitAsk(ctx *cli.Context) error { // nolint: dupl
return nil
}
ask := &clmrpc.Ask{
ask := &poolrpc.Ask{
MaxDurationBlocks: uint32(ctx.Uint64("max_duration_blocks")),
Version: uint32(order.VersionDefault),
}
@ -247,8 +247,8 @@ func ordersSubmitAsk(ctx *cli.Context) error { // nolint: dupl
}
resp, err := client.SubmitOrder(
context.Background(), &clmrpc.SubmitOrderRequest{
Details: &clmrpc.SubmitOrderRequest_Ask{
context.Background(), &poolrpc.SubmitOrderRequest{
Details: &poolrpc.SubmitOrderRequest_Ask{
Ask: ask,
},
},
@ -261,12 +261,12 @@ func ordersSubmitAsk(ctx *cli.Context) error { // nolint: dupl
return nil
}
func printOrderDetails(client clmrpc.TraderClient, amt btcutil.Amount,
func printOrderDetails(client poolrpc.TraderClient, amt btcutil.Amount,
rate order.FixedRatePremium, leaseDuration uint32,
maxBatchFeeRate chainfee.SatPerKWeight, isAsk bool) error {
auctionFee, err := client.AuctionFee(
context.Background(), &clmrpc.AuctionFeeRequest{},
context.Background(), &poolrpc.AuctionFeeRequest{},
)
if err != nil {
return err
@ -349,7 +349,7 @@ func ordersSubmitBid(ctx *cli.Context) error { // nolint: dupl
return nil
}
bid := &clmrpc.Bid{
bid := &poolrpc.Bid{
MinDurationBlocks: uint32(ctx.Uint64("min_duration_blocks")),
Version: uint32(order.VersionDefault),
}
@ -389,8 +389,8 @@ func ordersSubmitBid(ctx *cli.Context) error { // nolint: dupl
}
resp, err := client.SubmitOrder(
context.Background(), &clmrpc.SubmitOrderRequest{
Details: &clmrpc.SubmitOrderRequest_Bid{
context.Background(), &poolrpc.SubmitOrderRequest{
Details: &poolrpc.SubmitOrderRequest_Bid{
Bid: bid,
},
},
@ -421,7 +421,7 @@ func ordersList(ctx *cli.Context) error {
defer cleanup()
resp, err := client.ListOrders(
context.Background(), &clmrpc.ListOrdersRequest{},
context.Background(), &poolrpc.ListOrdersRequest{},
)
if err != nil {
return err
@ -479,7 +479,7 @@ func ordersCancel(ctx *cli.Context) error { // nolint: dupl
defer cleanup()
resp, err := client.CancelOrder(
context.Background(), &clmrpc.CancelOrderRequest{
context.Background(), &poolrpc.CancelOrderRequest{
OrderNonce: nonce,
},
)

View file

@ -10,14 +10,14 @@ import (
"strings"
"github.com/jessevdk/go-flags"
"github.com/lightninglabs/llm"
"github.com/lightninglabs/pool"
// Blank import to set up profiling HTTP handlers.
_ "net/http/pprof"
)
var (
defaultConfigFilename = "llmd.conf"
defaultConfigFilename = "poold.conf"
)
func main() {
@ -28,7 +28,7 @@ func main() {
}
func start() error {
config := llm.DefaultConfig()
config := pool.DefaultConfig()
// Parse command line flags.
parser := flags.NewParser(&config, flags.Default)
@ -88,18 +88,18 @@ func start() error {
appName := filepath.Base(os.Args[0])
appName = strings.TrimSuffix(appName, filepath.Ext(appName))
if config.ShowVersion {
fmt.Println(appName, "version", llm.Version())
fmt.Println(appName, "version", pool.Version())
os.Exit(0)
}
// Special show command to list supported subsystems and exit.
if config.DebugLevel == "show" {
fmt.Printf("Supported subsystems: %v\n",
llm.SupportedSubsystems())
pool.SupportedSubsystems())
os.Exit(0)
}
return llm.Run(&config)
return pool.Run(&config)
}
return fmt.Errorf("unimplemented command %v", parser.Active.Name)