Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RpcCmd = &cobra.Command{ Use: "rpc URL method param_0 param_1 ... param_n", Short: "Wrapper for making RPC requests.", Long: usage, RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() ec, err := ethrpc.DialContext(ctx, args[0]) if err != nil { return err } params := toGenericParams(args[2:]) var res = new(json.RawMessage) err = ec.Call(res, args[1], params...) if err != nil { return err } body, err := res.MarshalJSON() if err != nil { fmt.Println("gyahhhhhhhh1") return err } fmt.Println(string(body)) return nil }, Args: func(cmd *cobra.Command, args []string) error { if len(args) < 2 { return fmt.Errorf("rpc needs at least two arguments. A URL and a method") } _, err := url.Parse(args[0]) if err != nil { return err } return nil }, }
rpcCmd represents the rpc command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.