iwallet

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2018 License: LGPL-3.0 Imports: 22 Imported by: 4

README

A brief introduction for iwallet
-How to use iwallet?
the first thing you should do is to read this document.and if you meet some diffcuties in using iwallet,please use -h parameter with no hesitation.
for example:iwallet -h , iwallet account -h .there is a -h parameter for each subcommand too.

-How to generate an account?
iwallet account -n filename
this command create a pair of sec-key and pub-key in the files ~/.iwallet/filename_ed25519 and ~/.iwallet/filename_ed25519.pub.and this command return the corresponding iost account ID,please keep it.

-How to deploy a contract?
(1)If you want to deploy a contract to the iost blockchain,use the subcommand compile,if you don't have a iost account,please generate an account first with the command account and ensure this account can afford the fee of deploying your contract(typically it equals to the gas cost for deployment),it's a small amount normally.
(2)Use the subcommand compile to generate the tx,there are two situations:
	1)if you don't include --signers in subcommand compile,iwallet thinks this tx doesn't need any other signatures except the publisher for this tx(the publisher means the signature of the person who create this tx,every tx has a publisher).So it send the generated tx to the iost node you indicated(you can specify the destination with -s,see iwallet -h for more information) directly.
	2)if you indicate --signers,then the subcommand compile will save the unsigned tx to a .sc file.
(3)if it's 2) in step (2),send the .sc file to signers you indicate in --signers,then they should sign this contract with the subcommand sign.the subcommand sign generate the corresponding .sig file which is the signature you need.After collecting all the .sig files from the signers,we advance to (4).
(4)use the subcommand publish to merge all the signatures to the unsigned tx,and sign the tx with -k,iwallet publish will send the tx to the iost node you indicate with -s ip:port(port is typically 30002),it's localhost:30002 by default.

-How to call a method(function) in a deployed contract which is on the blockchain?
the steps are similar to deploying a contract.get more info from iwallet call -h.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func NewAction added in v1.1.0

func NewAction(contract string, name string, data string) *rpcpb.Action

NewAction ...

Types

type SDK added in v1.1.0

type SDK struct {
	// contains filtered or unexported fields
}

SDK ...

func (*SDK) CreateNewAccount added in v1.1.0

func (s *SDK) CreateNewAccount(newID string, newKp *account.KeyPair, initialGasPledge int64, initialRAM int64, initialCoins int64) error

CreateNewAccount ...

func (*SDK) GetContractStorage added in v1.1.0

func (s *SDK) GetContractStorage(r *rpcpb.GetContractStorageRequest) (*rpcpb.GetContractStorageResponse, error)

GetContractStorage ...

func (*SDK) GetTxReceiptByTxHash added in v1.1.0

func (s *SDK) GetTxReceiptByTxHash(txHashStr string) (*rpcpb.TxReceipt, error)

GetTxReceiptByTxHash ...

func (*SDK) PledgeForGasAndRAM added in v1.1.0

func (s *SDK) PledgeForGasAndRAM(gasPledged int64, ram int64) error

PledgeForGasAndRAM ...

func (*SDK) PublishContract added in v1.1.0

func (s *SDK) PublishContract(codePath string, abiPath string, conID string, update bool, updateID string) (stx *rpcpb.TransactionRequest, txHash string, err error)

PublishContract converts contract js code to transaction. If 'send', also send it to chain.

func (*SDK) SetAccount added in v1.1.0

func (s *SDK) SetAccount(name string, kp *account.KeyPair)

SetAccount ...

func (*SDK) SetCheckResult added in v1.1.0

func (s *SDK) SetCheckResult(checkResult bool, checkResultDelay float32, checkResultMaxRetry int32)

SetCheckResult ...

func (*SDK) SetServer added in v1.1.0

func (s *SDK) SetServer(server string)

SetServer ...

func (*SDK) SetTxInfo added in v1.1.0

func (s *SDK) SetTxInfo(gasLimit float64, gasRatio float64, expiration int64, delaySecond int64)

SetTxInfo ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL