diff --git a/Makefile b/Makefile index 5a45cfd..38490f2 100644 --- a/Makefile +++ b/Makefile @@ -21,9 +21,10 @@ libs: $(COMPILER) ./lib/declassifyutil.trp -l $(COMPILER) ./lib/stdio.trp -l $(COMPILER) ./lib/timeout.trp -l + $(COMPILER) ./lib/raft.trp -l + $(COMPILER) ./lib/raft_debug.trp -l $(COMPILER) ./lib/bst.trp -l $(COMPILER) ./lib/localregistry.trp -l - $(COMPILER) ./lib/raft_troupe.trp -l test: mkdir -p out diff --git a/examples/network/aliases.json b/examples/network/aliases.json deleted file mode 100644 index 9f20c3f..0000000 --- a/examples/network/aliases.json +++ /dev/null @@ -1 +0,0 @@ -{"pingpong-listener":"12D3KooWK5UgRtP27Jdujm79Pq3QLJ5Gttg2PucDF8Hppd7txJiA","pingpong-dialer":"12D3KooWQ6DqK22D98Ro4WopLhsGPkUyb2d3EvckDrvSYta4E3Y6"} \ No newline at end of file diff --git a/examples/network/ids/pingpong-dialer.json b/examples/network/ids/pingpong-dialer.json deleted file mode 100644 index b0c774e..0000000 --- a/examples/network/ids/pingpong-dialer.json +++ /dev/null @@ -1 +0,0 @@ -{"id":"12D3KooWQ6DqK22D98Ro4WopLhsGPkUyb2d3EvckDrvSYta4E3Y6","privKey":"CAESQMLauuc9ZpSyyUT6M2aEVHOmpWKtu1iJ1RgoF9J27chG1BN8ReNF+MDNiTWrpC3T66mQdb/lo1Rq0PDXJR2KmWs=","pubKey":"CAESINQTfEXjRfjAzYk1q6Qt0+upkHW/5aNUatDw1yUdiplr"} \ No newline at end of file diff --git a/examples/network/ids/pingpong-listener.json b/examples/network/ids/pingpong-listener.json deleted file mode 100644 index 36eab90..0000000 --- a/examples/network/ids/pingpong-listener.json +++ /dev/null @@ -1 +0,0 @@ -{"id":"12D3KooWK5UgRtP27Jdujm79Pq3QLJ5Gttg2PucDF8Hppd7txJiA","privKey":"CAESQJrfEr15UL1tJWbldgZzBh9T9Y9RrkRSAzDT4lKeK9EqiZhB5ZFmAGv3Q8cidbFUpoizcWTqTBIZjYmLn3n4jL8=","pubKey":"CAESIImYQeWRZgBr90PHInWxVKaIs3Fk6kwSGY2Ji595+Iy/"} \ No newline at end of file diff --git a/examples/network/pingpong/aliases.json b/examples/network/pingpong/aliases.json index 8dbf6b0..8607337 100644 --- a/examples/network/pingpong/aliases.json +++ b/examples/network/pingpong/aliases.json @@ -1 +1 @@ -{"pingpong-listener":"12D3KooWRreQ2wg6auezZE2FW5BYaRTW56HH7oPe5EPcwnTDACms","pingpong-dialer":"12D3KooW9yLx9GWMoh58Q3eLwnjSDgZ22pNcbULn1rL1B3g5dCCH"} \ No newline at end of file +{"pingpong-listener":"QmNLstfWyBabHSoCATbjUKyiTkiBbGMRfXKuT2b8Bv62AW","pingpong-dialer":"QmVVBs2C1C9rP72jmHcuJkzvZRPE2WBWUyCPwa7tNavFh7"} \ No newline at end of file diff --git a/examples/network/pingpong/ids/pingpong-dialer.json b/examples/network/pingpong/ids/pingpong-dialer.json index b32dc86..d64c738 100644 --- a/examples/network/pingpong/ids/pingpong-dialer.json +++ b/examples/network/pingpong/ids/pingpong-dialer.json @@ -1 +1 @@ -{"id":"12D3KooW9yLx9GWMoh58Q3eLwnjSDgZ22pNcbULn1rL1B3g5dCCH","privKey":"CAESQF6wIGIGQ5xtPa0aYpASt5nB02lIpyHoKZ/9B7RA3htpAkzZ1fgk6YZabzX9Cx9RMMU6++VHbbJr9eJ7mtgZd9o=","pubKey":"CAESIAJM2dX4JOmGWm81/QsfUTDFOvvlR22ya/Xie5rYGXfa"} \ No newline at end of file +{"id":"QmVVBs2C1C9rP72jmHcuJkzvZRPE2WBWUyCPwa7tNavFh7","privKey":"CAASpwkwggSjAgEAAoIBAQCmU3JZoXROh/HGZTxcQlg2Hun/U6zK0CE+jN7p63cEqfG1rYq6QmQ9oKdTTS7L4Vvtx9JCrcjsXIHQuKBTg1ZS8+hy3ZBo7TbgtYNvD9A8MQW2R6dqurNzUKn1qaxpZl13sQT7ol4cFF4viwMwAo128FeG2k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UVCGYWajsdp+SCGktfAOMZ5PzVKKm7pnKnueQ5r3bY8b4IvtN/rf/1OYMDgXqmvbKxVjx2NRQwr3ypiY1+m/AqowAvUBXfCFoXHIxLXenN5B5NTMgipA95aQ6b5twvjQ394kONmIeip2pqW57D64v5Q6bIasJkJFChfZAoGAYyVkaNVHr8bdH9oxEPbVN40xhVD9J1SaJlk+JERmqtLn9TcXRqT3zvm27W+YQw7E4wEHITjT1P7l7sJ+8n1mzAUjsie8dTLoZ68TvwZC1ktIPU6tUkpefDya+IMbN3DU7X2jrk4y56hnofgK/AzKdBVK/cONoYXtWkotJ0EUZcw=","pubKey":"CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCmU3JZoXROh/HGZTxcQlg2Hun/U6zK0CE+jN7p63cEqfG1rYq6QmQ9oKdTTS7L4Vvtx9JCrcjsXIHQuKBTg1ZS8+hy3ZBo7TbgtYNvD9A8MQW2R6dqurNzUKn1qaxpZl13sQT7ol4cFF4viwMwAo128FeG2k1W4un+D9evg/8FfAbOBxsyTil97R1rWHHtyPobtr+zOV7a9mcbutaKzxWbWjZUQnJcd+BMyesFDYIAZhPYGC458jWkB7/1Sw6nWKIVuh1DDQiQ4AThzp7ks9JLbVKUNzumVn9zOy0CrVlmB3GVj7p77mzJkGuDZqh5CcsK9gs11i/xz5rfuZisqxGDAgMBAAE="} \ No newline at end of file diff --git a/examples/network/pingpong/ids/pingpong-listener.json b/examples/network/pingpong/ids/pingpong-listener.json index f1157a8..61931cf 100644 --- a/examples/network/pingpong/ids/pingpong-listener.json +++ b/examples/network/pingpong/ids/pingpong-listener.json @@ -1 +1 @@ -{"id":"12D3KooWRreQ2wg6auezZE2FW5BYaRTW56HH7oPe5EPcwnTDACms","privKey":"CAESQF79dRdiG8tJ5zRBtAU3UMBSOGSPwRzdsgj5pNnOwHb/7lCAtk+OET71pdXNBhOSUQ64O4qdNCwp13M2Ul9VqF4=","pubKey":"CAESIO5QgLZPjhE+9aXVzQYTklEOuDuKnTQsKddzNlJfVahe"} \ No newline at end of file +{"id":"QmNLstfWyBabHSoCATbjUKyiTkiBbGMRfXKuT2b8Bv62AW","privKey":"CAASqAkwggSkAgEAAoIBAQDfhqItLOHTl6cw9hxWkdHipCtlLk5f2NkE4Suebb6h4WpFR8qafNJ8qJLXGxMaYW50OBeMDdnnsefpYbbC2CNgKUx2AnzZ784AdzeDUTTZDwdePwJSuemx1tlSgbw4KADLP8pYNleuflKyUqzdojpc47Sn1gv6zcYPolz+1aSP0Xl76UoRgdm8Zymzxk+xKyxyBYxgCkYu7RNwkoE7hpOyl7eRGPNG31978NR9vu5XdXri27ez51lHpZq7KBgquONFtfok4eEEF26qIJbcb/4xl73I8eXH+FJGqHgyzSyAp0guHXM8Fg+xuenmY0sNtVBAgFbB6unSJWQMFmnxBNoLAgMBAAECggEBAJOSy5ePvjh4M0W79tGgzDUZthzDCbN18zGph6a9RdKShBrhXv3H0x/CG9Awa9hK4yWPstwgePDjH/2RKZxSHmjqWzS+R7eK/zKHgvsLrhxwM6khaGM9ovBqrGgwhxd8Man+n5TFq/XkKKzasI5TAL07CJaWVqprGIxR4ZvNaSwZIERJCLHafn08aC4GVukXeWMoH0ya+WViKev6sGIq39MUHevnA/itpNrj51Btlqs8FHPaMMHzPSxcjEzBIo5upUKqklo7fsx/XE7sp9FeE7h3AaItZMzv/aFJpvMe/m33z7HZHKTBxleU0RnxAKPsW1ZIRr2PNM4wAvfb1XgJcGECgYEA+MN1klZVcUvmniiP8oQ9YHfc0rpC6FKQKJQdizZKQkkrm1m5ulSHx+JuAl0Nk4PcO9g8ZKuI9HLmCeK1fM8MF+rKlmDipI5ajU6P1sryZkzQAFIJLRfjnRub5uuVJWkTedIualE/QADllWEbVOw5eAZIKUAKOd+/kGh9wIWepP8CgYEA5gc63XZJBMgZI1N2hKeN6MmQHABEDacv4mA6Ymhg9y8JmsK890w3wHHdf2NI64rCvELWlPdyfet7SL/xxVI/pYE2ejJXvhrSe6ZARKLEifZ3c3nllHDQ1z2DXyXonhoevfLNdghED5sVvX0ajc246JC4/PrxmEWs18gMvOXVDvUCgYEA2wUUbewvPBosiNGDs200sMu3k51ErVGL9P47aMc66FON3jBIcsJb7ePxIYmWG2v8KoB+48+XPEoxOUDus12D80bYaUASK/ndxg4GXIHAm8tDUxTnWVlwIHIfeFewsAhsilRAY4D3JD3l5PhjXQjCrGczf4YPutbBzb4CAdBjVjcCgYB+AyvuMmRh6DRNM+XTWe7VvcXicQrW5+XFf628Ry4He48pZtEaMHjCRh5vMLa7wjJX682docjozl2lRvFthVc0lYqAep+ylwMDldnTP8+nPIvHiNmJ7huaLiqPrza1ld2NdTu1E2YlnnHUcnpfgHlxfga5H8fGATVkqETCHq4PGQKBgBGUpKmxcVbUNWE8zeOf19nqr5y6dovn3Wm6T1NqBP7yOpEK3wuSOwjwhqy4vdcSHcudiFQAurUVP3cz5WXbdhZp3B8g68VFfq+61fcxMDlXeiIhWxJdqmD2LZPGv4jg+oxB40cJC1R6x5WGuqQQNo/ezrtqP9Q/5XyX80alUXaK","pubKey":"CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDfhqItLOHTl6cw9hxWkdHipCtlLk5f2NkE4Suebb6h4WpFR8qafNJ8qJLXGxMaYW50OBeMDdnnsefpYbbC2CNgKUx2AnzZ784AdzeDUTTZDwdePwJSuemx1tlSgbw4KADLP8pYNleuflKyUqzdojpc47Sn1gv6zcYPolz+1aSP0Xl76UoRgdm8Zymzxk+xKyxyBYxgCkYu7RNwkoE7hpOyl7eRGPNG31978NR9vu5XdXri27ez51lHpZq7KBgquONFtfok4eEEF26qIJbcb/4xl73I8eXH+FJGqHgyzSyAp0guHXM8Fg+xuenmY0sNtVBAgFbB6unSJWQMFmnxBNoLAgMBAAE="} \ No newline at end of file diff --git a/examples/network/pingpong/p2ppingpong.trp b/examples/network/pingpong/p2ppingpong.trp index 2091752..a6313f2 100644 --- a/examples/network/pingpong/p2ppingpong.trp +++ b/examples/network/pingpong/p2ppingpong.trp @@ -4,17 +4,13 @@ let fun pingpong () = val {counter, pid=sender} = receive [hn x => x] val _ = send (sender, {counter=counter + 1, pid=self()}) val _ = print counter - in - (if counter + 1 > 100 then - print (getTime()) else ()); - pingpong() + in pingpong() end in let val processA = spawn ("@pingpong-listener", pingpong) val _ = print processA val processB = spawn ("@pingpong-dialer", pingpong) val _ = print processB - val _ = print (getTime()) val _ = send (processA,{counter = 1, pid =processB}) in () end diff --git a/lib/out/lists.exports b/lib/out/lists.exports index db2a6ba..cf5a5c3 100644 --- a/lib/out/lists.exports +++ b/lib/out/lists.exports @@ -9,6 +9,7 @@ length append partition nth +contains filter first slice diff --git a/lib/out/raft.exports b/lib/out/raft.exports new file mode 100644 index 0000000..a34226e --- /dev/null +++ b/lib/out/raft.exports @@ -0,0 +1,6 @@ +START +pre_machine +spawn_machine +CLIENT_COMMAND +CLIENT_COMMAND_RESPONSE +NOT_LEADER \ No newline at end of file diff --git a/lib/out/raft_debug.exports b/lib/out/raft_debug.exports new file mode 100644 index 0000000..a34226e --- /dev/null +++ b/lib/out/raft_debug.exports @@ -0,0 +1,6 @@ +START +pre_machine +spawn_machine +CLIENT_COMMAND +CLIENT_COMMAND_RESPONSE +NOT_LEADER \ No newline at end of file