Skip to content

felfele/mobileswarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Mobileswarm

Build Ethereum Swarm on mobile

Dependencies

In order to build the library you will need to have gomobile installed.

https://godoc.org/golang.org/x/mobile/cmd/gomobile

Building the library

After this you can build Mobileswarm:

$ cd $GOPATH/src/github.com/felfele/mobileswarm

Make android version:

$ make android

This will build an android archive (.aar) file called mobileswarm.aar in the build/ directory. You can copy this file to your android project.

Then you can use it in the Java code like this:

import mobileswarm.Mobileswarm;

// ...

    String applicationPath = getAbsolutePath();
    String listenAddress = ":0"; // bind to all interface, any available port
    String bootnodeURL = "enode://4c113504601930bf2000c29bcd98d1716b6167749f58bad703bae338332fe93cc9d9204f08afb44100dc7bea479205f5d162df579f9a8f76f8b402d339709023@3.122.203.99:30301";
    String logLevel = "debug"; // can be info, trace etc.
    String startResult = Mobileswarm.startNode(applicationPath, listenAddress, bootnodeURL, logLevel);

    // ...

    String stopResult = Mobileswarm.stopNode();

Make iOS version:

$ make ios

This will build an iOS framework, called Mobileswarm.framework in the build/ directory. You can copy this directory to your iOS project.

Then you can use it in the Objective-C code like this:

#import <Mobileswarm/Mobileswarm.h>

// ...

    NSString *appFolderPath = [self getPathForDirectory:NSDocumentDirectory];
    NSString *listenAddress = @":0"; // bind to all interface, any available port
    NSString *bootnodeURL = @"";
    NSString *logLevel = @"debug"; // can be info, trace etc.
    NSString *startResult = MobileswarmStartNode(appFolderPath, listenAddress, bootnodeURL, logLevel);
    NSLog(@"startResult: %@", startResult);

    // ...

    NSString *stopResult = MobileswarmStopNode();
    NSLog(@"stopResult: %@", stopResult);

Issues

Currently Swarm has a vendored dependency of go-ethereum which causes the build to break. A workaround for this problem is to rename or delete the vendor/github.com/ethereum/go-ethereum directory in the Swarm source.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published