From ec256fd40087dbc1646352a32fa65c68205e7bd1 Mon Sep 17 00:00:00 2001 From: billettc Date: Fri, 29 May 2020 13:00:07 -0400 Subject: [PATCH 1/5] bios is now using zlog instead of a custom logger added Ops delegate bw and buy ram --- bios/bios.go | 93 +++++++++++------------ bios/contents.go | 8 +- bios/hooks.go | 6 +- bios/logger.go | 75 ------------------- bios/logging.go | 12 +++ bios/ops.go | 63 ++++++++++++---- eosc/cmd/boot.go | 30 +++++--- go.mod | 13 +--- go.sum | 191 +++++++++++++++++++++++++++++++++++------------ 9 files changed, 280 insertions(+), 211 deletions(-) delete mode 100644 bios/logger.go create mode 100644 bios/logging.go diff --git a/bios/bios.go b/bios/bios.go index d31853a2..dc8e9939 100644 --- a/bios/bios.go +++ b/bios/bios.go @@ -11,12 +11,13 @@ import ( "strings" "time" + "go.uber.org/zap" + "github.com/eoscanada/eos-go" "github.com/eoscanada/eos-go/ecc" ) type BIOS struct { - Log *Logger CachePath string TargetNetAPI *eos.API @@ -33,11 +34,10 @@ type BIOS struct { EphemeralPublicKey ecc.PublicKey } -func NewBIOS(logger *Logger, cachePath string, targetAPI *eos.API) *BIOS { +func NewBIOS(cachePath string, targetAPI *eos.API) *BIOS { b := &BIOS{ CachePath: cachePath, TargetNetAPI: targetAPI, - Log: logger, } return b } @@ -53,7 +53,9 @@ func (b *BIOS) Boot() error { return err } - b.Log.Println("START BOOT SEQUENCE...") + zlog.Info("***************************************************************") + zlog.Info("START BOOT SEQUENCE...") + zlog.Info("***************************************************************") var genesisData string var pubKey ecc.PublicKey @@ -102,17 +104,16 @@ func (b *BIOS) Boot() error { b.pingTargetNetwork() - b.Log.Println("In-memory keys:") + zlog.Info("In-memory keys:") memkeys, _ := b.TargetNetAPI.Signer.AvailableKeys(ctx) for _, key := range memkeys { - b.Log.Printf("- %s\n", key.String()) + zlog.Info("", zap.String("key", key.String())) } - b.Log.Println("") //eos.Debug = true for _, step := range b.BootSequence.BootSequence { - b.Log.Printf("%s [%s] ", step.Label, step.Op) + zlog.Info("action", zap.String("label", step.Label), zap.String("op", step.Op)) acts, err := step.Data.Actions(b) if err != nil { @@ -121,26 +122,26 @@ func (b *BIOS) Boot() error { if len(acts) != 0 { for idx, chunk := range ChunkifyActions(acts) { + for _, c := range chunk { + zlog.Info("processing chunk", zap.String("action", string(c.Name))) + } err := Retry(25, time.Second, func() error { _, err := b.TargetNetAPI.SignPushActions(ctx, chunk...) if err != nil { - b.Log.Printf("r") - b.Log.Debugf("error pushing transaction for step %q, chunk %d: %s\n", step.Op, idx, err) + zlog.Error("error pushing transaction", zap.String("op", step.Op), zap.Int("idx", idx), zap.Error(err)) return fmt.Errorf("push actions for step %q, chunk %d: %s", step.Op, idx, err) } return nil }) if err != nil { - b.Log.Printf(" failed\n") + zlog.Info(" failed") return err } - b.Log.Printf(".") } - b.Log.Printf(" done\n") } } - b.Log.Println("Waiting 2 seconds for transactions to flush to blocks") + zlog.Info("Waiting 2 seconds for transactions to flush to blocks") time.Sleep(2 * time.Second) // FIXME: don't do chain validation here.. @@ -149,7 +150,7 @@ func (b *BIOS) Boot() error { return fmt.Errorf("chain validation: %s", err) } if !isValid { - b.Log.Println("WARNING: chain invalid, destroying network if possible") + zlog.Info("WARNING: chain invalid, destroying network if possible") os.Exit(0) } @@ -164,7 +165,7 @@ func (b *BIOS) setEphemeralKeypair() error { if _, ok := b.BootSequence.Keys["ephemeral"]; ok { cnt := b.BootSequence.Keys["ephemeral"] - privKey, err := ecc.NewPrivateKey(strings.TrimSpace(string(cnt))) + privKey, err := ecc.NewPrivateKey(strings.TrimSpace(cnt)) if err != nil { return fmt.Errorf("unable to correctly decode ephemeral private key %q: %s", cnt, err) } @@ -204,7 +205,7 @@ func (b *BIOS) logEphemeralKey(tag string) { pubKey := b.EphemeralPublicKey.String() privKey := b.EphemeralPrivateKey.String() - b.Log.Printf("%s:\n\n\tPublic key: %s\n\tPrivate key: %s..%s\n\n", tag, pubKey, privKey[:4], privKey[len(privKey)-4:]) + zlog.Info("ephemeral key", zap.String("tag", tag), zap.String("pub_key", pubKey), zap.String("priv_key_prefix", privKey[:4]), zap.String("priv_key", privKey[len(privKey)-4:])) } func (b *BIOS) RunChainValidation() (bool, error) { @@ -241,24 +242,24 @@ func (b *BIOS) RunChainValidation() (bool, error) { err := b.validateTargetNetwork(bootSeqMap, bootSeq) if err != nil { - b.Log.Printf("BOOT SEQUENCE VALIDATION FAILED:\n%s", err) + zlog.Info("BOOT SEQUENCE VALIDATION FAILED:", zap.Error(err)) return false, nil } - b.Log.Println("") - b.Log.Println("All good! Chain validation succeeded!") - b.Log.Println("") + zlog.Info("") + zlog.Info("All good! Chain validation succeeded!") + zlog.Info("") return true, nil } func (b *BIOS) writeAllActionsToDisk() error { if !b.WriteActions { - b.Log.Println("Not writing actions to 'actions.jsonl'. Activate with --write-actions") + zlog.Info("Not writing actions to 'actions.jsonl'. Activate with --write-actions") return nil } - b.Log.Println("Writing all actions to 'actions.jsonl'...") + zlog.Info("Writing all actions to 'actions.jsonl'...") fl, err := os.Create("actions.jsonl") if err != nil { return err @@ -336,19 +337,18 @@ func (v ValidationErrors) Error() string { } func (b *BIOS) pingTargetNetwork() { - b.Log.Printf("Pinging target node at %q...", b.TargetNetAPI.BaseURL) + zlog.Info("Pinging target node at ", zap.String("url", b.TargetNetAPI.BaseURL)) for { info, err := b.TargetNetAPI.GetInfo(context.Background()) if err != nil { - b.Log.Debugf("target node error: %s\n", err) - b.Log.Printf("e") + zlog.Warn("target node", zap.Error(err)) time.Sleep(1 * time.Second) continue } if info.HeadBlockNum < 2 { - b.Log.Debugln("target node: still no blocks in") - b.Log.Printf(".") + zlog.Info("target node: still no blocks in") + zlog.Info(".") time.Sleep(1 * time.Second) continue } @@ -356,7 +356,7 @@ func (b *BIOS) pingTargetNetwork() { break } - b.Log.Println(" touchdown!") + zlog.Info(" touchdown!") } func (b *BIOS) validateTargetNetwork(bootSeqMap ActionMap, bootSeq []*eos.Action) (err error) { @@ -366,7 +366,7 @@ func (b *BIOS) validateTargetNetwork(bootSeqMap ActionMap, bootSeq []*eos.Action b.pingTargetNetwork() // TODO: wait for target network to be up, and responding... - b.Log.Println("Pulling blocks from chain until we gathered all actions to validate:") + zlog.Info("Pulling blocks from chain until we gathered all actions to validate:") blockHeight := 1 actionsRead := 0 seenMap := map[string]bool{} @@ -390,17 +390,14 @@ func (b *BIOS) validateTargetNetwork(bootSeqMap ActionMap, bootSeq []*eos.Action continue } - b.Log.Debugln("Failed getting block num from target api:", err) - b.Log.Printf("e") + zlog.Warn("Failed getting block num from target api", zap.String("message", err.Error())) time.Sleep(1 * time.Second) continue - } else { - b.Log.Printf(".\n") } blockHeight++ - b.Log.Printf("Receiving block height=%d producer=%s transactions=%d\n", m.BlockNumber(), m.Producer, len(m.Transactions)) + zlog.Info("Receiving block", zap.Uint32("block_num", m.BlockNumber()), zap.String("producer", string(m.Producer)), zap.Int("trx_count", len(m.Transactions))) if !gotSomeTx && len(m.Transactions) > 2 { gotSomeTx = true @@ -413,7 +410,7 @@ func (b *BIOS) validateTargetNetwork(bootSeqMap ActionMap, bootSeq []*eos.Action for _, receipt := range m.Transactions { unpacked, err := receipt.Transaction.Packed.Unpack() if err != nil { - b.Log.Println("WARNING: Unable to unpack transaction, won't be able to fully validate:", err) + zlog.Warn("Unable to unpack transaction, won't be able to fully validate", zap.Error(err)) return fmt.Errorf("unpack transaction failed") } @@ -421,7 +418,7 @@ func (b *BIOS) validateTargetNetwork(bootSeqMap ActionMap, bootSeq []*eos.Action act.SetToServer(false) data, err := eos.MarshalBinary(act) if err != nil { - b.Log.Printf("Error marshalling an action: %s\n", err) + zlog.Error("Error marshalling an action", zap.Error(err)) validationErrors = append(validationErrors, ValidationError{ Err: err, BlockNumber: 1, // extract from the block transactionmroot @@ -435,7 +432,6 @@ func (b *BIOS) validateTargetNetwork(bootSeqMap ActionMap, bootSeq []*eos.Action } key := sha2(data) // TODO: compute a hash here.. - b.Log.Printf("- Validating action %d/%d [%s::%s]", actionsRead+1, expectedActionCount, act.Account, act.Name) if _, ok := bootSeqMap[key]; !ok { validationErrors = append(validationErrors, ValidationError{ Err: errors.New("not found"), @@ -446,10 +442,10 @@ func (b *BIOS) validateTargetNetwork(bootSeqMap ActionMap, bootSeq []*eos.Action ActionHexData: hex.EncodeToString(act.HexData), Index: actionsRead, }) - b.Log.Printf(" INVALID ***************************** INVALID *************.\n") + zlog.Warn("INVALID action", zap.Int("action_read", actionsRead+1), zap.Int("expected_action_count", expectedActionCount), zap.String("account", string(act.Account)), zap.String("action", string(act.Name))) } else { seenMap[key] = true - b.Log.Printf(" valid.\n") + zlog.Info("validated action", zap.Int("action_read", actionsRead+1), zap.Int("expected_action_count", expectedActionCount), zap.String("account", string(act.Account)), zap.String("action", string(act.Name))) } actionsRead++ @@ -472,13 +468,13 @@ func (b *BIOS) validateTargetNetwork(bootSeqMap ActionMap, bootSeq []*eos.Action func (b *BIOS) flushMissingActions(seenMap map[string]bool, bootSeq []*eos.Action) { fl, err := os.Create("missing_actions.jsonl") if err != nil { - fmt.Println("Couldn't write to `missing_actions.jsonl`:", err) + zlog.Error("Couldn't write to `missing_actions.jsonl`:", zap.Error(err)) return } defer fl.Close() // TODO: print all actions that are still MISSING to `missing_actions.jsonl`. - b.Log.Println("Flushing unseen transactions to `missing_actions.jsonl` up until this point.") + zlog.Info("Flushing unseen transactions to `missing_actions.jsonl` up until this point.") for _, act := range bootSeq { act.SetToServer(true) @@ -495,19 +491,18 @@ func (b *BIOS) flushMissingActions(seenMap map[string]bool, bootSeq []*eos.Actio } func (b *BIOS) inputGenesisData() (genesis *GenesisJSON) { - b.Log.Println("") - + zlog.Info("") for { - b.Log.Printf("Please input the genesis data of the network you want to join: ") + zlog.Info("Please input the genesis data of the network you want to join: ") genesisData, err := ScanSingleLine() if err != nil { - b.Log.Println("error reading:", err) + zlog.Error("error reading:", zap.Error(err)) continue } err = json.Unmarshal([]byte(genesisData), &genesis) if err != nil { - b.Log.Printf("Invalid genesis data: %s\n", err) + zlog.Error("Invalid genesis data", zap.Error(err)) continue } @@ -600,12 +595,12 @@ func readPrivKeyFromFile(filename string) (*ecc.PrivateKey, error) { func (b *BIOS) writeToFile(filename, content string) { fl, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600) if err != nil { - b.Log.Println("Unable to write to file", filename, err) + zlog.Info("Unable to write to file", zap.String("file_name", filename), zap.Error(err)) return } defer fl.Close() fl.Write([]byte(content)) - b.Log.Printf("Wrote file %q\n", filename) + zlog.Info("Wrote file", zap.String("file_name", filename)) } diff --git a/bios/contents.go b/bios/contents.go index 642b18b6..15aeb72c 100644 --- a/bios/contents.go +++ b/bios/contents.go @@ -12,6 +12,8 @@ import ( "os" "path/filepath" + "go.uber.org/zap" + "github.com/abourget/llerrgroup" ) @@ -65,18 +67,16 @@ func (b *BIOS) DownloadURL(ref string, hash string) error { } } - b.Log.Printf("Caching content from %q.\n", ref) + zlog.Info("Caching content.", zap.String("ref", ref)) if err := b.writeToCache(ref, cnt); err != nil { return err } - b.Log.Printf("- %q done\n", ref) - return nil } func (b *BIOS) downloadRef(ref string) ([]byte, error) { - b.Log.Printf("Downloading content from %q.\n", ref) + zlog.Info("Downloading content", zap.String("from", ref)) if _, err := os.Stat(ref); err == nil { return b.downloadLocalFile(ref) } diff --git a/bios/hooks.go b/bios/hooks.go index 225eb839..f14fe03b 100644 --- a/bios/hooks.go +++ b/bios/hooks.go @@ -4,6 +4,8 @@ import ( "fmt" "os" "os/exec" + + "go.uber.org/zap" ) func (b *BIOS) DispatchBootNode(genesisJSON, publicKey, privateKey string) error { @@ -16,7 +18,7 @@ func (b *BIOS) DispatchBootNode(genesisJSON, publicKey, privateKey string) error // dispatch to both exec calls, and remote web hooks. func (b *BIOS) dispatch(hookName string, args []string, f func() error) error { - b.Log.Printf("---- BEGIN HOOK %q ----\n", hookName) + zlog.Info("BEGIN", zap.String("hook", hookName)) executable := fmt.Sprintf("./%s.sh", hookName) @@ -33,7 +35,7 @@ func (b *BIOS) dispatch(hookName string, args []string, f func() error) error { return err } - b.Log.Printf("---- END HOOK %q ----\n", hookName) + zlog.Info("ENDED", zap.String("hook", hookName)) return nil } diff --git a/bios/logger.go b/bios/logger.go deleted file mode 100644 index f980f52a..00000000 --- a/bios/logger.go +++ /dev/null @@ -1,75 +0,0 @@ -package bios - -import ( - "fmt" - "io" - "log" - "os" - "strings" -) - -type Logger struct { - OutputFile io.Writer - OutputScreen io.Writer - Debug bool -} - -func NewLogger() *Logger { - fl, err := os.Create("output.log") - if err != nil { - log.Fatalln("Couldn't open output.log:", err) - } - - return &Logger{ - OutputFile: fl, - OutputScreen: os.Stdout, - } -} - -func (l *Logger) Debugln(args ...interface{}) { - if l == nil { - return - } - - if l.Debug { - fmt.Fprintln(l.OutputScreen, args...) - } - fmt.Fprintln(l.OutputFile, args...) -} - -func (l *Logger) Println(args ...interface{}) { - if l == nil { - return - } - - fmt.Fprintln(l.OutputScreen, args...) - fmt.Fprintln(l.OutputFile, args...) -} - -func (l *Logger) Debugf(format string, args ...interface{}) { - if l == nil { - return - } - - if l.Debug { - fmt.Fprintf(l.OutputScreen, format, args...) - } - - if !strings.HasSuffix(format, "\n") { - format = format + "\n" - } - fmt.Fprintf(l.OutputFile, format, args...) -} - -func (l *Logger) Printf(format string, args ...interface{}) { - if l == nil { - return - } - - fmt.Fprintf(l.OutputScreen, format, args...) - - if !strings.HasSuffix(format, "\n") { - format = format + "\n" - } - fmt.Fprintf(l.OutputFile, format, args...) -} diff --git a/bios/logging.go b/bios/logging.go new file mode 100644 index 00000000..f6fe776c --- /dev/null +++ b/bios/logging.go @@ -0,0 +1,12 @@ +package bios + +import ( + "github.com/dfuse-io/logging" + "go.uber.org/zap" +) + +var zlog *zap.Logger + +func init() { + logging.Register("github.com/eoscanada/eosc/bios", &zlog) +} diff --git a/bios/ops.go b/bios/ops.go index 0ecac62c..8154d999 100644 --- a/bios/ops.go +++ b/bios/ops.go @@ -6,6 +6,8 @@ import ( "fmt" "reflect" + "go.uber.org/zap" + eos "github.com/eoscanada/eos-go" "github.com/eoscanada/eos-go/ecc" "github.com/eoscanada/eos-go/system" @@ -30,6 +32,8 @@ var operationsRegistry = map[string]Operation{ "snapshot.load_unregistered": &OpInjectUnregdSnapshot{}, "system.resign_accounts": &OpResignAccounts{}, "system.create_voters": &OpCreateVoters{}, + "system.delegate_bw": &OpDelegateBW{}, + "system.buy_ram": &OpBuyRam{}, } type OperationType struct { @@ -121,9 +125,10 @@ func (op *OpSetRAM) Actions(b *BIOS) (out []*eos.Action, err error) { // type OpNewAccount struct { - Creator eos.AccountName - NewAccount eos.AccountName `json:"new_account"` - Pubkey string + Creator eos.AccountName + NewAccount eos.AccountName `json:"new_account"` + Pubkey string + RamEOSQuantity uint64 `json:"ram_eos_quantity"` } func (op *OpNewAccount) Actions(b *BIOS) (out []*eos.Action, err error) { @@ -135,8 +140,46 @@ func (op *OpNewAccount) Actions(b *BIOS) (out []*eos.Action, err error) { return nil, fmt.Errorf("reading pubkey: %s", err) } } + out = append(out, system.NewNewAccount(op.Creator, op.NewAccount, pubKey)) + + if op.RamEOSQuantity > 0 { + out = append(out, system.NewBuyRAM(op.Creator, op.NewAccount, op.RamEOSQuantity)) + } + + return out, nil +} + +type OpDelegateBW struct { + From eos.AccountName + To eos.AccountName + StakeCPU int64 `json:"stake_cpu"` + StakeNet int64 `json:"stake_net"` + Transfer bool +} - return append(out, system.NewNewAccount(op.Creator, op.NewAccount, pubKey)), nil +func (op *OpDelegateBW) Actions(b *BIOS) (out []*eos.Action, err error) { + return append(out, system.NewDelegateBW(op.From, op.To, eos.NewEOSAsset(op.StakeCPU), eos.NewEOSAsset(op.StakeNet), op.Transfer)), nil +} + +type OpBuyRam struct { + Payer eos.AccountName + Receiver eos.AccountName + EOSQuantity uint64 `json:"eos_quantity"` +} + +func (op *OpBuyRam) Actions(b *BIOS) (out []*eos.Action, err error) { + return append(out, system.NewBuyRAM(op.Payer, op.Receiver, op.EOSQuantity)), nil +} + +type OpTransfer struct { + From eos.AccountName + to eos.AccountName + Amount eos.Asset + Memo string +} + +func (op *OpTransfer) Actions(b *BIOS) (out []*eos.Action, err error) { + return append(out, token.NewTransfer(op.From, op.to, op.Amount, op.Memo)), nil } type OpCreateVoters struct { @@ -162,9 +205,7 @@ func (op *OpCreateVoters) Actions(b *BIOS) (out []*eos.Action, err error) { out = append(out, token.NewTransfer(op.Creator, voterName, eos.NewEOSAsset(1000000000), "")) out = append(out, system.NewBuyRAMBytes(AN("eosio"), voterName, 8192)) // 8kb gift ! out = append(out, system.NewDelegateBW(AN("eosio"), voterName, eos.NewEOSAsset(10000), eos.NewEOSAsset(10000), true)) - } - return } @@ -183,8 +224,6 @@ func (op *OpSetPriv) Actions(b *BIOS) (out []*eos.Action, err error) { return append(out, system.NewSetPriv(op.Account)), nil } -// - type OpCreateToken struct { Account eos.AccountName `json:"account"` Amount eos.Asset `json:"amount"` @@ -195,8 +234,6 @@ func (op *OpCreateToken) Actions(b *BIOS) (out []*eos.Action, err error) { return append(out, act), nil } -// - type OpIssueToken struct { Account eos.AccountName Amount eos.Asset @@ -254,7 +291,7 @@ func (op *OpSnapshotCreateAccounts) Actions(b *BIOS) (out []*eos.Action, err err for idx, hodler := range snapshotData { if trunc := op.TestnetTruncateSnapshot; trunc != 0 { if idx == trunc { - b.Log.Debugf("- DEBUG: truncated snapshot to %d rows\n", trunc) + zlog.Debug("truncated snapshot", zap.Int("at_row", trunc)) break } } @@ -337,7 +374,7 @@ func (op *OpInjectUnregdSnapshot) Actions(b *BIOS) (out []*eos.Action, err error for idx, hodler := range snapshotData { if trunc := op.TestnetTruncateSnapshot; trunc != 0 { if idx == trunc { - b.Log.Debugf("- DEBUG: truncated unreg'd snapshot to %d rows\n", trunc) + zlog.Debug("- DEBUG: truncated unreg'd snapshot", zap.Int("row", trunc)) break } } @@ -411,7 +448,7 @@ type OpResignAccounts struct { func (op *OpResignAccounts) Actions(b *BIOS) (out []*eos.Action, err error) { if op.TestnetKeepAccounts { - b.Log.Debugln("DEBUG: Keeping system accounts around, for testing purposes.") + zlog.Debug("Keeping system accounts around, for testing purposes.") return } diff --git a/eosc/cmd/boot.go b/eosc/cmd/boot.go index 74a9321a..20eee7c5 100644 --- a/eosc/cmd/boot.go +++ b/eosc/cmd/boot.go @@ -1,16 +1,19 @@ package cmd import ( + "fmt" "path/filepath" - eos "github.com/eoscanada/eos-go" + "github.com/dfuse-io/logging" + + "github.com/eoscanada/eos-go" "github.com/eoscanada/eosc/bios" - homedir "github.com/mitchellh/go-homedir" + "github.com/mitchellh/go-homedir" "github.com/spf13/cobra" "github.com/spf13/viper" ) -var bootCmd = &cobra.Command{ +var BootCmd = &cobra.Command{ Use: "boot [boot_sequence.yaml]", Short: "Boot a fresh network, using the now famous eos-bios.", Long: `Boot a fresh network, using the now famous eos-bios. @@ -23,13 +26,16 @@ to bootstrap your chain by running 'eosc boot'. `, Args: cobra.MaximumNArgs(1), Run: func(cmd *cobra.Command, args []string) { + fmt.Println("setting up logger") + zlog := logging.MustCreateLoggerWithServiceName("boot") + logging.Set(zlog) + + zlog.Info("Logger setup completed") + api := getAPI() attachWallet(api) - logger := bios.NewLogger() - logger.Debug = viper.GetBool("global-debug") - - b := bios.NewBIOS(logger, viper.GetString("boot-cmd-cache-path"), api) + b := bios.NewBIOS(viper.GetString("boot-cmd-cache-path"), api) b.WriteActions = viper.GetBool("boot-cmd-write-actions") b.HackVotingAccounts = viper.GetBool("boot-cmd-hack-voting-accounts") @@ -56,13 +62,13 @@ to bootstrap your chain by running 'eosc boot'. } func init() { - RootCmd.AddCommand(bootCmd) + RootCmd.AddCommand(BootCmd) homedir, err := homedir.Dir() errorCheck("couldn't find home dir", err) - bootCmd.Flags().BoolP("reuse-genesis", "", false, "Load genesis data from genesis.json, genesis.pub and genesis.key instead of creating a new one.") - bootCmd.Flags().StringP("cache-path", "", filepath.Join(homedir, ".eosc-boot-cache"), "directory to store downloaded contract and ABI data") - bootCmd.Flags().BoolP("hack-voting-accounts", "", false, "This will take accounts with large stakes and put a well known public key in place, so the community can test voting.") - bootCmd.Flags().BoolP("write-actions", "", false, "Write generated actions to actions.jsonl") + BootCmd.Flags().BoolP("reuse-genesis", "", false, "Load genesis data from genesis.json, genesis.pub and genesis.key instead of creating a new one.") + BootCmd.Flags().StringP("cache-path", "", filepath.Join(homedir, ".eosc-boot-cache"), "directory to store downloaded contract and ABI data") + BootCmd.Flags().BoolP("hack-voting-accounts", "", false, "This will take accounts with large stakes and put a well known public key in place, so the community can test voting.") + BootCmd.Flags().BoolP("write-actions", "", false, "Write generated actions to actions.jsonl") } diff --git a/go.mod b/go.mod index 706a54d5..c12292b2 100644 --- a/go.mod +++ b/go.mod @@ -1,18 +1,15 @@ module github.com/eoscanada/eosc require ( - cloud.google.com/go v0.0.0-20180703203520-c23afc06f115 // indirect - github.com/Jeffail/gabs v1.2.0 // indirect github.com/abourget/llerrgroup v0.0.0-20161118145731-75f536392d17 github.com/bronze1man/go-yaml2json v0.0.0-20150129175009-f6f64b738964 github.com/davecgh/go-spew v1.1.1 + github.com/dfuse-io/logging v0.0.0-20200417143534-5e26069a5e39 github.com/eoscanada/eos-go v0.9.1-0.20200227221642-1b19518201a1 github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 // indirect github.com/mitchellh/go-homedir v1.1.0 github.com/pborman/uuid v0.0.0-20180122190007-c65b2f87fee3 github.com/pkg/errors v0.8.1 - github.com/pquerna/ffjson v0.0.0-20181028064349-e517b90714f7 // indirect github.com/ryanuber/columnize v0.0.0-20170703205827-abc90934186a github.com/spf13/cobra v0.0.4-0.20190109003409-7547e83b2d85 github.com/spf13/pflag v1.0.3 @@ -20,12 +17,10 @@ require ( github.com/stretchr/testify v1.4.0 github.com/tidwall/gjson v1.3.2 github.com/tidwall/sjson v1.0.4 - go.uber.org/zap v1.10.0 + go.uber.org/zap v1.14.0 golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc - golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890 - golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect - google.golang.org/api v0.0.0-20180702000508-e0f3bfad2532 - google.golang.org/appengine v0.0.0-20150527042145-b667a5000b08 // indirect + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 + google.golang.org/api v0.7.0 gopkg.in/olivere/elastic.v3 v3.0.75 ) diff --git a/go.sum b/go.sum index 4feb211f..6be12cc0 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,10 @@ -cloud.google.com/go v0.0.0-20180703203520-c23afc06f115 h1:VykTuB+lRMLiY/0WmMCGAXVCnnue76gMNxK37HD8VpY= -cloud.google.com/go v0.0.0-20180703203520-c23afc06f115/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.43.0 h1:banaiRPAM8kUVYneOSkhgcDsLzEvL25FinuiSZaH/2w= +cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= +contrib.go.opencensus.io/exporter/stackdriver v0.12.6 h1:Y2FTyj0HgOhfjEW6D6ytZNoz1YcPDXmkKr1I478CWKs= +contrib.go.opencensus.io/exporter/stackdriver v0.12.6/go.mod h1:8x999/OcIPy5ivx/wDiV7Gx4D+VUPODf0mWRGRc5kSk= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= @@ -15,8 +20,7 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Jeffail/gabs v1.2.0 h1:uFhoIVTtsX7hV2RxNgWad8gMU+8OJdzFbOathJdhD3o= -github.com/Jeffail/gabs v1.2.0/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= @@ -28,14 +32,19 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/blendle/zapdriver v1.3.1 h1:C3dydBOWYRiOk+B8X9IVZ5IOe+7cl+tGOexN4QqHfpE= +github.com/blendle/zapdriver v1.3.1/go.mod h1:mdXfREi6u5MArG4j9fewC+FGnXaBR+T4Ox4J2u4eHCc= github.com/bronze1man/go-yaml2json v0.0.0-20150129175009-f6f64b738964 h1:YtNfk92cLL9IKGS7pNxnxN4OXWw5S2efi9/6jcwzTdY= github.com/bronze1man/go-yaml2json v0.0.0-20150129175009-f6f64b738964/go.mod h1:E/+SgS+fFbSMoTIuQxgvi6cvcxmr8v7WGTi2EhNkLy4= github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -45,23 +54,13 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/dfuse-io/logging v0.0.0-20200417143534-5e26069a5e39 h1:vQL3ZKf3mUWvp4hdqCKYJ3J80lshaS/DYE2pB24hWOQ= +github.com/dfuse-io/logging v0.0.0-20200417143534-5e26069a5e39/go.mod h1:80YyilHcgoqrnoIeeJKgcsOw6Y/0/bQzDO/XzNIrIdM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elastic/gosigar v0.8.1-0.20180330100440-37f05ff46ffa/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= -github.com/eoscanada/eos-bios v1.2.0 h1:h2PC3rbOCvPVkq6+RapwUGKn0wZ41ScJmHHTwdDKfo4= -github.com/eoscanada/eos-bios v1.2.0/go.mod h1:64+2vEnagr6kY1QgIexkeOXPEXn4yeLDiluCzQ2B9dY= -github.com/eoscanada/eos-go v0.8.13 h1:2U6a+cj+VygmcrKP8Y2op1qukynXUTfhyhKrysjPmsY= -github.com/eoscanada/eos-go v0.8.13/go.mod h1:RKrm2XzZEZWxSMTRqH5QOyJ1fb/qKEjs2ix1aQl0sk4= -github.com/eoscanada/eos-go v0.8.14-0.20190614154328-0014a42badb5 h1:6Y6xlTLOaY7Uzb/aarC4hpqkztamhpyX8ELGXFRre00= -github.com/eoscanada/eos-go v0.8.14-0.20190614154328-0014a42badb5/go.mod h1:RKrm2XzZEZWxSMTRqH5QOyJ1fb/qKEjs2ix1aQl0sk4= -github.com/eoscanada/eos-go v0.8.16-0.20190628070134-3da66e8f192f h1:xYUwaaX306tPPBeLRIq7vDQv/TLAunkBbeWIlB7EaCI= -github.com/eoscanada/eos-go v0.8.16-0.20190628070134-3da66e8f192f/go.mod h1:RKrm2XzZEZWxSMTRqH5QOyJ1fb/qKEjs2ix1aQl0sk4= -github.com/eoscanada/eos-go v0.8.17-0.20200115162744-95d41034f411 h1:m/xXUdfyhPfKwwvBXikskUcJzb17rYEncukG6v2EXrI= -github.com/eoscanada/eos-go v0.8.17-0.20200115162744-95d41034f411/go.mod h1:xm6f43hsj422MU47YUqmxwXCFOoK825iAdvYaDSou3s= -github.com/eoscanada/eos-go v0.9.0 h1:8Ko4/6lwn3KwbbDuaUB3p02OzbQVZVdxbp6noPChIkc= -github.com/eoscanada/eos-go v0.9.0/go.mod h1:6RuJFiRU1figWZ39M33o2cERU2MdL6VllElYLHTZNeo= github.com/eoscanada/eos-go v0.9.1-0.20200227221642-1b19518201a1 h1:xZohJqmRbCFOdmdO8FnSMxMd33Q+ryVraPZWRJHq8YY= github.com/eoscanada/eos-go v0.9.1-0.20200227221642-1b19518201a1/go.mod h1:6RuJFiRU1figWZ39M33o2cERU2MdL6VllElYLHTZNeo= github.com/ethereum/go-ethereum v1.9.9/go.mod h1:a9TqabFudpDu1nucId+k9S8R9whYaHnGBLKFouA5EAo= @@ -75,15 +74,38 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c h1:zqAKixg3cTcIasAMJV+EcfVbWwLpOZ7LeoWJvcuD/5Q= github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -92,17 +114,20 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 h1:wL11wNW7dhKIcRCHSm4sHKPWz0tt4mwBsVodG7+Xyqg= -github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= @@ -129,15 +154,11 @@ github.com/pborman/uuid v0.0.0-20180122190007-c65b2f87fee3/go.mod h1:VyrYX9gd7ir github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/pkg/errors v0.0.0-20180311214515-816c9085562c h1:F5RoIh7F9wB47PvXvpP1+Ihq1TkyC8iRdvwfKkESEZQ= -github.com/pkg/errors v0.0.0-20180311214515-816c9085562c/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pquerna/ffjson v0.0.0-20181028064349-e517b90714f7 h1:gGBSHPOU7g8YjTbhwn+lvFm2VDEhhA+PwDIlstkgSxE= -github.com/pquerna/ffjson v0.0.0-20181028064349-e517b90714f7/go.mod h1:YARuvh7BUWHNhzDq2OM5tzR2RiCcN2D7sapiKyCel/M= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= @@ -145,6 +166,7 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/robertkrimen/otto v0.0.0-20170205013659-6a77b7cbc37d/go.mod h1:xvqspoSXJTIpemEonrMDFq6XzwHYYgToXWj5eRX1OtY= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -175,18 +197,14 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= -github.com/tidwall/gjson v1.1.3 h1:u4mspaByxY+Qk4U1QYYVzGFI8qxN/3jtEV0ZDb2vRic= -github.com/tidwall/gjson v1.1.3/go.mod h1:c/nTNbUr0E0OrXEhq1pwa8iEgc2DOt4ZZqAt1HtCkPA= +github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf h1:Z2X3Os7oRzpdJ75iPqWZc0HeJWFYNCvKsfpQwFpRNTA= +github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0= github.com/tidwall/gjson v1.3.2 h1:+7p3qQFaH3fOMXAJSrdZwGKcOO/lYdGS0HqGhPqDdTI= github.com/tidwall/gjson v1.3.2/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= -github.com/tidwall/match v1.0.0 h1:Ym1EcFkp+UQ4ptxfWlW+iMdq5cPH5nEuGzdf/Pb7VmI= -github.com/tidwall/match v1.0.0/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc= github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/sjson v1.0.0 h1:hOrzQPtGKlKAudQVmU43GkxEgG8TOgKyiKUyb7sE0rs= -github.com/tidwall/sjson v1.0.0/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y= github.com/tidwall/sjson v1.0.4 h1:UcdIRXff12Lpnu3OLtZvnc03g4vH2suXDXhBwBqmzYg= github.com/tidwall/sjson v1.0.4/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= @@ -194,62 +212,134 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.1 h1:8dP3SGL7MPB94crU3bEPplMPe83FI4EouesJUeFHv50= +go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.2.0 h1:6I+W7f5VwC5SV9dNrZ3qXrDB9mD0dyGOi/ZJmYw03T4= go.uber.org/multierr v1.2.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.9.1 h1:XCJQEf3W6eZaVwhRBof6ImoYGJSITeKWsyeh3HFu/5o= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.14.0 h1:/pduUoebOeeJzTDFuoMgC6nRkiasr1sBCIEorly7m4o= +go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613 h1:MQ/ZZiDsUapFFiMS+vzwXkCTeEKaum+Do5rINYJDmxc= -golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc h1:c0o/qxkaO2LF5t6fQrT4b5hzyggAkLLlCUjqfRxd8Q4= golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890 h1:uESlIz09WIHT2I+pasSXcpLYqYK8wHcdCetU3VuMBJE= -golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190108104531-7fbe1cd0fcc2 h1:ku9Kvp2ZBWAz3GyvuUH3UV1bZCd7RxH0Qf1epWfIDKc= -golang.org/x/sys v0.0.0-20190108104531-7fbe1cd0fcc2/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 h1:LepdCS8Gf/MVejFIt8lsiexZATdoGVyp5bcyS+rYoUI= golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa h1:KIDDMLT1O0Nr7TSxp8xM5tJcdn8tgyAONntO829og1M= +golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -google.golang.org/api v0.0.0-20180702000508-e0f3bfad2532 h1:HyNvwUYLnk+I2LJQ6kSjG75L7pQhI8LNuNWZb4NjJY0= -google.golang.org/api v0.0.0-20180702000508-e0f3bfad2532/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/appengine v0.0.0-20150527042145-b667a5000b08 h1:Qnaqz3ZLPwNGHxLXwul5jgRiNjuqaInjCLG60Ka/q5Y= -google.golang.org/appengine v0.0.0-20150527042145-b667a5000b08/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0 h1:9sdfJOzWlkqPltHAuzT2Cp+yrBeY1KRVYgms8soxMwM= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 h1:iKtrH9Y8mcbADOP0YFaEMth7OfuHY9xHOwNj4znpM1A= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1 h1:/7cs52RnTJmD43s3uxzlq2U7nqVTd/37viQwMrMNlOM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190213234257-ec84240a7772/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= @@ -262,3 +352,10 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From 1f974566a7e4b0ae6ff66a46a075db32c8c230c3 Mon Sep 17 00:00:00 2001 From: billettc Date: Mon, 1 Jun 2020 10:27:06 -0400 Subject: [PATCH 2/5] export SystemSetcontractCmd --- eosc/cmd/systemSetcontract.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eosc/cmd/systemSetcontract.go b/eosc/cmd/systemSetcontract.go index decc7ebd..032124d8 100644 --- a/eosc/cmd/systemSetcontract.go +++ b/eosc/cmd/systemSetcontract.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/cobra" ) -var systemSetcontractCmd = &cobra.Command{ +var SystemSetcontractCmd = &cobra.Command{ Use: "setcontract [account name] [wasm file] [abi file]", Short: "Set both code and ABI on an account.", Args: cobra.ExactArgs(3), @@ -28,5 +28,5 @@ var systemSetcontractCmd = &cobra.Command{ } func init() { - systemCmd.AddCommand(systemSetcontractCmd) + systemCmd.AddCommand(SystemSetcontractCmd) } From f62c425eecb9e9b7ca0a21ac003fdde9a17f8c5c Mon Sep 17 00:00:00 2001 From: billettc Date: Mon, 1 Jun 2020 10:58:38 -0400 Subject: [PATCH 3/5] export TxPushCmd --- eosc/cmd/txPush.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eosc/cmd/txPush.go b/eosc/cmd/txPush.go index 9e0955a8..d1772183 100644 --- a/eosc/cmd/txPush.go +++ b/eosc/cmd/txPush.go @@ -17,7 +17,7 @@ import ( "github.com/tidwall/gjson" ) -var txPushCmd = &cobra.Command{ +var TxPushCmd = &cobra.Command{ Use: "push [transaction.json | string]", Short: "Push a signed transaction to the chain. Must be done online.", Long: ` @@ -83,5 +83,5 @@ func looksLikeTransactionJSON(input string) bool { } func init() { - txCmd.AddCommand(txPushCmd) + txCmd.AddCommand(TxPushCmd) } From e590aa7a3a4908f2ef32acf331edf22959a51539 Mon Sep 17 00:00:00 2001 From: billettc Date: Mon, 1 Jun 2020 11:13:15 -0400 Subject: [PATCH 4/5] export TxCreateCmd --- eosc/cmd/txCreate.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eosc/cmd/txCreate.go b/eosc/cmd/txCreate.go index d056a20b..c02defb6 100644 --- a/eosc/cmd/txCreate.go +++ b/eosc/cmd/txCreate.go @@ -15,7 +15,7 @@ import ( "github.com/spf13/viper" ) -var txCreateCmd = &cobra.Command{ +var TxCreateCmd = &cobra.Command{ Use: "create [contract] [action] [payload]", Short: "Create a transaction with a single action", Args: cobra.ExactArgs(3), @@ -73,7 +73,7 @@ func generateRandomNonce() []byte { } func init() { - txCmd.AddCommand(txCreateCmd) + txCmd.AddCommand(TxCreateCmd) - txCreateCmd.Flags().BoolP("force-unique", "f", false, "force the transaction to be unique. this will consume extra bandwidth and remove any protections against accidently issuing the same transaction multiple times") + TxCreateCmd.Flags().BoolP("force-unique", "f", false, "force the transaction to be unique. this will consume extra bandwidth and remove any protections against accidently issuing the same transaction multiple times") } From d642b582af4fc722bccdac9442158d564956a4b9 Mon Sep 17 00:00:00 2001 From: billettc Date: Fri, 5 Jun 2020 07:10:13 -0400 Subject: [PATCH 5/5] added buy_ram_bytes --- bios/ops.go | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/bios/ops.go b/bios/ops.go index 8154d999..6676292b 100644 --- a/bios/ops.go +++ b/bios/ops.go @@ -34,6 +34,7 @@ var operationsRegistry = map[string]Operation{ "system.create_voters": &OpCreateVoters{}, "system.delegate_bw": &OpDelegateBW{}, "system.buy_ram": &OpBuyRam{}, + "system.buy_ram_bytes": &OpBuyRamBytes{}, } type OperationType struct { @@ -125,10 +126,10 @@ func (op *OpSetRAM) Actions(b *BIOS) (out []*eos.Action, err error) { // type OpNewAccount struct { - Creator eos.AccountName - NewAccount eos.AccountName `json:"new_account"` - Pubkey string - RamEOSQuantity uint64 `json:"ram_eos_quantity"` + Creator eos.AccountName + NewAccount eos.AccountName `json:"new_account"` + Pubkey string + RamBytes uint32 `json:"ram_bytes"` } func (op *OpNewAccount) Actions(b *BIOS) (out []*eos.Action, err error) { @@ -142,8 +143,8 @@ func (op *OpNewAccount) Actions(b *BIOS) (out []*eos.Action, err error) { } out = append(out, system.NewNewAccount(op.Creator, op.NewAccount, pubKey)) - if op.RamEOSQuantity > 0 { - out = append(out, system.NewBuyRAM(op.Creator, op.NewAccount, op.RamEOSQuantity)) + if op.RamBytes > 0 { + out = append(out, system.NewBuyRAMBytes(op.Creator, op.NewAccount, op.RamBytes)) } return out, nil @@ -171,6 +172,16 @@ func (op *OpBuyRam) Actions(b *BIOS) (out []*eos.Action, err error) { return append(out, system.NewBuyRAM(op.Payer, op.Receiver, op.EOSQuantity)), nil } +type OpBuyRamBytes struct { + Payer eos.AccountName + Receiver eos.AccountName + Bytes uint32 +} + +func (op *OpBuyRamBytes) Actions(b *BIOS) (out []*eos.Action, err error) { + return append(out, system.NewBuyRAMBytes(op.Payer, op.Receiver, op.Bytes)), nil +} + type OpTransfer struct { From eos.AccountName to eos.AccountName