Skip to content

swift-libp2p/libp2p-app-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libp2p-app-template

Clone this repo to get a swift-libp2p template app that makes implementing a libp2p server (host) quick and easy!

How to use

  1. Clone this repo
    1. Click the "Use This Template" button on GitHub
    2. or clone this repo via cli
git clone https://github.com/swift-libp2p/libp2p-app-template.git
  1. Rename the folder and reinitialize git
mv libp2p-app-template <yourappname>
cd <yourappname>
rm -rf .git           # remove git history
git init              # re init git if you'd like
open Package.swift
  1. Configure your server by modifying the App/configure.swift file

  2. Handle your apps custom protocols by replacing the default echo route in App/routes.swift

  3. Build & Run!

# In your projects root directory
swift build
swift run

Other useful commands

swift package reset   # resets the dependency cache
swift package update  # updates all of the dependencies
swift test            # runs the tests in /Tests/AppTests
swift run App routes  # prints the protocols your app supports

# specify the host and port to listen on
swift run App serve --hostname 127.0.0.1 --port 10333  

# runs the custom cowsay command 
swift run App cowsay "Mmooo" --eyes "👀" --tongue "👅" 

About

App Template Test

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages