Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Last active May 11, 2019 03:25
Show Gist options
  • Save alexytiger/2be5375649d6a8522c616ab0eec463f3 to your computer and use it in GitHub Desktop.
Save alexytiger/2be5375649d6a8522c616ab0eec463f3 to your computer and use it in GitHub Desktop.
@Injectable({
providedIn: 'root'
})
export class IpfsDaemonService {
constructor(@Inject(ipfsToken) private ipfs) {}
public getVersion(): Observable<string> {
return from(this.ipfs.version()).pipe(
tap((res: any) => console.log(`IPFS node version object: ${JSON.stringify(res)}`)),
map(res => res.version),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment