Documentation
¶
Index ¶
- Variables
- func EncodeKey(k []byte) string
- func GenerateKey() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func GenerateKeyEncoded() (string, string, error)
- func GetObjectByHash(ctx context.Context, rpcURL, hash string, dst interface{}) error
- func GetObjectBytesByHash(ctx context.Context, rpcURL, hash string) ([]byte, error)
- func GetState(ctx context.Context, rpcURL, address string) (*models.StateMessage, error)
- func PrivateKeyFromHashed(ctx context.Context, privateKey string) (ed25519.PrivateKey, error)
- func PublicKeyFromPrivate(ctx context.Context, privateKey string) (string, error)
- func Publish(ctx context.Context, rpcURL string, msg *models.BroadcastMsg) error
- func Sign(ctx context.Context, privateKey string, toSign interface{}) (string, error)
- func SignWithPK(ctx context.Context, pk ed25519.PrivateKey, toSign interface{}) (string, error)
- func SubmitTx(ctx context.Context, rpcURL, privateKey string, amount decimal.Decimal, ...) (*models.Transaction, error)
- func Verify(ctx context.Context, publicKey string, jws string) ([]byte, error)
- func VerifyTx(ctx context.Context, jws string) (*models.Transaction, error)
- type Client
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // The latency in milliseconds MLatencyMs = stats.Float64("tx/submit/latency", "The latency in milliseconds per submit", "ms") // Counts/groups the lengths of lines read in. MLineLengths = stats.Int64("tx/submit/abc", "The distribution of line lengths", "By") )
View Source
var (
KeyMethod, _ = tag.NewKey("method")
KeyStatus, _ = tag.NewKey("status")
KeyError, _ = tag.NewKey("error")
)
View Source
var ( LatencyView = &view.View{ Name: "demo/latency", Measure: MLatencyMs, Description: "The distribution of the latencies", Aggregation: view.Distribution(0, 25, 50, 75, 100, 200, 400, 600, 800, 1000, 2000, 4000, 6000), TagKeys: []tag.Key{KeyMethod}} )
Functions ¶
func GenerateKey ¶
func GenerateKey() (ed25519.PublicKey, ed25519.PrivateKey, error)
func GenerateKeyEncoded ¶
GenerateKeyEncoded returns public key, private key, error
func GetObjectByHash ¶
GetObjectByHash this gets an object by it's content hash. Very similar to IPFS.
func GetObjectBytesByHash ¶
GetObjectByHash this gets an object by it's content hash. Very similar to IPFS.
func PrivateKeyFromHashed ¶
func PublicKeyFromPrivate ¶
func SignWithPK ¶
Types ¶
type Client ¶
type Client interface { // SendTransaction ... SendTransaction(ctx context.Context, t *models.Transaction) error // SendRawTransaction sends the signed raw transaction bytes. SendRawTransaction(ctx context.Context, tx []byte) error // // Call executes a call without submitting a transaction. // Call(ctx context.Context, msg CallMsg) ([]byte, error) Close() }
Client is an interface for the web3 RPC API.
Click to show internal directories.
Click to hide internal directories.