Skip to content

Commit ecf1837

Browse files
committed
Update docs for new contract deployment output
Signed-off-by: Nicko Guyer <[email protected]>
1 parent 02be346 commit ecf1837

File tree

1 file changed

+69
-190
lines changed

1 file changed

+69
-190
lines changed

docs/tutorials/custom_contracts/ethereum.md

Lines changed: 69 additions & 190 deletions
Original file line numberDiff line numberDiff line change
@@ -126,203 +126,82 @@ You will need compile the contract yourself using [solc](https://docs.solidityla
126126

127127
```json
128128
{
129-
"id": "f2cfd530-76f1-49ec-b1b3-02ab3034aa16",
130-
"namespace": "default",
131-
"tx": "dbbe508e-6229-461c-ad57-427461a25155",
132-
"type": "blockchain_deploy",
133-
"status": "Pending",
134-
"plugin": "ethereum",
135-
"input": {
136-
"contract": "608060405234801561001057600080fd5b5061019e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b5780636d4ce63c14610057575b600080fd5b61005560048036038101906100509190610111565b610075565b005b61005f6100cd565b60405161006c919061014d565b60405180910390f35b806000819055503373ffffffffffffffffffffffffffffffffffffffff167fb52dda022b6c1a1f40905a85f257f689aa5d69d850e49cf939d688fbe5af5946826040516100c2919061014d565b60405180910390a250565b60008054905090565b600080fd5b6000819050919050565b6100ee816100db565b81146100f957600080fd5b50565b60008135905061010b816100e5565b92915050565b600060208284031215610127576101266100d6565b5b6000610135848285016100fc565b91505092915050565b610147816100db565b82525050565b6000602082019050610162600083018461013e565b9291505056fea2646970667358221220e6cbd7725b98b234d07bc1823b60ac065b567c6645d15c8f8f6986e5fa5317c664736f6c634300080b0033",
137-
"definition": [
138-
{
139-
"anonymous": false,
140-
"inputs": [
141-
{
142-
"indexed": true,
143-
"internalType": "address",
144-
"name": "from",
145-
"type": "address"
146-
},
147-
{
148-
"indexed": false,
149-
"internalType": "uint256",
150-
"name": "value",
151-
"type": "uint256"
152-
}
153-
],
154-
"name": "Changed",
155-
"type": "event"
156-
},
157-
{
158-
"inputs": [],
159-
"name": "get",
160-
"outputs": [
161-
{
162-
"internalType": "uint256",
163-
"name": "",
164-
"type": "uint256"
165-
}
166-
],
167-
"stateMutability": "view",
168-
"type": "function"
169-
},
170-
{
171-
"inputs": [
172-
{
173-
"internalType": "uint256",
174-
"name": "newValue",
175-
"type": "uint256"
176-
}
177-
],
178-
"name": "set",
179-
"outputs": [],
180-
"stateMutability": "nonpayable",
181-
"type": "function"
182-
}
129+
"id": "aa155a3c-2591-410e-bc9d-68ae7de34689",
130+
"namespace": "default",
131+
"tx": "4712ffb3-cc1a-4a91-aef2-206ac068ba6f",
132+
"type": "blockchain_deploy",
133+
"status": "Succeeded",
134+
"plugin": "ethereum",
135+
"input": {
136+
"contract": "608060405234801561001057600080fd5b5061019e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b5780636d4ce63c14610057575b600080fd5b61005560048036038101906100509190610111565b610075565b005b61005f6100cd565b60405161006c919061014d565b60405180910390f35b806000819055503373ffffffffffffffffffffffffffffffffffffffff167fb52dda022b6c1a1f40905a85f257f689aa5d69d850e49cf939d688fbe5af5946826040516100c2919061014d565b60405180910390a250565b60008054905090565b600080fd5b6000819050919050565b6100ee816100db565b81146100f957600080fd5b50565b60008135905061010b816100e5565b92915050565b600060208284031215610127576101266100d6565b5b6000610135848285016100fc565b91505092915050565b610147816100db565b82525050565b6000602082019050610162600083018461013e565b9291505056fea2646970667358221220e6cbd7725b98b234d07bc1823b60ac065b567c6645d15c8f8f6986e5fa5317c664736f6c634300080b0033",
137+
"definition": [
138+
{
139+
"anonymous": false,
140+
"inputs": [
141+
{
142+
"indexed": true,
143+
"internalType": "address",
144+
"name": "from",
145+
"type": "address"
146+
},
147+
{
148+
"indexed": false,
149+
"internalType": "uint256",
150+
"name": "value",
151+
"type": "uint256"
152+
}
183153
],
184-
"input": [],
185-
"key": "0xf80c46e1554ba717b958958b47c06926cc546df4",
186-
"options": null
187-
},
188-
"created": "2023-02-02T01:48:27.595543594Z",
189-
"updated": "2023-02-02T01:48:27.595543594Z"
190-
}
191-
```
192-
193-
In the response above, we received back an ID of `f2cfd530-76f1-49ec-b1b3-02ab3034aa16`. Blockchain transacitons happen asynchronously, so this is the operation ID for the contract deployment which we can use to look up the status of the transacaction.
194-
195-
### Request
196-
197-
Copy your operation ID returned in the previous response, and make a GET request to the `/operations` endpoint to look up the status of your transaction. Add the `?fetchstatus=true` query parameter to get full details.
198-
199-
`GET` `http://localhost:5000/api/v1/namespaces/default/operations/f2cfd530-76f1-49ec-b1b3-02ab3034aa16?fetchstatus=true`
200-
201-
### Response
202-
203-
```json
204-
{
205-
"id": "f2cfd530-76f1-49ec-b1b3-02ab3034aa16",
206-
"namespace": "default",
207-
"tx": "dbbe508e-6229-461c-ad57-427461a25155",
208-
"type": "blockchain_deploy",
209-
"status": "Succeeded",
210-
"plugin": "ethereum",
211-
"input": {
212-
"contract": "608060405234801561001057600080fd5b5061019e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b5780636d4ce63c14610057575b600080fd5b61005560048036038101906100509190610111565b610075565b005b61005f6100cd565b60405161006c919061014d565b60405180910390f35b806000819055503373ffffffffffffffffffffffffffffffffffffffff167fb52dda022b6c1a1f40905a85f257f689aa5d69d850e49cf939d688fbe5af5946826040516100c2919061014d565b60405180910390a250565b60008054905090565b600080fd5b6000819050919050565b6100ee816100db565b81146100f957600080fd5b50565b60008135905061010b816100e5565b92915050565b600060208284031215610127576101266100d6565b5b6000610135848285016100fc565b91505092915050565b610147816100db565b82525050565b6000602082019050610162600083018461013e565b9291505056fea2646970667358221220e6cbd7725b98b234d07bc1823b60ac065b567c6645d15c8f8f6986e5fa5317c664736f6c634300080b0033",
213-
"definition": [
214-
{
215-
"anonymous": false,
216-
"inputs": [
217-
{
218-
"indexed": true,
219-
"internalType": "address",
220-
"name": "from",
221-
"type": "address"
222-
},
223-
{
224-
"indexed": false,
225-
"internalType": "uint256",
226-
"name": "value",
227-
"type": "uint256"
228-
}
229-
],
230-
"name": "Changed",
231-
"type": "event"
232-
},
233-
{
234-
"inputs": [],
235-
"name": "get",
236-
"outputs": [
237-
{
238-
"internalType": "uint256",
239-
"name": "",
240-
"type": "uint256"
241-
}
242-
],
243-
"stateMutability": "view",
244-
"type": "function"
245-
},
246-
{
247-
"inputs": [
248-
{
249-
"internalType": "uint256",
250-
"name": "newValue",
251-
"type": "uint256"
252-
}
253-
],
254-
"name": "set",
255-
"outputs": [],
256-
"stateMutability": "nonpayable",
257-
"type": "function"
258-
}
154+
"name": "Changed",
155+
"type": "event"
156+
},
157+
{
158+
"inputs": [],
159+
"name": "get",
160+
"outputs": [
161+
{
162+
"internalType": "uint256",
163+
"name": "",
164+
"type": "uint256"
165+
}
166+
],
167+
"stateMutability": "view",
168+
"type": "function"
169+
},
170+
{
171+
"inputs": [
172+
{
173+
"internalType": "uint256",
174+
"name": "newValue",
175+
"type": "uint256"
176+
}
259177
],
260-
"input": [],
261-
"key": "0xf80c46e1554ba717b958958b47c06926cc546df4",
262-
"options": null
178+
"name": "set",
179+
"outputs": [],
180+
"stateMutability": "nonpayable",
181+
"type": "function"
182+
}
183+
],
184+
"input": [],
185+
"key": "0xddd93a452bfc8d3e62bbc60c243046e4d0cb971b",
186+
"options": null
187+
},
188+
"output": {
189+
"headers": {
190+
"requestId": "default:aa155a3c-2591-410e-bc9d-68ae7de34689",
191+
"type": "TransactionSuccess"
263192
},
264-
"output": {
265-
"Headers": {
266-
"requestId": "default:f2cfd530-76f1-49ec-b1b3-02ab3034aa16",
267-
"type": "TransactionSuccess"
268-
},
269-
"protocolId": "000000000005/000000",
270-
"transactionHash": "0x0ea6a5f95166172d618b238ee3bf221e8033a0ca70a47b3daa4687329b0aa19f"
193+
"contractLocation": {
194+
"address": "0xa5ea5d0a6b2eaf194716f0cc73981939dca26da1"
271195
},
272-
"created": "2023-02-02T01:48:27.595543594Z",
273-
"updated": "2023-02-02T01:48:27.595543594Z",
274-
"detail": {
275-
"created": "2023-02-02T01:48:27.607830552Z",
276-
"firstSubmit": "2023-02-02T01:48:27.612212469Z",
277-
"gas": "213895",
278-
"gasPrice": 0,
279-
"history": [
280-
{
281-
"count": 1,
282-
"info": "Success=true,Receipt=000000000005/000000,Confirmations=0,Hash=0x0ea6a5f95166172d618b238ee3bf221e8033a0ca70a47b3daa4687329b0aa19f",
283-
"lastOccurrence": null,
284-
"time": "2023-02-02T01:48:27.615983719Z"
285-
},
286-
{
287-
"count": 1,
288-
"info": "Submitted=true,Receipt=,Hash=0x0ea6a5f95166172d618b238ee3bf221e8033a0ca70a47b3daa4687329b0aa19f",
289-
"lastOccurrence": null,
290-
"time": "2023-02-02T01:48:27.612957219Z"
291-
}
292-
],
293-
"id": "default:f2cfd530-76f1-49ec-b1b3-02ab3034aa16",
294-
"lastSubmit": "2023-02-02T01:48:27.612212469Z",
295-
"nonce": "4",
296-
"policyInfo": null,
297-
"receipt": {
298-
"blockHash": "0xffe58230ecc3269d82494258bf22330ed4105cc4afa8fdd6b25f452d4df94556",
299-
"blockNumber": "5",
300-
"extraInfo": {
301-
"contractAddress": "0xa5ea5d0a6b2eaf194716f0cc73981939dca26da1",
302-
"cumulativeGasUsed": "142597",
303-
"from": "0xf80c46e1554ba717b958958b47c06926cc546df4",
304-
"gasUsed": "142597",
305-
"status": "1",
306-
"to": null
307-
},
308-
"protocolId": "000000000005/000000",
309-
"success": true,
310-
"transactionIndex": "0"
311-
},
312-
"sequenceId": "01860fcf-9457-f275-ce66-955eff5f6642",
313-
"status": "Succeeded",
314-
"transactionData": "0x608060405234801561001057600080fd5b5061019e806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b5780636d4ce63c14610057575b600080fd5b61005560048036038101906100509190610111565b610075565b005b61005f6100cd565b60405161006c919061014d565b60405180910390f35b806000819055503373ffffffffffffffffffffffffffffffffffffffff167fb52dda022b6c1a1f40905a85f257f689aa5d69d850e49cf939d688fbe5af5946826040516100c2919061014d565b60405180910390a250565b60008054905090565b600080fd5b6000819050919050565b6100ee816100db565b81146100f957600080fd5b50565b60008135905061010b816100e5565b92915050565b600060208284031215610127576101266100d6565b5b6000610135848285016100fc565b91505092915050565b610147816100db565b82525050565b6000602082019050610162600083018461013e565b9291505056fea2646970667358221220e6cbd7725b98b234d07bc1823b60ac065b567c6645d15c8f8f6986e5fa5317c664736f6c634300080b0033",
315-
"transactionHash": "0x0ea6a5f95166172d618b238ee3bf221e8033a0ca70a47b3daa4687329b0aa19f",
316-
"transactionHeaders": {
317-
"from": "0xf80c46e1554ba717b958958b47c06926cc546df4",
318-
"gas": "213895"
319-
},
320-
"updated": "2023-02-02T01:48:27.615983719Z"
321-
}
196+
"protocolId": "000000000024/000000",
197+
"transactionHash": "0x32d1144091877266d7f0426e48db157e7d1a857c62e6f488319bb09243f0f851"
198+
},
199+
"created": "2023-02-03T15:42:52.750277Z",
200+
"updated": "2023-02-03T15:42:52.750277Z"
322201
}
323202
```
324-
Here we can see in the response above under the `detail` field that our new contract address is `0xa5ea5d0a6b2eaf194716f0cc73981939dca26da1`. This is the address that we will reference in the rest of this guide.
325203

204+
Here we can see in the response above under the `output` section that our new contract address is `0xa5ea5d0a6b2eaf194716f0cc73981939dca26da1`. This is the address that we will reference in the rest of this guide.
326205

327206
## The FireFly Interface Format
328207

0 commit comments

Comments
 (0)