kwannoel / urban-octo-carnival

DRAFT REPO: trying out gitlab -> github
Apache License 2.0
1 stars 0 forks source link

Draft: Request for timeout-in-blocks when starting interaction #376

Open kwannoel opened 3 years ago

kwannoel commented 3 years ago

In GitLab by @kwanzknoel on Sep 2, 2021, 23:14

With timeouts explicitly requested now:

~/projects/glow $ ./glow start-interaction -E pet
Connecting to the Private Ethereum Testnet at http://localhost:8545 ...

Choose application:
1) buy_sig
2) coin_flip
3) flipper
4) guess
5) hello
6) invalid
7) r
8) rps_simple
9) simple-funds-transfer.solution
10) strings
11) tmp
12) transfer
Enter number
> 1

Choose your identity:
1) aaaa - 0x59F3a8301974CbD5DF02e4aa8300aB1dc8Cb85A9
2) alice - 0x2930D19Cfa8226F9ac0341b014F0463A27bB2576
3) bob - 0x2B0D6826492c235a379e299A0DF832b512967B9a
4) charles - 0x47312084A1026E2B5ae7E3A7ef6f328421740961
Enter number
> 2

Choose your role:
1) Buyer
2) Seller
Enter number
> 1

Assign roles
Select address for Seller:
1) aaaa - 0x59F3a8301974CbD5DF02e4aa8300aB1dc8Cb85A9
2) alice - 0x2930D19Cfa8226F9ac0341b014F0463A27bB2576
3) bob - 0x2B0D6826492c235a379e299A0DF832b512967B9a
4) charles - 0x47312084A1026E2B5ae7E3A7ef6f328421740961
Enter number
> 3

Define parameters
Enter digest
> 0x50d963548fa5fd82277986f34c8ffda4df35b4be8d395fb0eff28f386c874bc0
Enter price
> 100

Timeout in blocks
> 0

One line command for other participants to generate the same agreement:
glow start-interaction --agreement '{"glow-version":"Glow v0.1.0-192-gaa44fe8","interaction":"buy_sig#payForSignature","participants":{"Buyer":"0x2930D19Cfa8226F9ac0341b014F0463A27bB2576","Seller":"0x2B0D6826492c235a379e299A0DF832b512967B9a"},"parameters":{"digest":"0x50d963548fa5fd82277986f34c8ffda4df35b4be8d395fb0eff28f386c874bc0","price":"0x64"},"reference":{},"options":{"blockchain":"Private Ethereum Testnet","timeoutInBlocks":"0x0","maxInitialBlock":"0x0"},"code-digest":"0xc08d53d633136a534e6eeb9b143ee558a9ac65e17990cff8543f9bcac9e99c8e"}'

Executing code block begin0 ...
(add-to-deposit price)
(@debug-label dlb1)

Send the handshake below to the other participant:
{"agreement":{"glow-version":"Glow v0.1.0-192-gaa44fe8","interaction":"buy_sig#payForSignature","participants":{"Buyer":"0x2930D19Cfa8226F9ac0341b014F0463A27bB2576","Seller":"0x2B0D6826492c235a379e299A0DF832b512967B9a"},"parameters":{"digest":"0x50d963548fa5fd82277986f34c8ffda4df35b4be8d395fb0eff28f386c874bc0","price":"0x64"},"reference":{},"options":{"blockchain":"Private Ethereum Testnet","timeoutInBlocks":"0x0","maxInitialBlock":"0x0"},"code-digest":"0xc08d53d633136a534e6eeb9b143ee558a9ac65e17990cff8543f9bcac9e99c8e"},"contract-config":{"contract-address":"0x60C43a56A5f766D3c51Af80d8e547A821ff14c83","code-hash":"0x509970962a83a786f5f1cd0f6d0695409bf87b401e1bd6182ac19d039c1cb8e2","creation-hash":"0x65890d170f46e1347be0de7555b272899bf1c027588deba40ca99988f5d95bf9","creation-block":"0x8b3"},"published-data":"0x"}

Waiting for Seller to make a move ...
Timed out waiting for other participant; claiming escrowed funds...

buy_sig#payForSignature interaction finished
Final environment:
Buyer => (address<-0x "0x2930D19Cfa8226F9ac0341b014F0463A27bB2576")
Seller => (address<-0x "0x2B0D6826492c235a379e299A0DF832b512967B9a")
digest => (bytes<-0x "0x50d963548fa5fd82277986f34c8ffda4df35b4be8d395fb0eff28f386c874bc0")
price => 100