Glow-Lang / glow

The Glow language for Blockchain Decentralized Applications.
https://glow-lang.org
Apache License 2.0
58 stars 8 forks source link

Noel/libp2p entrypoint #398

Closed kwannoel closed 2 years ago

kwannoel commented 3 years ago

Implement Barebones of: https://github.com/Glow-Lang/glow/issues/106.

Run buy_sig over libp2p

To run the buy_sig interaction over libp2p, in one terminal run:

a_addr=/ip/127.0.0.1/tcp/10333
./glow start-interaction -O $a_addr -E pet -C libp2p -W

You will be prompted:

Starting libp2p client
I am /ip4/127.0.0.1/tcp/10333/ipfs/<PeerId>
...

Copy that into dest in the second terminal, and run:

b_addr=/ip/127.0.0.1/tcp/10300
dest=/ip4/127.0.0.1/tcp/10333/ipfs/<PeerId>
./glow start-interaction -O $b_addr -C libp2p -E pet -D $dest --database alice

Select the relevant options to run the buy_sig interaction.

Run the buy_sig over libp2p test case locally

./unit-tests.ss test t/buy-sig-libp2p-local-integration-test.ss

Progress

Polishes

Priority

kwannoel commented 3 years ago

How to initialize libp2p daemon with participant keypairs

See https://github.com/libp2p/go-libp2p-daemon for installing p2pd, p2p-keygen. Use the -id flag to configure private-key when starting daemon:

p2pd -id <private_key_file>

Use the following command to generate sample private keys:

p2p-keygen -f <private_key_file
bennewhall commented 2 years ago

I was having issues running this initially, however it worked when I did a_addr=/ip4/127.0.0.1/tcp/10333 and b_addr=/ip4/127.0.0.1/tcp/10300

I think something having to do with /ip not being a protocol