burrow, Execution Contexts

SendTx

Tansfer tokens to destination.

github.com/hyperledger/burrow/execution/contexts.(*SendContext).Execute at send_context.go:22
github.com/hyperledger/burrow/execution.(*executor).Execute at execution.go:254
github.com/hyperledger/burrow/consensus/abci.ExecuteTx at execute_tx.go:30
github.com/hyperledger/burrow/consensus/abci.(*App).CheckTx at app.go:189
github.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync at local_client.go:99
github.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync at app_conn.go:114
github.com/tendermint/tendermint/mempool.(*CListMempool).CheckTx at clist_mempool.go:281
github.com/tendermint/tendermint/mempool.Mempool.CheckTx-fm at mempool.go:18
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxAsyncRaw at transactor.go:237
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSyncRaw at transactor.go:206
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSync at transactor.go:134
github.com/hyperledger/burrow/execution.(*Transactor).BroadcastTxSync at transactor.go:83
github.com/hyperledger/burrow/rpc/rpctransact.(*transactServer).BroadcastTxSync at transact_server.go:55
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler.func1 at rpctransact.pb.go:505
github.com/hyperledger/burrow/rpc.unaryInterceptor.func1 at grpc.go:29
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler at rpctransact.pb.go:507
google.golang.org/grpc.(*Server).processUnaryRPC at server.go:1024
google.golang.org/grpc.(*Server).handleStream at server.go:1313
google.golang.org/grpc.(*Server).serveStreams.func1.1 at server.go:722
runtime.goexit at asm_amd64.s:1357
 - Async stack trace
google.golang.org/grpc.(*Server).serveStreams.func1 at server.go:720

Job

jobs:


- name: sendTxTest1
  send:
      destination: 722ECB9236FFFD90304FC67D77652B476E19853D
      amount: 999


Sample

{
  "SendTx": {
    "Inputs": [
      {
        "Address": "D96DCA9368CADBF5F8813EEFD35C9E228E7F8B21",
        "Amount": 10000
      }
    ],
    "Outputs": [
      {
        "Address": "5F4852C172066A2AFAABF01FB2B86067B7148DC8",
        "Amount": 10000
      }
    ]
  }
}

NameTx

To store a name entry to StateDB

type Entry struct {
	// registered name for the entry
	Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	// address that created the entry
	Owner github_com_hyperledger_burrow_crypto.Address `protobuf:"bytes,2,opt,name=Owner,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:"Owner"`
	// data to store under this name
	Data string `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"`
	// block at which this entry expires
	Expires              uint64   `protobuf:"varint,4,opt,name=Expires,proto3" json:"Expires,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}
github.com/hyperledger/burrow/execution/contexts.(*NameContext).Execute at name_context.go:32
github.com/hyperledger/burrow/execution.(*executor).Execute at execution.go:254
github.com/hyperledger/burrow/consensus/abci.ExecuteTx at execute_tx.go:30
github.com/hyperledger/burrow/consensus/abci.(*App).CheckTx at app.go:189
github.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync at local_client.go:99
github.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync at app_conn.go:114
github.com/tendermint/tendermint/mempool.(*CListMempool).CheckTx at clist_mempool.go:281
github.com/tendermint/tendermint/mempool.Mempool.CheckTx-fm at mempool.go:18
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxAsyncRaw at transactor.go:237
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSyncRaw at transactor.go:206
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSync at transactor.go:134
github.com/hyperledger/burrow/execution.(*Transactor).BroadcastTxSync at transactor.go:83
github.com/hyperledger/burrow/rpc/rpctransact.(*transactServer).BroadcastTxSync at transact_server.go:55
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler.func1 at rpctransact.pb.go:505
github.com/hyperledger/burrow/rpc.unaryInterceptor.func1 at grpc.go:29
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler at rpctransact.pb.go:507
google.golang.org/grpc.(*Server).processUnaryRPC at server.go:1024
google.golang.org/grpc.(*Server).handleStream at server.go:1313
google.golang.org/grpc.(*Server).serveStreams.func1.1 at server.go:722
runtime.goexit at asm_amd64.s:1357
 - Async stack trace
google.golang.org/grpc.(*Server).serveStreams.func1 at server.go:720

Job

jobs:

- name: val1
  set:
      val: "xjw"
      
- name: val2
  set:
      val: "testdata"      

- name: to_save
  set:
      val: 5000

- name: MinersFee
  set:
      val: 1

- name: nameRegTest1
  register:
      name: $val1
      data: $val2
      amount: $to_save
      fee: $MinersFee

- name: queryReg1
  query-name:
      name: $val1
      field: data

- name: nameRegAssert1
  assert:
      key: $queryReg1
      relation: eq
      val: $val2

Sample

{
	NameTx,
		Payload:{
			Input:{
				Address:D96DCA9368CADBF5F8813EEFD35C9E228E7F8B21,
				Amount:5000,
				Sequence:41
			},
			Name:			eris_loves,
			Data:			marmots,
			Fee:			1234
		}
}

PermsTx

Manage permissions of account.

github.com/hyperledger/burrow/execution/contexts.(*PermissionsContext).Execute at permissions_context.go:24
github.com/hyperledger/burrow/execution.(*executor).Execute at execution.go:254
github.com/hyperledger/burrow/consensus/abci.ExecuteTx at execute_tx.go:30
github.com/hyperledger/burrow/consensus/abci.(*App).CheckTx at app.go:189
github.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync at local_client.go:99
github.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync at app_conn.go:114
github.com/tendermint/tendermint/mempool.(*CListMempool).CheckTx at clist_mempool.go:281
github.com/tendermint/tendermint/mempool.Mempool.CheckTx-fm at mempool.go:18
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxAsyncRaw at transactor.go:237
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSyncRaw at transactor.go:206
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSync at transactor.go:134
github.com/hyperledger/burrow/execution.(*Transactor).BroadcastTxSync at transactor.go:83
github.com/hyperledger/burrow/rpc/rpctransact.(*transactServer).BroadcastTxSync at transact_server.go:55
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler.func1 at rpctransact.pb.go:505
github.com/hyperledger/burrow/rpc.unaryInterceptor.func1 at grpc.go:29
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler at rpctransact.pb.go:507
google.golang.org/grpc.(*Server).processUnaryRPC at server.go:1024
google.golang.org/grpc.(*Server).handleStream at server.go:1313
google.golang.org/grpc.(*Server).serveStreams.func1.1 at server.go:722
runtime.goexit at asm_amd64.s:1357
 - Async stack trace
google.golang.org/grpc.(*Server).serveStreams.func1 at server.go:720

Job

jobs:

- name: perm
  set:
      val: call

- name: role
  set:
      val: 1234

- name: permTest1
  permission:
      action: setBase
      target: $key2
      permission: $perm
      value: "true"

Sample

{
	PermsTx,
		Payload:
		{
			Input:
			{
				Address:D96DCA9368CADBF5F8813EEFD35C9E228E7F8B21,
				Sequence:51
			},
			PermArgs:
			{
				Action:setGlobal,
				Permission:call,
				Value:true
			}
		}
	}
}

CallTx

Call smart contacts.

github.com/hyperledger/burrow/execution/contexts.(*CallContext).Execute at call_context.go:36
github.com/hyperledger/burrow/execution.(*executor).Execute at execution.go:254
github.com/hyperledger/burrow/consensus/abci.ExecuteTx at execute_tx.go:30
github.com/hyperledger/burrow/consensus/abci.(*App).CheckTx at app.go:189
github.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync at local_client.go:99
github.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync at app_conn.go:114
github.com/tendermint/tendermint/mempool.(*CListMempool).CheckTx at clist_mempool.go:281
github.com/tendermint/tendermint/mempool.Mempool.CheckTx-fm at mempool.go:18
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxAsyncRaw at transactor.go:237
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSyncRaw at transactor.go:206
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSync at transactor.go:134
github.com/hyperledger/burrow/execution.(*Transactor).BroadcastTxSync at transactor.go:83
github.com/hyperledger/burrow/rpc/rpctransact.(*transactServer).BroadcastTxSync at transact_server.go:55
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler.func1 at rpctransact.pb.go:505
github.com/hyperledger/burrow/rpc.unaryInterceptor.func1 at grpc.go:29
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler at rpctransact.pb.go:507
google.golang.org/grpc.(*Server).processUnaryRPC at server.go:1024
google.golang.org/grpc.(*Server).handleStream at server.go:1313
google.golang.org/grpc.(*Server).serveStreams.func1.1 at server.go:722
runtime.goexit at asm_amd64.s:1357
 - Async stack trace
google.golang.org/grpc.(*Server).serveStreams.func1 at server.go:720

Job

jobs:

- name: deployStorageK
  deploy:
      contract: storage.sol

- name: setStorageBaseBool
  set:
      val: "true"

- name: setStorageBool
  call:
      destination: $deployStorageK
      function: setBool 
      data:
        - $setStorageBaseBool

Sample

{
CallTx
	{
		Input:
		{
			Address:D96DCA9368CADBF5F8813EEFD35C9E228E7F8B21,
			Amount:9999,
			Sequence:103
		},
		GasLimit:1111111111,
		Fee:9999,
		Data: ...,
		ContractMeta:
			[{
				CodeHash:7E997BB145BD3B91F2411E2967183D8431DCF5EEF6359C4FF87B0E21D8118D20,
				Meta:
				{
					ContractName:
					SimpleStorage,
					SourceFile:storage.sol,
					CompilerVersion:0.5.17+commit.d19bba13,
					Abi:
					[
						{constant:true,inputs:[],name:getAddress,outputs:[{internalType:address,name:retAddress,type:address}],payable:false,stateMutability:view,type:function},
						{constant:true,inputs:[],name:getBool,outputs:[{internalType:bool,name:retBool,type:bool}],payable:false,stateMutability:view,type:function},
						{constant:true,inputs:[],name:getBool2,outputs:[{internalType:bool,name:retBool,type:bool}],payable:false,stateMutability:view,type:function},
						{constant:true,inputs:[],name:getBytes,outputs:[{internalType:bytes32,name:retBytes,type:bytes32}],payable:false,stateMutability:view,type:function},
						{constant:true,inputs:[],name:getInt,outputs:[{internalType:int256,name:retInt,type:int256}],payable:false,stateMutability:view,type:function},
						{constant:true,inputs:[],name:getString,outputs:[{internalType:string,name:retString,type:string}],payable:false,stateMutability:view,type:function},
						{constant:true,inputs:[],name:getUint,outputs:[{internalType:uint256,name:retUint,type:uint256}],payable:false,stateMutability:view,type:function},
						{constant:false,inputs:[{internalType:address,name:x,type:address}],name:setAddress,outputs:[],payable:false,stateMutability:nonpayable,type:function},
						{constant:false,inputs:[{internalType:bool,name:x,type:bool}],name:setBool,outputs:[],payable:false,stateMutability:nonpayable,type:function},
						{constant:false,inputs:[{internalType:bool,name:x,type:bool}],name:setBool2,outputs:[],payable:false,stateMutability:nonpayable,type:function},
						{constant:false,inputs:[{internalType:bytes32,name:x,type:bytes32}],name:setBytes,outputs:[],payable:false,stateMutability:nonpayable,type:function},
						{constant:false,inputs:[{internalType:int256,name:x,type:int256}],name:setInt,outputs:[],payable:false,stateMutability:nonpayable,type:function},
						{constant:false,inputs:[{internalType:string,name:x,type:string}],name:setString,outputs:[],payable:false,stateMutability:nonpayable,type:function},
						{constant:false,inputs:[{internalType:uint256,name:x,type:uint256}],name:setUint,outputs:[],payable:false,stateMutability:nonpayable,type:function}
					]
				}
			}]
	}
}

GovTx

GovTx provides a set of TemplateAccounts and GovernanceContext tries to alter the chain state - validatorSet.

github.com/hyperledger/burrow/execution/contexts.(*GovernanceContext).Execute at governance_context.go:32
github.com/hyperledger/burrow/execution.(*executor).Execute at execution.go:254
github.com/hyperledger/burrow/consensus/abci.ExecuteTx at execute_tx.go:30
github.com/hyperledger/burrow/consensus/abci.(*App).CheckTx at app.go:189
github.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync at local_client.go:99
github.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync at app_conn.go:114
github.com/tendermint/tendermint/mempool.(*CListMempool).CheckTx at clist_mempool.go:281
github.com/tendermint/tendermint/mempool.Mempool.CheckTx-fm at mempool.go:18
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxAsyncRaw at transactor.go:237
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSyncRaw at transactor.go:206
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSync at transactor.go:134
github.com/hyperledger/burrow/execution.(*Transactor).BroadcastTxSync at transactor.go:83
github.com/hyperledger/burrow/rpc/rpctransact.(*transactServer).BroadcastTxSync at transact_server.go:55
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler.func1 at rpctransact.pb.go:505
github.com/hyperledger/burrow/rpc.unaryInterceptor.func1 at grpc.go:29
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler at rpctransact.pb.go:507
google.golang.org/grpc.(*Server).processUnaryRPC at server.go:1024
google.golang.org/grpc.(*Server).handleStream at server.go:1313
google.golang.org/grpc.(*Server).serveStreams.func1.1 at server.go:722
runtime.goexit at asm_amd64.s:1357
 - Async stack trace
google.golang.org/grpc.(*Server).serveStreams.func1 at server.go:720

Job

jobs:

- name: InitialTotalPower
  query-vals:
    field: "Set.TotalPower"

- name: AddValidator
  update-account:
    target: 5F0577625C94E3237C800DFAD3FB0949A1761C3013B40E53CC5F64F576BFB986
    native: 333
    power: 33333
    permissions: ["send"]

# Pull power from the validator set in the result of query-vals
- name: CheckAdded
  query-vals:
    field: "Set.${AddValidator.address}.Power"

- name: AssertPowerNonZero
  assert:
    key: $CheckAdded
    relation: gt
    val: 0

Sample

{
GovTx,
	Payload:
	{
		Inputs:
		[{
			Address:D96DCA9368CADBF5F8813EEFD35C9E228E7F8B21,
			Amount:333,Sequence:96
		}],
		AccountUpdates:
		[{
			PublicKey:
			{
				CurveType:ed25519,
				PublicKey:5F0577625C94E3237C800DFAD3FB0949A1761C3013B40E53CC5F64F576BFB986},
				Amounts:[{Type:Native,Amount:333},{Type:Power,Amount:33333}],
				Permissions:[send],
				Roles:[send]
		}]
	}
}

BondTx & UnbondTx

Identify

Identify Node info

github.com/hyperledger/burrow/execution/contexts.(*IdentifyContext).Execute at identify_context.go:24
github.com/hyperledger/burrow/execution.(*executor).Execute at execution.go:254
github.com/hyperledger/burrow/consensus/abci.ExecuteTx at execute_tx.go:30
github.com/hyperledger/burrow/consensus/abci.(*App).CheckTx at app.go:189
github.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync at local_client.go:99
github.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync at app_conn.go:114
github.com/tendermint/tendermint/mempool.(*CListMempool).CheckTx at clist_mempool.go:281
github.com/tendermint/tendermint/mempool.Mempool.CheckTx-fm at mempool.go:18
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxAsyncRaw at transactor.go:237
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSyncRaw at transactor.go:206
github.com/hyperledger/burrow/execution.(*Transactor).CheckTxSync at transactor.go:134
github.com/hyperledger/burrow/execution.(*Transactor).BroadcastTxSync at transactor.go:83
github.com/hyperledger/burrow/rpc/rpctransact.(*transactServer).BroadcastTxSync at transact_server.go:55
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler.func1 at rpctransact.pb.go:505
github.com/hyperledger/burrow/rpc.unaryInterceptor.func1 at grpc.go:29
github.com/hyperledger/burrow/rpc/rpctransact._Transact_BroadcastTxSync_Handler at rpctransact.pb.go:507
google.golang.org/grpc.(*Server).processUnaryRPC at server.go:1024
google.golang.org/grpc.(*Server).handleStream at server.go:1313
google.golang.org/grpc.(*Server).serveStreams.func1.1 at server.go:722
runtime.goexit at asm_amd64.s:1357
 - Async stack trace
google.golang.org/grpc.(*Server).serveStreams.func1 at server.go:720

Job

jobs:

- name: test1
  identify:
      nodekey: ".burrow/config/node_key.json"
      netaddress: "addrewss"

Sample

IdentifyTx,
	Payload:
	{
		Inputs:[{Address:D96DCA9368CADBF5F8813EEFD35C9E228E7F8B21,Sequence:105}],
		Node:
		{
			NetworkAddress:addrewss,
			TendermintNodeID:33F8A47B18EEE5F645BF9F3374AADE371976F8BD,
			ValidatorPublicKey:
			{	
				CurveType:ed25519,
				PublicKey:1EDF9DCA679EFA4A8D29F4099FD81A51D497878D8BBEDE1E161C00E08778CBBE
			}
		}
	}

Proposal

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1444. Elephpotamus Time limit: 0.5 second Memory limit: 64 MB Harry Potter is taking an examination in Care for Magical Creatures. His task is to feed a dwarf elephpotamus. Harry remembers that elephpotamuses are very straightforward and imperturbable. In fact, they are so straightforward that always move along a straight line and they are so imperturbable that only move when attracted by something really tasty. In addition, if an elephpotamus stumbles into a chain of its own footprints, it falls into a stupor and refuses to go anywhere. According to Hagrid, elephpotamuses usually get back home moving along their footprints. This is why they never cross them, otherwise they may get lost. When an elephpotamus sees its footprints, it tries to remember in detail all its movements since leaving home (this is also the reason why they move along straight lines only, this way it is easier to memorize). Basing on this information, the animal calculates in which direction its burrow is situated, then turns and goes straight to it. It takes some (rather large) time for an elephpotamus to perform these calculations. And what some ignoramuses recognize as a stupor is in fact a demonstration of outstanding calculating abilities of this wonderful, though a bit slow-witted creature. Elephpotamuses' favorite dainty is elephant pumpkins, and some of such pumpkins grow on the lawn where Harry is to take his exam. At the start of the exam, Hagrid will drag the elephpotamus to one of the pumpkins. Having fed the animal with a pumpkin, Harry can direct it to any of the remaining pumpkins. In order to pass the exam, Harry must lead the elephpotamus so that it eats as many pumpkins as possible before it comes across its footprints. Input The first input line contains the number of pumpkins on the lawn N (3 ≤ N ≤ 30000). The pumpkins are numbered from 1 to N, the number one being assigned to the pumpkin to which the animal is brought at the start of the trial. In the next N lines, the coordinates of the pumpkins are given in the order corresponding to their numbers. All the coordinates are integers in the range from −1000 to 1000. It is guaranteed that there are no two pumpkins at the same location and there is no straight line passing through all the pumpkins. Output In the first line write the maximal number K of pumpkins that can be fed to the elephpotamus. In the next K lines, output the order in which the animal will eat them, giving one number in a line. The first number in this sequence must always be 1.写一段Java完成此目的
最新发布
06-03

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值