From 8d2e9b68bfd823e68256c773deb7a72281075d1e Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 24 Jul 2020 16:30:38 +0300 Subject: [PATCH 1/2] docker: fix privnet node config and compose file --- .docker/docker-compose.yml | 2 +- config/protocol.privnet.docker.single.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index 82b5e8f98..8102ef9a3 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -79,7 +79,7 @@ services: command: "node --config-path /config --privnet" volumes: - ../config/protocol.privnet.docker.single.yml:/config/protocol.privnet.yml - - ./wallets/wallet1.json:/wallet1.json + - ./wallets/wallet1_solo.json:/wallet1.json - volume_chain:/chains networks: neo_go_network: diff --git a/config/protocol.privnet.docker.single.yml b/config/protocol.privnet.docker.single.yml index ed03d2dca..e836404fb 100644 --- a/config/protocol.privnet.docker.single.yml +++ b/config/protocol.privnet.docker.single.yml @@ -39,6 +39,7 @@ ApplicationConfiguration: RPC: Enabled: true EnableCORSWorkaround: false + MaxGasInvoke: 10 Port: 30333 Prometheus: Enabled: true From e013477bc9500e34657178e1466f52ed18224e0b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 24 Jul 2020 16:34:46 +0300 Subject: [PATCH 2/2] rpc,cli: support multitransfer transactions Allow to transfer single asset to multiple recepients in a single transaction. It is currently a separate command in CLI and can be merged in future. --- cli/wallet/nep5.go | 110 ++++++++++++++++++++++++++++++++++++----- pkg/rpc/client/nep5.go | 38 ++++++++++++-- 2 files changed, 131 insertions(+), 17 deletions(-) diff --git a/cli/wallet/nep5.go b/cli/wallet/nep5.go index da9f9c3c2..67c3d0c11 100644 --- a/cli/wallet/nep5.go +++ b/cli/wallet/nep5.go @@ -25,17 +25,25 @@ var ( gasToken = wallet.NewToken(client.GasContractHash, "GAS", "gas", 8) ) +var ( + tokenFlag = cli.StringFlag{ + Name: "token", + Usage: "Token to use", + } + gasFlag = flags.Fixed8Flag{ + Name: "gas", + Usage: "Amount of GAS to attach to a tx", + } +) + func newNEP5Commands() []cli.Command { balanceFlags := []cli.Flag{ walletPathFlag, + tokenFlag, cli.StringFlag{ Name: "addr", Usage: "Address to use", }, - cli.StringFlag{ - Name: "token", - Usage: "Token to use", - }, } balanceFlags = append(balanceFlags, options.RPC...) importFlags := []cli.Flag{ @@ -51,20 +59,22 @@ func newNEP5Commands() []cli.Command { outFlag, fromAddrFlag, toAddrFlag, - cli.StringFlag{ - Name: "token", - Usage: "Token to use", - }, + tokenFlag, + gasFlag, cli.StringFlag{ Name: "amount", Usage: "Amount of asset to send", }, - flags.Fixed8Flag{ - Name: "gas", - Usage: "Amount of GAS to attach to a tx", - }, } transferFlags = append(transferFlags, options.RPC...) + multiTransferFlags := []cli.Flag{ + walletPathFlag, + outFlag, + fromAddrFlag, + tokenFlag, + gasFlag, + } + multiTransferFlags = append(multiTransferFlags, options.RPC...) return []cli.Command{ { Name: "balance", @@ -114,6 +124,14 @@ func newNEP5Commands() []cli.Command { Action: transferNEP5, Flags: transferFlags, }, + { + Name: "multitransfer", + Usage: "transfer NEP5 tokens to multiple recepients", + UsageText: `multitransfer --wallet --rpc-endpoint --timeout